Agent Wealth HubFree public resources
中文 EN العربية

Back to catalog / Agent observability

Trace model, tool, and handoff spans in an agent run

Correlate model calls, tool execution, guardrails, and handoffs in one workflow timeline for diagnosis.

Goal

Identify where an agent task slowed, failed, or diverged from expectations.

Steps

  1. Set tracing scope, retention, and sensitive fields that must never be recorded. [openai-tracing]
  2. Wrap one or more Runner.run(...) calls in with trace("agent-workflow"): to group them in one trace. [openai-tracing]
  3. Use SDK tracing or a custom processor to capture agent, model, tool, and handoff spans. [openai-tracing]
  4. Call flush_traces() after the trace closes when immediate export is needed; configure a processor or disable tracing per policy. [openai-tracing]
  5. Restrict export under organizational data policy; disable external tracing when prohibited. [openai-tracing]

How to verify

A single workflow trace should locate tool and model stages; verify no keys or unnecessary personal data are recorded.

Troubleshooting

If spans are missing, check tracing configuration and processor flushing; do not log credentials to diagnose export.

Permissions

Prerequisites

Permissions

Limitations

Tracing is enabled by default and unavailable under ZDR. Keep tokens, personal data, and sensitive tool payloads out of trace metadata.

Pinned upstream source

https://github.com/openai/openai-agents-python/blob/f53c62451c7f34c15f0c87fa745e05404025420f/docs/tracing.md

Repository
openai/openai-agents-python
File path
docs/tracing.md
Pinned commit
f53c62451c7f34c15f0c87fa745e05404025420f
Source checked
2026-10-14 · Reviewed against the pinned upstream source

Repository metrics

These values describe the upstream repository, not popularity or likes for an individual skill or playbook.

Stars
Not collected
Forks
Not collected
Observed at
Not collected

No metrics snapshot is available yet.

License: MIT

Main topic

Take a coding Agent change from context to verification

Related resources