This example demonstrates how to instrument your Agno agent and send traces to LangWatch
Copy
Ask AI
import langwatchimport osfrom agno.agent import Agentfrom agno.models.openai import OpenAIChatfrom agno.tools.yfinance import YFinanceToolsfrom openinference.instrumentation.agno import AgnoInstrumentor# Initialize LangWatch and instrument Agnolangwatch.setup( instrumentors=[AgnoInstrumentor()])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,)agent.print_response("What is the current price of Tesla?")
No OpenTelemetry Setup Needed: You do not need to set any OpenTelemetry environment variables or configure exporters manually—langwatch.setup() handles everything.
Troubleshooting: If you see no traces in LangWatch, ensure your LANGWATCH_API_KEY is set and that the instrumentor is included in langwatch.setup().