> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agno.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Enable AgentOS Tracing

> Enable OpenTelemetry tracing for a served agent with one AgentOS flag.

Enable OpenTelemetry tracing for a served agent with one AgentOS flag. Agent runs, model calls, and tool calls become spans; the same flag also covers teams and workflows registered with the OS.

```python basic.py theme={null}
"""
Enable AgentOS Tracing
======================

Enable OpenTelemetry tracing for a served agent with one AgentOS flag. Agent
runs, model calls, and tool calls become spans; the same flag also covers teams
and workflows registered with the OS.

Prerequisites: OPENAI_API_KEY is needed only to run the served agent
Run: .venvs/demo/bin/python cookbook/05_agent_os/13_observability/basic.py
Try: Open http://localhost:7777/traces and /traces/filter-schema
"""

from agno.agent import Agent
from agno.db.sqlite import SqliteDb
from agno.models.openai import OpenAIResponses
from agno.os import AgentOS

# ---------------------------------------------------------------------------
# Create Traced AgentOS
# ---------------------------------------------------------------------------

db = SqliteDb(
    id="observability-basic-db",
    db_file="tmp/observability_basic.db",
)

traced_agent = Agent(
    id="traced-assistant",
    name="Traced Assistant",
    model=OpenAIResponses(id="gpt-5.5"),
    instructions="Answer operational questions clearly and concisely.",
)

agent_os = AgentOS(
    id="observability-basic-os",
    description="AgentOS with OpenTelemetry tracing stored in SQLite.",
    db=db,
    agents=[traced_agent],
    tracing=True,
)
app = agent_os.get_app()

# ---------------------------------------------------------------------------
# Run Traced AgentOS
# ---------------------------------------------------------------------------

if __name__ == "__main__":
    agent_os.serve(app=app)
```

## Run the Example

<Steps>
  <Snippet file="create-venv-step.mdx" />

  <Step title="Install dependencies">
    ```bash theme={null}
    uv pip install -U "agno[os]" openai
    ```
  </Step>

  <Step title="Export your OpenAI API key">
    <CodeGroup>
      ```bash Mac/Linux theme={null}
      export OPENAI_API_KEY="your_openai_api_key_here"
      ```

      ```bash Windows theme={null}
      $Env:OPENAI_API_KEY="your_openai_api_key_here"
      ```
    </CodeGroup>
  </Step>

  <Step title="Run the example">
    Save the code above as `basic.py`, then run:

    ```bash theme={null}
    python basic.py
    ```
  </Step>
</Steps>

Full source: [cookbook/05\_agent\_os/13\_observability/basic.py](https://github.com/agno-agi/agno/blob/v3.0.4/cookbook/05_agent_os/13_observability/basic.py)
