Skip to main content
This example shows how to enable tracing for a team in AgentOS. When tracing=True is set, all team operations, member agent runs, model calls, and tool executions are automatically captured.
1

Create a Python file

touch basic_team_tracing.py
2

Add the following code to your Python file

basic_team_tracing.py
from agno.agent import Agent
from agno.db.sqlite import SqliteDb
from agno.models.openai import OpenAIChat
from agno.os import AgentOS
from agno.team import Team
from agno.tools.hackernews import HackerNewsTools

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

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

team = Team(
    name="HackerNews Team",
    model=OpenAIChat(id="gpt-5-mini"),
    members=[agent],
    instructions="You are a hacker news team. Answer questions concisely using HackerNews Agent member",
    db=db,
)

# Setup AgentOS with tracing enabled
# This automatically enables tracing for ALL agents and teams!
agent_os = AgentOS(
    description="Example app for tracing HackerNews",
    teams=[team],
    tracing=True,
)
app = agent_os.get_app()

if __name__ == "__main__":
    agent_os.serve(app="basic_team_tracing:app", reload=True)
3

Create a virtual environment

Open the Terminal and create a python virtual environment.
python3 -m venv .venv
source .venv/bin/activate
4

Install libraries

pip install -U openai agno opentelemetry-api opentelemetry-sdk openinference-instrumentation-agno
5

Export your OpenAI API key

export OPENAI_API_KEY="your_openai_api_key_here"
6

Run AgentOS

python basic_team_tracing.py
Your AgentOS will be available at http://localhost:7777. View traces in the AgentOS dashboard.