Skip to content
GitHubLog inStart free
cetra is not released yet. These docs describe the development version.

Agno

Trace Agno agents with cetra from Python: agent runs, model calls and tool calls.

Terminal window
pip install "cetra-sdk[agno]" agno openai
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()
  • 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.
  • 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.