Span
A single operation within a trace: one LLM call, one tool invocation, one retrieval. The granular unit of observability data.
Last updated: April 26, 2026
Definition
A span represents one unit of work inside a larger trace. For agents, common spans include: llm.complete (one model call with prompt and response), tool.execute (one tool call with input and output), retrieval.search (one vector search with query and results), and agent.step (one iteration of the agentic loop). Spans nest hierarchically: an agent.step span contains llm.complete spans which may trigger tool.execute spans. Each span has a start time, end time, attributes (model, latency, tokens), and optionally an error status.
When To Use
Use the OpenTelemetry span model wherever possible. Most LLMOps platforms (Langfuse, LangSmith, Phoenix) accept OTel spans natively, so you avoid lock-in.
Building with Span?
I've shipped this pattern in real production systems. If you want a second pair of eyes on your architecture, that's what I do.