Skip to main content
You can trace Agno agent and tool calls in Weave using OpenTelemetry (OTEL). Agno is a Python framework for building multi-agent systems with shared memory, knowledge, and reasoning. It’s designed to be lightweight and model-independent, and supports multi-modal capabilities including text, image, audio, and video processing. This guide explains how to trace Agno agent and tool calls using OTEL, and visualize those traces in Weave. You’ll learn how to install the required dependencies, configure an OTEL tracer to send data to Weave, and instrument your Agno agents and tools.
For more information on OTEL tracing in Weave, see Send OTEL Traces to Weave.

Prerequisites

  1. Install the required dependencies:
  2. Set your OpenAI API key (or other model provider) as an environment variable:
  3. Configure OTEL tracing in Weave.

Configure OTEL tracing in Weave

To send traces from Agno to Weave, configure OTEL with a TracerProvider and an OTLPSpanExporter. Set the exporter to the correct endpoint and HTTP headers for authentication and project identification.
Store sensitive environment variables like your API key and project info in an environment file (for example, .env), and load them using os.environ. This keeps your credentials secure and out of your codebase.

Required configuration

Configure the OTLP exporter with the following endpoint and headers:
  • Endpoint: https://trace.wandb.ai/otel/v1/traces
  • Headers:
    • Authorization: Basic auth using your W&B API key.
    • project_id: Your W&B entity/project name (for example, myteam/myproject).

Send OTEL traces from Agno to Weave

After you complete the prerequisites, you can send OTEL traces from Agno to Weave. The following code snippet demonstrates how to configure an OTLP span exporter and tracer provider to send OTEL traces from an Agno application to Weave.
To ensure that Weave traces Agno properly, set the global tracer provider before using Agno components in your code.

Trace Agno agents with OTEL

After you set up the tracer provider, you can create and run Agno agents with automatic tracing. Instrument Agno before you create agents to ensure that Weave captures all subsequent agent activity. The following example demonstrates how to create an agent with tools:
Weave automatically traces all agent operations, so you can visualize the execution flow, model calls, reasoning steps, and tool invocations.
A trace visualization of an Agno agent

Trace Agno tools with OTEL

When you define and use tools with Agno, the trace also captures these tool calls. The OTEL integration automatically instruments both the agent’s reasoning process and the individual tool executions, which provides a comprehensive view of your agent’s behavior. Here’s an example with multiple tools:
A trace visualization of Agno tool calls

Trace multi-agent teams with OTEL

Agno’s multi-agent architecture lets you create teams of agents that collaborate and share context. Weave also traces these team interactions in full:
This multi-agent trace shows the coordination between different agents in Weave, which provides visibility into how tasks are distributed and executed across your agent team.
A trace visualization of Agno multi-agent team

Work with reasoning agents

Agno provides built-in reasoning capabilities that help agents process problems step-by-step. Traces also capture these reasoning processes:
The trace displays the reasoning steps that show how the agent breaks down complex problems and makes decisions.
A trace visualization of Agno reasoning agent

Work with memory and knowledge

Agno agents can maintain memory and access knowledge bases, which lets agents persist context across interactions. Weave also traces these operations:
A trace visualization of Agno memory usage
Memory operations, including storing and retrieving conversation history, appear in the trace.

Learn more