Skip to main content

Setup Tracing

The Agenta Observability SDK integrates with the OpenTelemetry SDK. It wraps OpenTelemetry and provides a user-friendly way to instrument your LLM applications.

The SDK provides:

The SDK works with auto instrumentation. You should use auto instrumentation together with this SDK.

Installation

1. Install the Agenta SDK

pip install -U agenta

Configuration

2. Set environment variables

  1. Visit the Agenta API Keys page.
  2. Click on Create New API Key and follow the prompts.
import os

os.environ["AGENTA_API_KEY"] = "YOUR_AGENTA_API_KEY"
os.environ["AGENTA_HOST"] = "https://cloud.agenta.ai"

3. Initialize the SDK

import agenta as ag

ag.init()

That's it! You're now ready to instrument your functions and start capturing traces.

Next steps