From the course: Build with AI: Create Agents with the OpenAI Agents SDK
Unlock this course with a free trial
Join today to access over 24,900 courses taught by industry experts.
Visualize and debug agents with tracing - OpenAI API Tutorial
From the course: Build with AI: Create Agents with the OpenAI Agents SDK
Visualize and debug agents with tracing
- When your agent runs, a lot happens behind the scenes. Tool calls, handoffs, reasoning, guardrails, and responses, but how do you actually see what's going on? Tracing shows what your agent actually did. Every run captures LLM generations, tool calls, handoffs, and guardrails in a single view. You can open the Traces dashboard to see step-by-step spans, timings, and inputs or outputs. Tracing is on by default and can be disabled globally or per run. There are two core ideas here. A trace is one end-to-end workflow run with an optional workflow name and group ID to link related runs. Spans are the nested steps inside a trace, like an agent span, generation span, function span, guardrail span, and handoff span. You can also group multiple runs into a single higher level trace to see multi turn flows in one place, and you can turn off capturing sensitive data if you need to. Using the Traces dashboard, you can debug…