LangWatch supports seamless observability for Agno agents. You can instrument your Agno-based applications and send traces directly to LangWatch for monitoring and analysis.

This guide shows how to set up tracing for Agno agents using the LangWatch Python SDK. Unlike the default OpenTelemetry/OTLP setup, you only need to call langwatch.setup()—no manual exporter or environment variable configuration is required.

Prerequisites

  • Install the required packages:
    pip install agno openai langwatch openinference-instrumentation-agno
  • Get your LangWatch API key from your project settings and set it as an environment variable:
    export LANGWATCH_API_KEY=your-langwatch-api-key

Instrumenting Agno with LangWatch

You can use the OpenInference Agno instrumentor to automatically capture traces from your Agno agents. Just pass the instrumentor to langwatch.setup().

import langwatch
import os

from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.tools.yfinance import YFinanceTools
from openinference.instrumentation.agno import AgnoInstrumentor

# Initialize LangWatch and instrument Agno
langwatch.setup(
    instrumentors=[AgnoInstrumentor()]
)

# Create and configure your Agno agent
agent = Agent(
    name="Stock Price Agent",
    model=OpenAIChat(id="gpt-4o-mini"),
    tools=[YFinanceTools()],
    instructions="You are a stock price agent. Answer questions in the style of a stock analyst.",
    debug_mode=True,
)

# Use the agent as usual—traces will be sent to LangWatch
agent.print_response("What is the current price of Tesla?")

That’s it! All Agno agent activity will now be traced and sent to your LangWatch dashboard.

Notes

  • You do not need to set any OpenTelemetry environment variables or configure exporters manually—langwatch.setup() handles everything.
  • You can combine Agno instrumentation with other instrumentors (e.g., OpenAI, LangChain) by adding them to the instrumentors list.
  • For advanced configuration (custom attributes, endpoint, etc.), see the Python integration guide.

Troubleshooting

  • Make sure your LANGWATCH_API_KEY is set in the environment.
  • If you see no traces in LangWatch, check that the instrumentor is included in langwatch.setup() and that your agent code is being executed.

For more details, see the LangWatch Python SDK reference and the Agno documentation.