Skip to main content

Integrating Agno with Logfire

Logfire is Pydantic’s observability platform that provides comprehensive tracing and monitoring for AI applications. By integrating Agno with Logfire, you can utilize OpenInference to send traces and gain insights into your agent’s performance.

Prerequisites

  1. Install Dependencies Ensure you have the necessary packages installed:
  2. Setup Logfire Account
    • Sign up for an account at Logfire.
    • Obtain your write token from the Logfire dashboard.
  3. Set Environment Variables Configure your environment with the Logfire write token:

Sending Traces to Logfire

This example demonstrates how to instrument your Agno agent with OpenInference and send traces to Logfire.

Notes

  • Environment Variables: Ensure your environment variables are correctly set for the write token and OTLP endpoint.
  • Data Regions: Adjust the OTEL_EXPORTER_OTLP_ENDPOINT for your data region. Available regions include:
    • https://logfire-us.pydantic.dev for the US region
    • https://logfire-eu.pydantic.dev for the EU region
  • Logfire Dashboard: View your traces and monitor performance at Logfire Dashboard
By following these steps, you can effectively integrate Agno with Logfire, enabling comprehensive observability and monitoring of your AI agents.