Usage
RegisterAgentXTracingProcessor once at startup. It hooks into the OpenAI Agents SDK’s global tracing pipeline, so every subsequent Runner.run() call is traced automatically with no per-call changes.
What gets traced
Each top-level agent run (oneRunner.run() / Runner.run_sync() call) produces one trace.
Span kinds: the root span is stamped
agent, LLM child spans llm, and tool child spans tool.
The processor’s constructor takes no name parameter - the root trace is named after the Agents SDK trace name, which defaults to "openai-agent" when the trace carries none.
AgentXTracingProcessor reference
The processor also implements
force_flush() and shutdown(), which both call tracer.flush(). These are invoked automatically by the OpenAI Agents SDK at process exit.
Call
tracer.flush() before your process exits in scripts or one-shot jobs.
In long-running servers it is not required: traces drain automatically in the
background.
