Skip to content

Span types

BaseSpan #

Bases: BaseModel

Base data class representing a span.

Parameters:

Name Type Description Default
id_ str

Id of span.

'4fe43f31-9b1b-4a57-a0b1-22d85313f8cb'
parent_id str | None

Id of parent span.

None
tags Dict[str, Any]
{}
Source code in llama-index-core/llama_index/core/instrumentation/span/base.py
 6
 7
 8
 9
10
11
12
class BaseSpan(BaseModel):
    """Base data class representing a span."""

    model_config = ConfigDict(arbitrary_types_allowed=True)
    id_: str = Field(default_factory=lambda: str(uuid4()), description="Id of span.")
    parent_id: Optional[str] = Field(default=None, description="Id of parent span.")
    tags: Dict[str, Any] = Field(default={})