How do I see one whole conversation in an agent built with the OpenAI Agents SDK?
Rius shows one whole conversation when you scope each run with rius.session() and reuse your conversation or ticket id, so every turn lands in one session. The openai integration records the model calls on its own, and a few observe wrappers add the run and tool structure. You then open the session from any trace header, or paste its id into the Spans search box to list every span in the conversation.
How it works
The OpenAI Agents SDK drives the OpenAI client underneath, so the openai integration captures its model calls with no framework-specific code. Three things come from different places:
- Recorded on its own. Every model call arrives as an LLM generation with model, tokens, cost and time to first token. Rius computes the cost from the model and token counts, and you never send it.
- Needs a wrapper of your own. The agent loop, the tool executions and the handoffs run inside the framework, and auto-instrumentation only sees the client calls that come out of it. An
observewrapper on your entrypoint gives you a root AGENT span, and anobservewrapper with the TOOL kind on each tool body gives you a TOOL span. - Needs a session of your own. The framework has no idea which turns belong together. You tell Rius with
rius.session(), reusing the conversation or ticket id you already have. Without a session id, each trace is its own session.
In the trace, the root AGENT span is your entrypoint, each model call is an LLM span, and each tool is a TOOL span. A handoff gets no span of its own. It shows only as consecutive generations that belong to different agents. Responses API calls are all named Response, so the span name does not say which agent spoke.
The framework’s built-in tracing uploads to the OpenAI platform and is independent of OpenTelemetry. Disable it with set_tracing_disabled(True) if Rius should be your single telemetry path. Leaving it on reports to two backends but does not interfere with Rius.
Set it up
-
Install the SDK with the openai extra and the framework. The OpenAI Agents SDK page covers this setup in full, and the Integrations page lists the other frameworks.
pip install "glassflow-rius[openai]" openai-agents -
Initialize Rius, turn off the framework’s own tracing, and wrap the entrypoint and the tool bodies. Put
@function_tooloutermost andobserveon the function body, so the framework still reads the signature for its tool schema.import rius from agents import Agent, Runner, function_tool, set_tracing_disabled from rius import SpanKind rius.init(api_key="ri_...", service_name="my-agent") set_tracing_disabled(True) @function_tool @rius.observe(kind=SpanKind.TOOL) def account_status(email: str) -> str: """Fetch a customer's account standing by email.""" return lookup(email) support_agent = Agent( name="support_agent", instructions="Answer support questions; check accounts with the tool.", tools=[account_status], model="gpt-5-mini", ) @rius.observe(name="handle-ticket", kind=SpanKind.AGENT) def handle_ticket(ticket: str) -> str: result = Runner.run_sync(support_agent, ticket) return str(result.final_output) -
Scope every turn of one conversation with
rius.session(), passing the same conversation or ticket id each time. Callhandle_ticketinside that session for turn one, turn two and so on. Each turn is its own trace, and all of them share the session. -
If handoff boundaries matter to you, add an
observewrapper per agent entry, or use the framework’sRunHooksto open spans at agent boundaries. Use underscores in agent names, because hyphens are rewritten in the generated handoff tool name and the framework warns on every run. -
Run a conversation with a few turns, one of which calls a tool, and open the console.
What you get
- One list for the whole conversation. Open any trace from the conversation and use the Session link in its header. It opens the Spans tab filtered to that session, with every span from every turn.
- Search by id. Paste the conversation id into the search box on the Spans tab and it lists every span in that session. The box matches span names, span IDs, trace IDs and session IDs.
- Per-turn detail. Open a single trace in the waterfall view to see the root AGENT span, the LLM spans with their token counts inline, and your named TOOL spans. The header shows the session, total tokens and cost. See Exploring traces for the tree, map and span views.
- What changed between calls. On an LLM span with captured messages, Since previous llm call shows what each step added to the prompt. In a long conversation, this shows how the history grows.
- Cost per call. Costs are list-price estimates in US dollars, priced from the model and token counts.
Streamed runs carry token counts only when usage is enabled on the underlying OpenAI client, which the OpenAI integration page explains. For the wider picture of watching agents in production, read Monitor AI agents in production.
When something else fits
- If your agent is built on a different framework, start from Integrations, where each framework’s page says what it records on its own and what needs a wrapper.
- If you need the handoff itself as a span, add the per-agent
observewrappers orRunHooksdescribed above, since the framework gives Rius no handoff span to record. - The integration for this framework is for Python. For another language, trace the model calls with manual generations.