opentelemetry-instrumentation-llamaindex
OpenTelemetry LlamaIndex instrumentation
What it is and what it does
This package integrates OpenTelemetry tracing into LlamaIndex applications, automatically capturing spans for LLM calls, embeddings, and other operations. It hooks into LlamaIndex to record detailed traces that flow through your observability stack, making it possible to see exactly what your application is doing at each step.
By default, the instrumentation logs prompts, completions, and embeddings as span attributes, giving you full visibility into your LLM application's behavior. This can be disabled by setting the TRACELOOP_TRACE_CONTENT environment variable to false if you need to protect sensitive user data or reduce trace size. The package requires Python 3.10 or later and depends on the core OpenTelemetry API and instrumentation libraries.
Use it for:
- Debug LlamaIndex application behavior by tracing LLM calls and embeddings through your system.
- Send traces to an OpenTelemetry backend (Jaeger, Datadog, etc.) to monitor production LLM applications.
- Analyze latency and performance of LLM operations within a larger application.
- Audit and log prompts and completions for compliance or quality evaluation purposes.
- Correlate LLM calls with other application traces for end-to-end observability.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Adds distributed tracing to LlamaIndex applications using OpenTelemetry, capturing LLM calls, embeddings, and application flow as spans for observability and debugging.
Yes, if you are building LlamaIndex applications and need observability. The package is actively maintained, has no security vulnerabilities, installs with low friction, and integrates cleanly with the OpenTelemetry ecosystem. Be aware that prompts and completions are logged by default—disable TRACELOOP_TRACE_CONTENT if handling sensitive data.
Install
opentelemetry-instrumentation-llamaindex on PyPI
pip
pip install opentelemetry-instrumentation-llamaindexuv
uv add opentelemetry-instrumentation-llamaindexpoetry
poetry add opentelemetry-instrumentation-llamaindexInstalling opentelemetry-instrumentation-llamaindex
Before you install
Low friction installation with no compiled dependencies. Actively maintained with a recent release (4 days old) and steady upstream activity. Depends on standard OpenTelemetry packages.
License in practice
Licensed under Apache-2.0 (permissive), allowing use in commercial and proprietary projects with minimal restrictions.
Quickstart
pip install opentelemetry-instrumentation-llamaindex
from opentelemetry.instrumentation.llamaindex import LlamaIndexInstrumentor
LlamaIndexInstrumentor().instrument()
Requires Python 3.10 or later. Requires an OpenTelemetry exporter and backend to be configured separately to actually send traces somewhere.
Verify before relying
- Whether the instrumentation supports all LlamaIndex components or only a subset of the API surface.
- Performance overhead of tracing when TRACELOOP_TRACE_CONTENT is enabled versus disabled.
- Compatibility with specific OpenTelemetry exporters and backends.
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 | 5 — inflection, 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 | 6,928,352/month — #1,808 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: opentelemetry_instrumentation_llamaindex-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
llama-index-instrumentationProvides instrumentation hooks for…
permissive · top 5,000 on PyPI
opentelemetry-instrumentation-ollamaAdds distributed tracing to Ollama Python…
permissive · top 5,000 on PyPI
raindrop-aiInstrument LLM applications with event tracking…
permissive · top 15,000 on PyPI
openlitOpenLIT provides OpenTelemetry-native…
permissive · top 15,000 on PyPI
opentelemetry-instrumentation-langchainAdds distributed tracing to Langchain LLM…
permissive · top 5,000 on PyPI
opentelemetry-instrumentation-haystackAdds distributed tracing to Haystack LLM…
permissive · top 5,000 on PyPI
opentelemetry-instrumentation-litellmAdds OpenTelemetry tracing to LiteLLM,…
permissive · top 15,000 on PyPI
opentelemetry-instrumentation-transformersAdds distributed tracing to HuggingFace…
permissive · top 5,000 on PyPI
lumigo-tracerLumigo-tracer instruments Python Lambda…
permissive · top 15,000 on PyPI
traceloop-sdkTraceloop SDK instruments LLM applications to…
permissive · top 5,000 on PyPI