Registry /
observability / openinference-instrumentation-agno
Install & Compatibility
Where this runs
tested against v0.1.37 · 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.920 runs
installs and imports cleanly · install 0.0s · import 0.938s · 111MB
glibcpy 3.10–3.920 runs
installs and imports cleanly · install 11.9s · import 0.841s · 109MB
113MB installed
● package 113MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
AgnoInstrumentor
✓ from openinference.instrumentation.agno import AgnoInstrumentor
This quickstart demonstrates how to instrument an Agno agent using `openinference-instrumentation-agno` and export traces via OpenTelemetry. It sets up a `TracerProvider` with an `OTLPSpanExporter` to send traces to a specified endpoint (e.g., a local Arize Phoenix instance). The `AgnoInstrumentor` is then initialized and used to automatically trace the agent's operations. Ensure `agno`, an LLM provider (like `openai`), and OpenTelemetry exporters are installed, and relevant API keys/endpoints are configured via environment variables.
import os
import asyncio
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.tools.duckduckgo import DuckDuckGoTools
from openinference.instrumentation.agno import AgnoInstrumentor
from opentelemetry import trace as trace_api
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import SimpleSpanProcessor
# Configure OpenTelemetry to export traces (e.g., to Arize Phoenix or Langfuse)
# For local Phoenix, run 'phoenix serve' in another terminal.
# For Langfuse/LangSmith, set corresponding environment variables like LANGFUSE_PUBLIC_KEY, LANGFUSE_SECRET_KEY, LANGSMITH_API_KEY, etc.
# Example for a local OTLP endpoint (like Phoenix):
otlp_endpoint = os.environ.get('OTEL_EXPORTER_OTLP_ENDPOINT', 'http://127.0.0.1:6006/v1/traces')
# Configure the tracer provider
tracer_provider = TracerProvider()
tracer_provider.add_span_processor(SimpleSpanProcessor(OTLPSpanExporter(endpoint=otlp_endpoint)))
trace_api.set_tracer_provider(tracer_provider=tracer_provider)
# Instrument Agno
AgnoInstrumentor().instrument()
async def main():
# Create and configure an Agno agent
agent = Agent(
model=OpenAIChat(id=os.environ.get('OPENAI_MODEL_ID', 'gpt-4o-mini')),
tools=[DuckDuckGoTools()],
markdown=True,
debug_mode=True,
)
# Use the agent
print("Agent is running...")
response = await agent.run("What is the capital of France?")
print(f"Agent response: {response.content}")
if __name__ == "__main__":
# Set a dummy OpenAI API key if not already set, for agent initialization
if not os.environ.get('OPENAI_API_KEY'):
os.environ['OPENAI_API_KEY'] = 'sk-DUMMY_KEY_FOR_TESTING'
asyncio.run(main())
print(f"Traces should be sent to {otlp_endpoint}")
Upgrade
Version history
0.1.37latest on PyPI · released Jun 11, 2026
Audit
Dependencies
agnorequiredThe instrumentation targets the Agno agent framework.
opentelemetry-sdkrequiredProvides the core OpenTelemetry SDK components for tracing.
opentelemetry-exporter-otlprequiredEnables exporting traces to an OTLP-compatible backend (e.g., Phoenix, Langfuse, LangSmith).
openinference-instrumentationrequiredCore utilities and helpers for OpenInference instrumentations.
openinference-semantic-conventionsrequiredDefines semantic conventions for AI/LLM tracing within OpenInference.
wraptrequiredUsed for Python function wrapping and instrumentation.
typing-extensionsrequiredProvides backports of features from future Python typing versions.