Skip to main content

Integrating Agno with OpenLIT

OpenLIT is an open-source, self-hosted, OpenTelemetry-native platform for a continuous feedback loop for testing, tracing, and fixing AI agents. By integrating Agno with OpenLIT, you can automatically instrument your agents to gain full visibility into LLM calls, tool usage, costs, performance metrics, and errors.

Prerequisites

  1. Install Dependencies Ensure you have the necessary packages installed:
  2. Deploy OpenLIT OpenLIT is open-source and self-hosted. Quick start with Docker:
    Access the dashboard at http://127.0.0.1:3000 with default credentials (username: user@openlit.io, password: openlituser). Other Deployment Options: For production deployments, Kubernetes with Helm, or other infrastructure setups, see the OpenLIT Installation Guide for detailed instructions on:
    • Kubernetes deployment with Helm charts
    • Custom Docker configurations
    • Reusing existing ClickHouse or OpenTelemetry Collector infrastructure
    • OpenLIT Operator for zero-code instrumentation in Kubernetes
  3. Set Environment Variables (Optional) Configure the OTLP endpoint based on your deployment:

Sending Traces to OpenLIT

Example: Basic Agent Setup

This example demonstrates how to instrument your Agno agent with OpenLIT for automatic tracing.

Example: Development Mode (Console Output)

For local development without a collector, OpenLIT can output traces directly to the console:

Example: Multi-Agent Team Tracing

OpenLIT automatically traces complex multi-agent workflows:

Example: Custom Tracer Configuration

For advanced use cases with custom OpenTelemetry configuration:

OpenLIT Dashboard Features

Once your agents are instrumented, you can access the OpenLIT dashboard to:
  • View Traces: Visualize complete execution flows including agent runs, tool calls, and LLM requests
  • Monitor Performance: Track latency, token usage, and throughput metrics
  • Analyze Costs: Monitor API costs across different models and providers
  • Track Errors: Identify and debug exceptions with detailed stack traces
  • Compare Models: Evaluate different LLM providers based on performance and cost

Configuration Options

The openlit.init() function accepts several parameters:

CLI-Based Instrumentation

For true zero-code instrumentation, you can use the openlit-instrument CLI command to run your application without modifying any code:
This approach is particularly useful for:
  • Adding observability to existing applications without code changes
  • CI/CD pipelines where you want to instrument automatically
  • Testing observability before committing to code modifications

Notes

  • Automatic Instrumentation: OpenLIT automatically instruments supported LLM providers (OpenAI, Anthropic, etc.) and frameworks
  • Zero Code Changes: Use either openlit.init() in your code or the openlit-instrument CLI to trace all LLM calls without modifications
  • OpenTelemetry Native: OpenLIT uses standard OpenTelemetry protocols, ensuring compatibility with other observability tools
  • Open-Source & Self-Hosted: OpenLIT is fully open-source and runs on your own infrastructure for complete data privacy and control

Integration with Other Platforms

OpenLIT can export traces to other observability platforms like Grafana Cloud, New Relic and more. See the Langfuse integration guide for an example of using OpenLIT with Langfuse.