--- id: opentelemetry-instrumentation-litellm version: "0.62.3" license: Apache-2.0 license_treatment: permissive maintenance: active --- # opentelemetry-instrumentation-litellm — OpenTelemetry LiteLLM instrumentation License: permissive · Maintenance: active · Downloads: 748.1K/mo ## 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 above — 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 pip install opentelemetry-instrumentation-litellm uv add opentelemetry-instrumentation-litellm poetry add opentelemetry-instrumentation-litellm ## Installing 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_current - Install friction: low - Maintenance: active - Downloads: 748.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags opentelemetry litellm tracing, llm instrumentation monitoring, trace llm prompts completions, opentelemetry ai instrumentation, litellm observability spans, gen_ai tracing opentelemetry, llm provider tracing, observability, llm-instrumentation, opentelemetry [View on SkillFed](https://skillfed.io/packages/opentelemetry-instrumentation-litellm) · [View on PyPI](https://pypi.org/project/opentelemetry-instrumentation-litellm/)