Skip to main content
When running agents in production, understanding what’s happening inside your system becomes critical. Agents make autonomous decisions, call external APIs, and coordinate in ways that aren’t visible from logs alone. Tracing gives you the observability you need to debug failures, identify performance bottlenecks, and understand agent behavior. AgentOS provides built-in tracing support that integrates seamlessly with the AgentOS UI. Enable tracing with a simple flag and instantly gain visibility into every agent run, model call, and tool execution—all viewable directly in your AgentOS dashboard.
For a comprehensive introduction to Agno Tracing concepts (traces, spans, and what gets captured), see the Tracing Overview.
This guide covers how to configure tracing in AgentOS based on your database setup. After running your agent/team, you can view the traces in the AgentOS UI.

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:
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 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
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.
Best Practice: Always use a dedicated db in production, even with a single agent. This keeps observability data separate and makes it easier to scale or migrate later.