Skip to main content
Set tracing=True on AgentOS to record agent, team, workflow, model, and tool spans in a database. View stored traces in the AgentOS UI.
For a comprehensive introduction to Agno Tracing concepts (traces, spans, and what gets captured), see the Tracing Overview.

Prerequisites

Install the required packages:

Database Configuration

How you configure tracing depends on your database setup:
We recommend a separate, dedicated database for traces. It keeps them all in one place, which makes them easier to query and analyze.

Single Database Setup

If all your agents and teams share the same database instance, enabling tracing is simple:
In this setup, traces are automatically stored in the shared database alongside sessions and other data.

Multiple Databases Setup

When agents or teams have different databases, it is highly recommended that you specify a dedicated db to ensure all traces are stored in one central location.
If you have multiple agents with their own databases, traces need a dedicated database:

Why Use a Dedicated Tracing Database?

Without db, AgentOS stores all traces in the first database it finds from your agents, teams, or workflows. The selected database depends on component order. With a dedicated 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 use setup_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.
Use a dedicated db when traces need separate retention, access, or scaling policies.