A trace is the full record of one request through your app, start to finish. A span is one timed step inside that trace, such as a single LLM call or a retrieval query.
Spans nest. Each one has a parent, so a trace forms a tree with one root span. Every span carries a name, start and end times, and a status. Its attributes hold the model, the prompt and response, and token counts with cost.
trace: chat_request (2.4s) user=u_912 session=s_44
├── span: retrieve_docs (310ms) k=5, index=faq_v3
├── span: llm_call (1.9s) model=..., in=1200 tok, out=180 tok
└── span: guardrail_check (60ms) verdict=pass
This is what makes debugging possible. You see which step was slow, and what the model actually received. You can also attach eval scores to one span or to the whole trace.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
The diagram below the answer is the concept . Jump to it ↓