Agno
Trace Agno agents with cetra from Python: agent runs, model calls and tool calls.
Install
Section titled “Install”pip install "cetra-sdk[agno]" agno openaiSet up
Section titled “Set up”import os
import cetrafrom agno.agent import Agentfrom 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
Section titled “What you get”- An agent run is an
agentspan named after the agent, with the run’s input and output. - Each model call is an
llmspan with the messages, the tool definitions, the token counts and the cost, computed from the built-in prices. - Each tool call is a
toolspan with the tool’s input and output. - The Agno session (
session.id) becomes the trace’s session.
Limits
Section titled “Limits”- Do not also enable
openai: each model call would be recorded twice and counted twice. - Agno sends its own telemetry unless
AGNO_TELEMETRYisfalse. - 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.
- Traces: read the trace as a tree and a timeline.
- Cost and tokens: how cost is computed from the token counts.
- Online rules: score these traces automatically.