Demonstrates the built-in automatic tracing system that captures all agent workflow events without any setup required.
Sign in to save downloads to your library and vote.
Preview
Default Tracing
Demonstrates the built-in automatic tracing system that captures all agent workflow events without any setup required.
๐ฏ What This Demonstrates
- Automatic Tracing: Built-in workflow monitoring (enabled by default)
- Trace IDs: Unique identifiers for each agent run
- OpenAI Dashboard: Free trace visualization platform
- Tracing Configuration: Enabling and disabling trace capture
๐ Quick Start
-
Install OpenAI Agents SDK:
pip install openai-agents -
Set up environment:
cp ../env.example .env # Edit .env and add your OpenAI API key -
Run the agent:
import asyncio from agent import main # Test default tracing (automatic) asyncio.run(main())
๐ก Key Concepts
- Zero Setup Required: Tracing works automatically out of the box
- Unique Run IDs: Each
Runner.run()gets a unique trace identifier - Automatic Capture: LLM calls, tool executions, performance metrics
- Free Dashboard: View traces at platform.openai.com/traces
๐งช Automatic Capture
What Gets Traced Automatically
- LLM Generations: Input prompts, model responses, token usage
- Tool Calls: Function executions, parameters, results
- Handoffs: Agent-to-agent delegations
- Performance: Execution time, latency metrics
- Errors: Exceptions and failure modes
Trace Information
result = await Runner.run(agent, "Hello")
print(f"Trace ID: {result.run_id}")
# Each run gets a unique identifier for dashboard lookup
Separate Traces
- Each
Runner.run()call = One trace - Multiple runs = Multiple separate traces
- Independent workflow tracking
๐ป Tracing Examples
Basic Automatic Tracing
# Tracing happens automatically - no setup required!
result = await Runner.run(agent, "Explain machine learning")
print(f"View trace: https://platform.openai.com/traces/{result.run_id}")
Tracing Configuration
# Disable tracing for specific runs
result = await Runner.run(
agent,
"Private conversation",
run_config=RunConfig(tracing_disabled=True)
)
Multiple Traces
# Each run creates a separate trace
result1 = await Runner.run(agent, "Question 1") # Trace 1
result2 = await Runner.run(agent, "Question 2") # Trace 2
๐ Dashboard Features
OpenAI Traces Dashboard
- Workflow Timeline: Visual execution flow
- Performance Metrics: Response times, token usage
- Error Tracking: Exception details and stack traces
- Content Inspection: Input/output content review
Free Access
- No additional setup required
- Accessible with OpenAI API key
- Real-time trace availability
- Historical trace retention
๐ Next Steps
- Custom Tracing - Advanced tracing patterns
- Tutorial 11: Production Patterns - Real-world deployment
Ingestion metadata
- Source catalog
- awesome-llm-apps
- Repository
- Shubhamsaboo/awesome-llm-apps ยท main
- File path
- ai_agent_framework_crash_course/openai_sdk_crash_course/10_tracing_observability/10_1_default_tracing/README.md
- Last refreshed
- 7/23/2026, 10:39:09 PM (4h ago)
- Refresh schedule
- Daily ยท 03:00 UTC
- Dedupe status
- Unique ยท deduped by (source, url)