{"library":"openinference-instrumentation-agno","title":"OpenInference Agno Instrumentation","description":"OpenInference Agno Instrumentation is a Python auto-instrumentation library designed to trace Agno Agents. It is fully OpenTelemetry-compatible, enabling users to send detailed traces of their AI applications to OpenTelemetry collectors such as Arize Phoenix, Langfuse, or LangSmith. The current version is 0.1.30, with a frequent release cadence tied to the broader OpenInference project.","language":"python","status":"active","last_verified":"Sun May 17","install":{"commands":["pip install openinference-instrumentation-agno agno opentelemetry-sdk opentelemetry-exporter-otlp"],"cli":null},"imports":["from openinference.instrumentation.agno import AgnoInstrumentor"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import os\nimport asyncio\nfrom agno.agent import Agent\nfrom agno.models.openai import OpenAIChat\nfrom agno.tools.duckduckgo import DuckDuckGoTools\nfrom openinference.instrumentation.agno import AgnoInstrumentor\nfrom opentelemetry import trace as trace_api\nfrom opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter\nfrom opentelemetry.sdk.trace import TracerProvider\nfrom opentelemetry.sdk.trace.export import SimpleSpanProcessor\n\n# Configure OpenTelemetry to export traces (e.g., to Arize Phoenix or Langfuse)\n# For local Phoenix, run 'phoenix serve' in another terminal.\n# For Langfuse/LangSmith, set corresponding environment variables like LANGFUSE_PUBLIC_KEY, LANGFUSE_SECRET_KEY, LANGSMITH_API_KEY, etc.\n# Example for a local OTLP endpoint (like Phoenix):\notlp_endpoint = os.environ.get('OTEL_EXPORTER_OTLP_ENDPOINT', 'http://127.0.0.1:6006/v1/traces')\n\n# Configure the tracer provider\ntracer_provider = TracerProvider()\ntracer_provider.add_span_processor(SimpleSpanProcessor(OTLPSpanExporter(endpoint=otlp_endpoint)))\ntrace_api.set_tracer_provider(tracer_provider=tracer_provider)\n\n# Instrument Agno\nAgnoInstrumentor().instrument()\n\nasync def main():\n    # Create and configure an Agno agent\n    agent = Agent(\n        model=OpenAIChat(id=os.environ.get('OPENAI_MODEL_ID', 'gpt-4o-mini')),\n        tools=[DuckDuckGoTools()],\n        markdown=True,\n        debug_mode=True,\n    )\n    \n    # Use the agent\n    print(\"Agent is running...\")\n    response = await agent.run(\"What is the capital of France?\")\n    print(f\"Agent response: {response.content}\")\n\nif __name__ == \"__main__\":\n    # Set a dummy OpenAI API key if not already set, for agent initialization\n    if not os.environ.get('OPENAI_API_KEY'):\n        os.environ['OPENAI_API_KEY'] = 'sk-DUMMY_KEY_FOR_TESTING'\n    \n    asyncio.run(main())\n\nprint(f\"Traces should be sent to {otlp_endpoint}\")","lang":"python","description":"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.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-17","installed_version":"0.1.25","pypi_latest":"0.1.33","is_stale":true,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":12,"avg_import_s":0.96,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"openinference-instrumentation-agno","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.55,"mem_mb":16.3,"disk_size":"110.8M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"openinference-instrumentation-agno","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":13,"import_time_s":0.4,"mem_mb":16.3,"disk_size":"109M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"openinference-instrumentation-agno","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.79,"mem_mb":17.4,"disk_size":"123.5M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"openinference-instrumentation-agno","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":11.7,"import_time_s":0.68,"mem_mb":17.4,"disk_size":"121M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"openinference-instrumentation-agno","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.93,"mem_mb":17.6,"disk_size":"113.0M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"openinference-instrumentation-agno","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":10.1,"import_time_s":0.94,"mem_mb":17.6,"disk_size":"111M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"openinference-instrumentation-agno","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.9,"mem_mb":15.6,"disk_size":"112.9M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"openinference-instrumentation-agno","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":10.1,"import_time_s":0.84,"mem_mb":15.6,"disk_size":"111M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"openinference-instrumentation-agno","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":1.85,"mem_mb":30.7,"disk_size":"109.2M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"openinference-instrumentation-agno","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":14.9,"import_time_s":1.69,"mem_mb":30.7,"disk_size":"107M"}]}}