What is Tracing?
Tracing captures:- Agent runs: Complete execution flows
- Model calls: LLM requests and responses
- Tool executions: Tool calls with arguments and results
- Team coordination: Multi-agent interactions
- Workflow steps: Workflow execution paths
- Performance metrics: Latency, token usage, costs
Quick Start
Enable tracing with a single function call:How It Works
Agno uses OpenTelemetry for instrumentation:Automatic Capture
Agno automatically captures traces for:
agent.run()andagent.arun()team.run()andteam.arun()workflow.run()andworkflow.arun()- All model calls
- All tool executions
Configuration
Basic Setup
Batch Processing
For high-throughput applications, use batch processing:Production Database
Use PostgreSQL for production:What Gets Traced
Agent Runs
Every agent run is traced:Model Calls
All LLM requests are captured:Tool Executions
Tool calls with full context:Team Coordination
Multi-agent interactions:Workflow Execution
Workflow step tracking:Querying Traces
Query traces from your database:Performance Analysis
Analyze performance bottlenecks:Cost Tracking
Monitor LLM costs:Debugging
Use traces to debug issues:Integration with Observability Platforms
Agno traces use OpenTelemetry, compatible with:- Arize Phoenix: AI observability platform
- Langfuse: LLM tracing and analytics
- Datadog: Full-stack observability
- New Relic: Application performance monitoring
- Honeycomb: Distributed tracing
Export to External Platform
Best Practices
Setup Once
Call
setup_tracing() once at application startup, not per requestUse Batching
Enable batch processing for production workloads
Database Choice
Use PostgreSQL for production, SQLite for development
Regular Cleanup
Archive or delete old traces to manage database size
Trace Lifecycle
Trace Schema
Traces follow OpenTelemetry standard:Next Steps
Evaluations
Use traces to evaluate agent performance
Learning
Analyze traces to identify learning opportunities
Guardrails
Monitor guardrail effectiveness with traces
Reasoning
Debug reasoning steps with detailed traces