Skip to main content
Engineering teams use tracing to diagnose failed runs, slow tools, and unexpected model behavior. Set tracing=True to record AgentOS execution spans in a database.
traced_agent_os.py
The AgentOS database stores the agent’s sessions and its traces. View traces in the AgentOS Control Plane or query them through the AgentOS API.

What Tracing Captures

AgentOS uses OpenTelemetry instrumentation and stores the resulting traces in an Agno database.

Choose a Trace Database

Set db explicitly when the runtime contains components with different databases. Component order determines the fallback database when AgentOS has no database of its own.

Use a Dedicated Trace Database

Give each component its application database and pass the trace database to AgentOS:
This layout gives traces their own retention and access policy while the agent keeps its application data in agent_db.

Configure the Span Processor

Use setup_tracing() when you need batched writes or explicit queue settings:
custom_tracing.py
setup_tracing() configures tracing globally, so call it before creating agents and omit tracing=True from AgentOS. Pass the same database to AgentOS so its API and Control Plane can read the stored traces.

Install Dependencies

The AgentOS extra includes the tracing packages:

Next Steps