Definition
Span
A span is one individual action inside a trace: an LLM call, a tool call, a RAG retrieval, a guardrail check. Spans nest, so a tool call can contain child spans for the HTTP request and response parsing. For agents, each span should record model, token counts, latency, tool arguments and results, retrieved documents with scores, and where possible the reasoning. Structured logging makes them queryable.

Explained in
Chapter 13: Production AI: Deployment, Monitoring, and Evaluation
The reality of running AI agents. It's nothing like the demo.
Related terms