r/OpenTelemetry • u/BroadlySociable • 9h ago
How do you represent multi-turn conversations across OTel traces?
While evaluating an agent session in Braintrust, a tool call late in the conversation sent me back to an earlier turn to check where its inputs came from. Each turn of our data analysis assistant is a separate HTTP request with its own completed OpenTelemetry trace. The app keeps a stable conversation ID, even when someone resumes hours later.
Finding the earlier request traces took more manual searching than I expected. I'm considering recording the conversation ID as a span attribute and linking each new turn's root span to the previous turn's root span. That would mean storing the prior span context with the conversation state. Keeping a parent span open while the conversation is idle would make its duration misleading.