# Agno Trace Agno agents with cetra from Python: agent runs, model calls and tool calls. Trace Agno agents with cetra from Python: agent runs, model calls and tool calls. ## Install **Python** ```bash pip install "cetra-sdk[agno]" agno openai ``` ## Set up **Python** ```python import os import cetra from agno.agent import Agent from agno.models.openai import OpenAIChat cetra.init(instrument=["agno"]) def get_weather(city: str) -> str: """Look up the weather for a city.""" return f"sunny in {city}" agent = Agent( name="weather-agent", model=OpenAIChat(id="gpt-4o-mini", api_key=os.environ["OPENAI_API_KEY"]), tools=[get_weather], instructions="You are a weather assistant.", ) agent.run("What is the weather in Paris?") cetra.flush() ``` ## What you get - An agent run is an `agent` span named after the agent, with the run's input and output. - Each model call is an `llm` span with the messages, the tool definitions, the token counts and the cost, computed from the built-in prices. - Each tool call is a `tool` span with the tool's input and output. - The Agno session (`session.id`) becomes the trace's session. ## Limits - Do not also enable `openai`: each model call would be recorded twice and counted twice. - Agno sends its own telemetry unless `AGNO_TELEMETRY` is `false`. - The fixture was captured with agno 3.2.0 and openinference-instrumentation-agno 1.2.0. - If a field is missing, look at the span's **Attributes** tab and compare it with [Span attributes](https://cetra.sh/docs/reference/attributes/). ## Next - [Traces](https://cetra.sh/docs/tracing/traces/): read the trace as a tree and a timeline. - [Cost and tokens](https://cetra.sh/docs/tracing/cost-and-tokens/): how cost is computed from the token counts. - [Online rules](https://cetra.sh/docs/evaluation/online-rules/): score these traces automatically.