opentelemetry-instrumentation-litellm
OpenTelemetry LiteLLM instrumentation
What it is and what it does
This package wraps LiteLLM to emit OpenTelemetry spans and metrics for every LLM call. Because LiteLLM normalizes responses from all providers into a single OpenAI-style format, the instrumentation produces consistent gen_ai.* spans regardless of whether you're calling different providers or custom LLM implementations. By default it logs prompts, completions, and embeddings to span attributes for visibility and debugging; you can disable this via the TRACELOOP_TRACE_CONTENT environment variable if the data is sensitive.
The package depends on opentelemetry-api, opentelemetry-instrumentation, opentelemetry-semantic-conventions-ai, and opentelemetry-semantic-conventions, and requires Python 3.10 or later. It integrates directly into your LiteLLM calls with a single .instrument() call, making it straightforward to add observability to existing LLM applications without rewriting call sites.
Use it for:
- Debug LLM application behavior by viewing exact prompts and completions in traces alongside latency and error data.
- Monitor token usage and cost across multiple LLM providers in a unified observability platform.
- Audit LLM interactions for compliance or quality review by exporting traces to a central collector.
- Correlate LLM calls with upstream application requests using OpenTelemetry's trace context propagation.
- Measure and optimize LLM performance across different providers or models using consistent metrics.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Adds OpenTelemetry tracing to LiteLLM, capturing LLM prompts, completions, and embeddings as spans and metrics across all LLM providers that LiteLLM supports.
Yes. The package is actively maintained, has no known vulnerabilities, low install friction, and solves a real problem: getting consistent observability across LiteLLM's multi-provider abstraction. The privacy control via environment variable is a thoughtful addition. Install it if you're using LiteLLM and need tracing; skip it only if you have no observability requirements.
Install
opentelemetry-instrumentation-litellm on PyPI
pip
pip install opentelemetry-instrumentation-litellmuv
uv add opentelemetry-instrumentation-litellmpoetry
poetry add opentelemetry-instrumentation-litellmInstalling opentelemetry-instrumentation-litellm
Before you install
Low friction: pure Python wheel, four lightweight OpenTelemetry dependencies, active maintenance with a release 4 days ago and no known vulnerabilities.
License in practice
Apache-2.0 is permissive; you can use, modify, and distribute this package freely in commercial or proprietary projects with minimal restrictions.
Quickstart
pip install opentelemetry-instrumentation-litellm
from opentelemetry.instrumentation.litellm import LiteLLMInstrumentor
LiteLLMInstrumentor().instrument()
Requires Python 3.10 or later.
Verify before relying
- Whether the instrumentation works with all LiteLLM custom providers or only a subset
- Performance overhead of tracing on high-volume LLM applications
- Compatibility with specific OpenTelemetry exporters and collectors
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (<4,>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — opentelemetry-api, opentelemetry-instrumentation, opentelemetry-semantic-conventions-ai, opentelemetry-semantic-conventions |
| Maintenance | actively maintained — 4 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 748,066/month — #5,166 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: opentelemetry_instrumentation_litellm-0.62.3-py3-none-any.whl
Tags
More Monitoring packages
Wraps any iterable to display a real-time…
copyleft · top 100 on PyPI
opentelemetry-semantic-conventionsProvides generated Python code for…
permissive · top 100 on PyPI
opentelemetry-sdkProvides the reference implementation of the…
permissive · top 100 on PyPI
opentelemetry-apiProvides the abstract API and interfaces for…
permissive · top 100 on PyPI
opentelemetry-exporter-otlp-proto-httpExports OpenTelemetry observability data to an…
permissive · top 1,000 on PyPI
opentelemetry-instrumentationProvides automatic instrumentation commands and…
permissive · top 1,000 on PyPI
opentelemetry-instrumentation-langchainAdds distributed tracing to Langchain LLM…
permissive · top 5,000 on PyPI
opentelemetry-instrumentation-llamaindexAdds distributed tracing to LlamaIndex…
permissive · top 5,000 on PyPI
opentelemetry-instrumentation-openaiCaptures traces of OpenAI API calls (prompts,…
permissive · top 5,000 on PyPI
opentelemetry-instrumentation-groqAutomatically captures traces of Groq SDK API…
permissive · top 5,000 on PyPI
promptlayerPromptLayer is a Python SDK for managing,…
permissive · top 15,000 on PyPI
openlitOpenLIT provides OpenTelemetry-native…
permissive · top 15,000 on PyPI
opentelemetry-instrumentation-ollamaAdds distributed tracing to Ollama Python…
permissive · top 5,000 on PyPI
opentelemetry-instrumentation-replicateAdds OpenTelemetry tracing to Replicate API…
permissive · top 5,000 on PyPI
opentelemetry-semantic-conventions-aiProvides OpenTelemetry semantic conventions and…
permissive · top 1,000 on PyPI
opentelemetry-instrumentation-transformersAdds distributed tracing to HuggingFace…
permissive · top 5,000 on PyPI