For a comprehensive introduction to Agno Tracing concepts (traces, spans, and what gets captured), see the Tracing Overview.
Prerequisites
Install the required OpenTelemetry packages:Understanding Database Configuration
How you configure tracing depends on your database setup:It is recommended to use a seperate dedicated database for traces. This ensures all traces are stored in one central location, making it easier to query and analyze.
Single Database Setup
If all your agents and teams share the same database instance, enabling tracing is simple:Multiple Databases Setup
If you have multiple agents with their own databases, traces need a dedicated database:Why Use a Dedicated Tracing Database?
Withoutdb, AgentOS will store traces in the first database it finds from your agents or teams. This leads to:
- Fragmented traces: Traces scattered across different databases
- Incomplete observability: Can’t query all traces from one place
- Unpredictable behavior: Which database gets traces depends on agent order
db:
- Unified observability: All traces in one queryable location
- Cross-agent analysis: Compare performance across agents
- Independent scaling: Traces don’t affect agent data storage
- Predictable behavior: You control exactly where traces go
Using setup_tracing() with AgentOS
You can also usesetup_tracing() for more control over tracing configuration. In this case, you still need to ensure the tracing database is available to AgentOS:
Even when using
setup_tracing(), pass db to AgentOS so traces are accessible through the AgentOS API and UI.