opentelemetry-instrumentation-openai
OpenTelemetry OpenAI instrumentation
Decision gist · record as of 2026-08-14
Yes, if you use the OpenAI library and need observability. Installation is frictionless, maintenance is active, and the permissive license poses no constraints. The single-line instrumentation API is straightforward. Only skip if you have no observability backend configured or if you cannot tolerate the default logging of prompt/completion text (though that can be disabled).AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later; OpenAI library must be installed separately for instrumentation to be useful.
- Low friction: pure Python wheel with four lightweight OpenTelemetry dependencies.
- Actively maintained with a release 4 days old and 7377 repository stars.
License · maintenance · safety
Apache-2.0 (permissive) — Apache-2.0 permissive license allows commercial and private use with minimal restrictions.
last release 2026-08-10 (4 days) · last repo commit 2026-08-10 · 7,377 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 4,773,887 downloads/mo, #2,236 on PyPI
Alternatives
Verify before relying
pip install opentelemetry-instrumentation-openai
from opentelemetry.instrumentation.openai import OpenAIInstrumentor
OpenAIInstrumentor().instrument()- Whether the package works with all OpenAI library versions or has specific version constraints.
- How trace export backends are configured (whether this package handles that or requires separate setup).
- Performance overhead when tracing high-volume LLM applications.
What it is and what it does
This package automatically instruments the official OpenAI Python library to emit OpenTelemetry spans for every API call. It captures prompts, completions, and embeddings as span attributes, giving you visibility into what your LLM application is sending and receiving. The instrumentation is enabled by calling a single method after import.
By default, full prompt and completion text is logged to spans for debugging visibility. If you need to reduce trace size or protect sensitive user data, you can disable content logging via the TRACELOOP_TRACE_CONTENT environment variable. The package integrates with any OpenTelemetry-compatible observability backend (Jaeger, Datadog, etc.) to centralize and analyze these traces.
Use it for
- Debug LLM application behavior by inspecting what prompts were sent and what completions were returned.
- Monitor OpenAI API usage patterns and costs across your application.
- Trace latency and performance of individual OpenAI calls within distributed systems.
- Audit and log all AI interactions for compliance or quality review.
- Correlate OpenAI calls with other application spans for end-to-end request tracing.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you use the OpenAI library and need observability.
Installation is frictionless, maintenance is active, and the permissive license poses no constraints. The single-line instrumentation API is straightforward. Only skip if you have no observability backend configured or if you cannot tolerate the default logging of prompt/completion text (though that can be disabled).
Install
opentelemetry-instrumentation-openai on PyPI
Before you install
Low friction: pure Python wheel with four lightweight OpenTelemetry dependencies. Actively maintained with a release 4 days old and 7377 repository stars.
Requires Python 3.10 or later; OpenAI library must be installed separately for instrumentation to be useful.
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions.
Quickstart
pip install opentelemetry-instrumentation-openai
from opentelemetry.instrumentation.openai import OpenAIInstrumentor
OpenAIInstrumentor().instrument()
Verify before relying
- Whether the package works with all OpenAI library versions or has specific version constraints.
- How trace export backends are configured (whether this package handles that or requires separate setup).
- Performance overhead when tracing high-volume LLM applications.
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 packagesopentelemetry-apiopentelemetry-instrumentationopentelemetry-semantic-conventions-aiopentelemetry-semantic-conventions |
| Maintenance | Actively maintained 4 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 4,773,887 / month, #2,236 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
Evidence: opentelemetry_instrumentation_openai-0.62.3-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “openai api monitoring”
- opentelemetry-instrumentation-openaiCaptures traces of OpenAI API calls (prompts, completions,…
- openinference-instrumentation-openaiAuto-instruments OpenAI Python SDK calls to emit…
- opentelemetry-instrumentation-openai-v2Automatically traces and logs OpenAI API calls (and compatible…
Give your agent the search over MCP, or paste the wish link into any chat.
More Monitoring packages
Wraps any iterable to display a real-time progress bar in the terminal or Jupyter notebook, showing iteration count, elapsed time, and estimated time remaining.
Provides generated Python code for OpenTelemetry semantic conventions, enabling standardized attribute naming and constant definitions for instrumentation and telemetry collection.
Install it if you are using OpenTelemetry and want to follow semantic conventions correctly.
Provides the reference implementation of the OpenTelemetry API for collecting and exporting traces, metrics, and logs from Python applications.
Provides the abstract API and interfaces for OpenTelemetry instrumentation in Python, defining how to emit traces, metrics, and logs without tying code to a specific SDK implementation.
Exports OpenTelemetry observability data to an OpenTelemetry Collector using Protobuf-encoded messages over HTTP.
Install it if you are using OpenTelemetry in Python and need to send data to a Collector over HTTP.
Provides automatic instrumentation commands and programmatic APIs to inject distributed tracing into Python applications without code changes, detecting and instrumenting packages used by your program.
Install it if you need distributed tracing without code changes and have compatible instrumented packages in your environment.
See also literalai · opentelemetry-instrumentation-google-generativeai · opentelemetry-instrumentation-groq · opentelemetry-instrumentation-mistralai · opentelemetry-instrumentation-openai-v2 · opentelemetry-instrumentation-replicate · opentelemetry-instrumentation-together · opentelemetry-instrumentation-vertexai · opentelemetry-instrumentation-voyageai · traceloop-sdk