agno-observability

Instrument Agno v2 agents with OpenTelemetry tracing, structured logging, and metrics.

Updated Sep 10, 2026
One-click install
npx skills add https://github.com/allankltsn/setup_kiro --skill agno-observability-allankltsn
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: agno-observability
Source: https://github.com/allankltsn/setup_kiro/tree/main/.kiro/skills/agno-observability
Command: npx skills add https://github.com/allankltsn/setup_kiro --skill agno-observability-allankltsn

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires opentelemetry, aws-lambda-powertools.

What problem does it solve? Agno agents run as black boxes: without instrumentation you cannot see which model was called, why a fallback happened, or whether latency meets your SLA. This Skill provides the practices to add tracing, structured logs, and metrics to any Agno v2 agent, in local development and in AWS production. ## Core Features & Use Cases - Three-signal observability: OpenTelemetry traces for model/tool/team spans, one-line JSON structured logs via configure_agno_logging, and metrics via OTel or CloudWatch EMF. - Environment-aware backends: local dev with SigNoz, Jaeger, Langfuse, or Grafana; production exclusively on CloudWatch Logs/EMF and X-Ray via the ADOT Lambda layer. - RAG observability: retrieval spans and metrics (hit rate, chunks per query, context tokens) toggled by environment variables without touching domain code. - Use Case: You deploy an Agno agent on AWS Lambda behind API Gateway and need to trace a failed fallback to a specific span, query fallback rates in CloudWatch Logs Insights, and alarm when p95 latency breaches the SLA. ## Quick Start Instrument my Agno agent with structured JSON logging, OpenTelemetry tracing correlated by request_id, and X-Ray export via the ADOT layer for Lambda production.

Frequently Asked Questions about agno-observability

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add OpenTelemetry tracing to an Agno agent?▼

Agno v2 is auto-instrumented with OpenTelemetry, so you only configure the exporter. In AgentOS set tracing=True; outside AgentOS initialize OTel manually and point OTEL_EXPORTER_OTLP_ENDPOINT at your backend, such as a local collector on localhost:4317.

How do I trace Agno agents on AWS Lambda with X-Ray?▼

X-Ray tracing of Agno spans requires the ADOT Lambda layer, since X-Ray does not accept OTLP natively. Attach the ADOT layer, set AWS_LAMBDA_EXEC_WRAPPER=/opt/otel-instrument and OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317, and grant AWSXRayDaemonWriteAccess.

Does Tracing: Active on Lambda capture Agno agent spans?▼

No, Tracing: Active alone only captures infrastructure segments for Lambda and API Gateway, such as cold starts and invocation duration. The internal Agno spans for model calls, tools, and tokens require the ADOT layer to forward OTLP data to X-Ray.

How do I replace the default Agno logger with structured JSON logs?▼

Build a standard logging.Logger with a StreamHandler that emits one-line JSON, then pass it to configure_agno_logging via custom_default_logger and custom_agent_logger. Log one event per request with fields like request_id, provider, latency_ms, and used_fallback.

What observability backends should I use for Agno in production?▼

Production uses exclusively AWS managed services: CloudWatch Logs for logs, X-Ray via ADOT for traces, and CloudWatch EMF for metrics with alarms. SigNoz, Grafana, and Langfuse are local development backends only and should not receive production traffic.

Why should session_id not be a metric dimension?▼

High-cardinality dimensions like session_id or user_id explode metric costs and storage. Those identifiers belong in logs and traces for correlation, while metrics should aggregate low-cardinality dimensions such as provider or result.