Skip to main content
A Span represents a single operation within an agent execution. Spans form a parent-child hierarchy within a trace, allowing you to understand the execution flow.

Span Attributes

Common Span Names

Spans are automatically created for various operations:

Attributes by Operation Type

The attributes field contains OpenTelemetry semantic attributes that vary by operation:

LLM Spans

Tool Spans

Methods

to_dict()

Convert the span to a dictionary.
Returns: dict

from_dict()

Create a span from a dictionary.
Parameters:
  • data (dict): Dictionary containing span data
Returns: Span

Usage

Building a Span Tree

See Also