Registry /
observability / opentelemetry-instrumentation-agno
Install & Compatibility
Where this runs
tested against v0.62.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 107.9MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 11.8s · import 0.000s · 109MB
110MB installed
● package 110MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
AgnoInstrumentor
✓ from openinference.instrumentation.agno import AgnoInstrumentor
The primary class to enable Agno instrumentation.
This quickstart demonstrates how to set up OpenTelemetry to automatically instrument an Agno agent application. It configures a `TracerProvider` with an `OTLPSpanExporter` to send traces to an OpenTelemetry collector and then initializes the `AgnoInstrumentor` before running a simple Agno agent. Ensure your OpenTelemetry collector is running and accessible at the configured OTLP endpoint.
import os
from opentelemetry import trace
from opentelemetry.sdk.resources import Resource
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import SimpleSpanProcessor
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
from openinference.instrumentation.agno import AgnoInstrumentor
# Agno related imports for the example
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.tools.duckduckgo import DuckDuckGoTools
# Configure OpenTelemetry TracerProvider
resource = Resource.create({"service.name": "agno-agent-app"})
provider = TracerProvider(resource=resource)
# Export spans to an OTLP collector (e.g., SigNoz, Jaeger, Arize Phoenix)
# Replace with your actual OTLP endpoint if not using default localhost
otlp_endpoint = os.environ.get("OTEL_EXPORTER_OTLP_ENDPOINT", "http://localhost:4318/v1/traces")
span_processor = SimpleSpanProcessor(OTLPSpanExporter(endpoint=otlp_endpoint))
provider.add_span_processor(span_processor)
# Set the global TracerProvider
trace.set_tracer_provider(provider)
# Initialize Agno instrumentation
AgnoInstrumentor().instrument()
# Example Agno Agent application
print("Agno Agent started...")
agent = Agent(
model=OpenAIChat(id=os.environ.get("OPENAI_MODEL_ID", "gpt-4o-mini")),
tools=[DuckDuckGoTools()],
markdown=True,
debug_mode=True,
)
response = agent.print_response("What is the current weather in London?")
print(f"Agent Response: {response}")
print("Agno Agent finished. Check your OTLP collector for traces.")
# In a real application, you might want to ensure all spans are exported
# before the application exits. For this simple example, we rely on
# the SimpleSpanProcessor flushing on shutdown. For production, consider BatchSpanProcessor.
provider.shutdown()
Debug
Known issues
gotchaOpenTelemetry SDK must be initialized before AgnoInstrumentation. If `trace.set_tracer_provider()` is called after `AgnoInstrumentor().instrument()` or after Agno components are imported, no traces will be emitted as API calls will use a no-op implementation.fixEnsure `trace.set_tracer_provider(provider)` is called early in your application's lifecycle, prior to importing or initializing any Agno-related code or calling `AgnoInstrumentor().instrument()`.
affects: All versions
breakingThe OpenTelemetry semantic conventions, particularly for Generative AI (GenAI), are actively evolving. Recent versions of `opentelemetry-instrumentation-agno` frequently update to align with new OpenTelemetry GenAI semantic conventions (e.g., changes to `gen_ai.tool.name`). This can lead to breaking changes in attribute names or structures if your observability backend or custom analysis tools rely on older semantic conventions.fixMonitor OpenTelemetry semantic convention releases and your instrumentation library's updates. Consider using the `OTEL_SEMCONV_STABILITY_OPT_IN` environment variable (e.g., `OTEL_SEMCONV_STABILITY_OPT_IN=http/dup` for HTTP) to manage compatibility during migration, and update your dashboards/queries accordingly. For Agno-specific attributes, refer to the `openinference-semantic-conventions` documentation.
affects: 0.53.0 and newer (due to active updates)
gotchaThis instrumentation library only works if the `agno` package is installed alongside it. Without `agno` present, the instrumentation will not find the target library to patch, and no Agno-specific traces will be generated.fixEnsure `agno` is included in your project dependencies and installed in the environment where your application runs (e.g., `pip install agno`).
affects: All versions
Upgrade
Version history
0.62.3latest on PyPI · released Aug 10, 2026
Audit
Dependencies
agnorequiredThe core AI agent library being instrumented.
opentelemetry-apirequiredOpenTelemetry API for Python.
opentelemetry-sdkrequiredOpenTelemetry SDK for Python, required for application instrumentation.
openinference-semantic-conventionsrequiredProvides semantic conventions for tracing LLM applications, used by OpenInference instrumentations.
opentelemetry-semantic-conventionsrequiredStandard OpenTelemetry semantic conventions.
pythonrequiredRequired Python version.