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

# Basic Team Tracing

> Enable tracing and observability for teams.

Enable tracing for a team to automatically capture all team operations, member agent runs, model calls, and tool executions in your database.

**1. Create a Python file**

```python basic_team_tracing.py theme={null}
from agno.agent import Agent
from agno.db.sqlite import SqliteDb
from agno.models.openai import OpenAIResponses
from agno.team import Team
from agno.tools.hackernews import HackerNewsTools
from agno.tracing import setup_tracing

# Set up database for traces
db = SqliteDb(db_file="tmp/traces.db")

# Enable tracing (call once at startup)
setup_tracing(db=db)

# Create member agent - no need to set tracing on each one!
hackernews_agent = Agent(
    name="HackerNews Agent",
    model=OpenAIResponses(id="gpt-5.2"),
    tools=[HackerNewsTools()],
    instructions="You are a hacker news agent. Answer questions concisely.",
    markdown=True,
)

# Create team with the agent as a member
team = Team(
    name="HackerNews Team",
    model=OpenAIResponses(id="gpt-5.2"),
    members=[hackernews_agent],
    instructions="You are a hacker news team. Use the HackerNews Agent to answer questions.",
    db=db,
)

# Run the team - traces are captured automatically
team.print_response("What's trending on HackerNews?")

# Query traces from the database
traces, count = db.get_traces(team_id=team.id, limit=10)
print(f"\nFound {count} traces for team '{team.name}'")
for trace in traces:
    print(f"  - {trace.name}: {trace.duration_ms}ms ({trace.status})")
```

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

**2. Install dependencies**

```bash theme={null}
uv pip install -U openai agno sqlalchemy opentelemetry-api opentelemetry-sdk openinference-instrumentation-agno
```

**3. Export your OpenAI API key**

```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"
```

**4. Run the team**

```bash Mac theme={null}
python basic_team_tracing.py
```

```bash Windows theme={null}
python basic_team_tracing.py
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.