Sessions
Reading a whole multi-turn conversation as one unit.
A session is one conversation
A session is one multi-turn conversation, reassembled from its traces. When a chatbot answers five messages, that is five separate traces, one per turn. Give them all the same session.id and Observe ties them back into one conversation that sits one level above the trace: the session holds the ordered traces, and each trace holds its spans. The name is OpenTelemetry’s own, and setting it once around a turn’s work carries it to every span inside, just like the trace ID.
flowchart TD accTitle: A session holds the ordered traces of one conversation accDescr: One session holds three traces, turn 1, turn 2, and turn 3, and each trace holds its spans. S["Session (session.id)"] --> T1["Trace (turn 1)"] S --> T2["Trace (turn 2)"] S --> T3["Trace (turn 3)"] T1 --> P1["spans"] T2 --> P2["spans"] T3 --> P3["spans"]
Take a three-turn support chat. Each turn is its own request, so each is its own trace, but all three share session.id="chat_abc". Observe rolls them into one row you read top to bottom, from the opening question to the resolution, with the whole conversation’s duration, cost, and token count in one place. Reuse that same ID across turns and the conversation grows, a fresh ID each turn would leave you with sessions of one trace each.
When to use
Reach for a session when the problem runs across turns, not a single request: the assistant that kept losing track across a conversation, someone who drops off or escalates halfway through a flow, or any time you want the whole chat’s duration, cost, and tokens at once instead of per request.
When the grain is wrong, reach elsewhere:
- Debugging a single request: open its trace, a session is too coarse
- Rolling up by person, not conversation: use Users, which gathers every conversation one person had
- Aggregate trends across many sessions: build a dashboard
Why it matters
A conversation’s problems are invisible one request at a time. Whether the assistant stayed coherent across turns, where someone gave up, what a whole support chat cost, none of it shows on a single trace. Grouping the turns into a session puts the conversation back together, so you debug and measure the thing your user actually lived through, not the fragments of it.
Keep exploring
Questions & Discussion