Open-source observability for your GenAI or LLM application, based on OpenTelemetry
Open-source observability for your GenAI or LLM application, based on OpenTelemetry
Open-source observability for your LLM application
** New**: Our semantic conventions are now part of OpenTelemetry! Join the discussion and help us shape the future of LLM observability.
Looking for the JS/TS version? Check out OpenLLMetry-JS.
OpenLLMetry is a set of extensions built on top of OpenTelemetry that gives you complete observability over your LLM application. Because it uses OpenTelemetry under the hood, it can be connected to your existing observability solutions - Datadog, Honeycomb, and others.
It's built and maintained by Traceloop under the Apache 2.0 license.
The repo contains standard OpenTelemetry instrumentations for LLM providers and Vector DBs, as well as a Traceloop SDK that makes it easy to get started with OpenLLMetry, while still outputting standard OpenTelemetry data that can be connected to your observability stack. If you already have OpenTelemetry instrumented, you can just add any of our instrumentations directly.
The easiest way to get started is to use our SDK. For a complete guide, go to our docs.
Install the SDK:
pip install traceloop-sdkThen, to start instrumenting your code, just add this line to your code:
from traceloop.sdk import Traceloop
Traceloop.init()That's it. You're now tracing your code with OpenLLMetry! If you're running this locally, you may want to disable batch sending, so you can see the traces immediately:
Traceloop.init(disable_batch=True)See our docs for instructions on connecting to each one.
OpenLLMetry can instrument everything that OpenTelemetry already instruments - so things like your DB, API calls, and more. On top of that, we built a set of custom extensions that instrument things like your calls to OpenAI or Anthropic, or your Vector DB like Chroma, Pinecone, Qdrant or Weaviate.
We no longer log or collect any telemetry in the SDK or in the instrumentations. Make sure to bump to v0.49.2 and above.
Whether big or small, we love contributions ❤️ Check out our guide to see how to get started.
Not sure where to get started? You can:
To @patrickdebois, who suggested the great name we're now using for this repo!
Bug Report: Anthropic instrumentation: streaming spans are never ended on early exit (with-block, messages.stream() helper, close)
Bug Report: penAI instrumentation consumes generator/iterator `messages` and `tools`, so the model receives an empty conversation (default settings)
Bug Report:OpenAI instrumentation does not record gen_ai.request.seed, gen_ai.request.stop_sequences or gen_ai.output.type
Bug Report: OpenAI instrumentation: ChatStream does not end the span on close() (sync or async)
[RFC] Semantic Conventions for AI Agent Observability
Bug Report: traceloop-sdk imports requests and httpx without declaring them
Bug Report: opentelemetry-semantic-conventions-ai 0.5.2 missing from pypi
fix(openai): @dont_throw is a no-op on Responses API wrappers, so tracing bugs crash host apps
Bug Report: mistralai event mode loses prompt events when a ToolMessage is present
Feature: Suggestion: Add beginner-friendly example for LLM tracing