Quick Start
1
Create a Trace
2
Nested Spans
User Interaction Flow
TraceContext
Main tracing context that manages spans.Methods
SpanKind
Type of operation being traced.SpanStatus
Status of a span.Span
Represents a unit of work.Methods
SpanEvent
Events within a span.Methods
TraceExporter Trait
Export traces to various backends.Built-in Exporters
Example: Full Tracing
Best Practices
Use appropriate SpanKind
Use appropriate SpanKind
Categorize spans correctly for better visualization and filtering.
Add meaningful attributes
Add meaningful attributes
Include model names, token counts, user IDs - data useful for debugging.
Use events for milestones
Use events for milestones
Events mark important points within a span without creating new spans.
Always end spans
Always end spans
Use try/finally patterns or RAII to ensure spans are always closed.
Related
Telemetry
Metrics and telemetry
Callbacks
Event callbacks

