$npx skillfedfor your agent

opentelemetry-instrumentation-openai-v2

OpenTelemetry Official OpenAI instrumentation

With conditionsPyPI MonitoringReleased May 20261.9M downloads / moApache-2.0Pure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — opentelemetry_instrumentation_openai_v2-2.4b0-py3-none-any.whl
v2.4b0 · released 2026-05-01 · Python >=3.10 · 4 runtime deps: opentelemetry-api, opentelemetry-instrumentation, opentelemetry-semantic-conventions, opentelemetry-util-genai

Yes, if you already have OpenTelemetry configured in your application and need visibility into OpenAI or compatible LLM API calls. The low install friction, active maintenance, permissive license, and zero known vulnerabilities make it safe to adopt. Not necessary if you have no OpenTelemetry setup or do not use the OpenAI SDK.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires OpenTelemetry tracing, logging, and events to be configured before instrumentation will emit telemetry.
  • Requires Python 3.10 or later.
  • Low friction installation with four stable OpenTelemetry dependencies already in the ecosystem.

License · maintenance · safety

Apache-2.0 (permissive) — Apache-2.0 permissive license allows use in most commercial and open-source projects without significant restrictions.

last release 2026-05-01 (105 days) · last repo commit 2026-08-14 · 1,086 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,897,611 downloads/mo, #3,447 on PyPI

Verify before relying

pip install opentelemetry-instrumentation-openai-v2

from opentelemetry.instrumentation.openai_v2 import OpenAIInstrumentor
from openai import OpenAI

OpenAIInstrumentor().instrument()
client = OpenAI()
response = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "Hello"}]
)
  • Whether the package works with all listed OpenAI-compatible platforms (Azure OpenAI, Gemini, Perplexity, xAI, DeepSeek, Groq, MistralAI) equally well or if some have limitations.
  • Performance overhead of instrumentation on high-volume LLM applications.
  • Whether the optional upload hook for prompts/completions (requiring fsspec) is production-ready.
Same gist for agents: .md · .json

What it is and what it does

This package integrates OpenTelemetry tracing into applications using the OpenAI Python SDK or compatible LLM platforms. When installed and initialized, it automatically captures spans for chat completions, embeddings, and other API operations, recording metrics like token usage and operation duration. It works with OpenAI-compatible services including Azure OpenAI, Gemini, Perplexity, xAI, DeepSeek, Groq, and MistralAI when accessed through the OpenAI SDK.

The instrumentation is configured via environment variables to control what telemetry is captured—by default it traces operations without capturing message content, but you can enable content logging as events or span attributes. It requires an existing OpenTelemetry setup (tracing, logging, and events configured) to emit the captured telemetry. The package is in Beta status and aligns with OpenTelemetry Semantic Conventions v1.30.0, with experimental features available through opt-in environment variables.

Use it for

  • Monitor and debug OpenAI API calls in production applications by viewing traces of chat completions and embeddings.
  • Track token consumption across LLM operations for cost analysis and quota management.
  • Correlate LLM requests with other application traces in a centralized observability platform.
  • Audit and log prompt and completion content when compliance or debugging requires it.
  • Observe applications using OpenAI-compatible services (Groq, Gemini, etc.) with a single instrumentation.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you already have OpenTelemetry configured in your application and need visibility into OpenAI or compatible LLM API calls.

The low install friction, active maintenance, permissive license, and zero known vulnerabilities make it safe to adopt. Not necessary if you have no OpenTelemetry setup or do not use the OpenAI SDK.

Install

opentelemetry-instrumentation-openai-v2 on PyPI

Before you install

Low friction installation with four stable OpenTelemetry dependencies already in the ecosystem. Active maintenance (last commit 2026-08-14) and no known vulnerabilities. Requires Python 3.10 or later.

Requires OpenTelemetry tracing, logging, and events to be configured before instrumentation will emit telemetry. Requires Python 3.10 or later.

License in practice

Apache-2.0 permissive license allows use in most commercial and open-source projects without significant restrictions.

Quickstart

pip install opentelemetry-instrumentation-openai-v2

from opentelemetry.instrumentation.openai_v2 import OpenAIInstrumentor
from openai import OpenAI

OpenAIInstrumentor().instrument()
client = OpenAI()
response = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "Hello"}]
)

Verify before relying

  • Whether the package works with all listed OpenAI-compatible platforms (Azure OpenAI, Gemini, Perplexity, xAI, DeepSeek, Groq, MistralAI) equally well or if some have limitations.
  • Performance overhead of instrumentation on high-volume LLM applications.
  • Whether the optional upload hook for prompts/completions (requiring fsspec) is production-ready.

Package facts

LicenseApache-2.0 permissive
Python supportSupports the current Python release >=3.10
Install frictionLow. Pure-Python wheel
Runtime dependencies
4 packages
opentelemetry-apiopentelemetry-instrumentationopentelemetry-semantic-conventionsopentelemetry-util-genai
MaintenanceActively maintained 105 days since the last release
Last repo commit
First released
Downloads1,897,611 / month, #3,447 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Evidence: opentelemetry_instrumentation_openai_v2-2.4b0-py3-none-any.whl

Tags

Capabilities
openai api tracingllm instrumentation opentelemetryopenai request monitoringgenai observabilityopentelemetry llm loggingapi call tracingtoken usage metrics
Topics
observabilityllm-monitoringinstrumentation

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 request monitoring”

Give your agent the search over MCP, or paste the wish link into any chat.

More Monitoring packages

tqdm Worth it
PyPI · Libraries · released Jul 2026

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.

copyleftpure Python · 3.8+
648.6Mdownloads / mo
opentelemetry-semantic-conventions Worth it
PyPI · Monitoring · released Jul 2026

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.

Apache-2.0pure Python · 3.10+
542.9Mdownloads / mo
opentelemetry-sdk Worth it
PyPI · Monitoring · released Jul 2026

Provides the reference implementation of the OpenTelemetry API for collecting and exporting traces, metrics, and logs from Python applications.

Apache-2.0pure Python · 3.10+
521.8Mdownloads / mo
opentelemetry-api With conditions
PyPI · Monitoring · released Jul 2026

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.

Apache-2.0pure Python · 3.10+
463.8Mdownloads / mo
opentelemetry-exporter-otlp-proto-http Worth it
PyPI · Monitoring · released Jul 2026

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.

Apache-2.0pure Python · 3.10+
409.9Mdownloads / mo
opentelemetry-instrumentation Worth it
PyPI · Monitoring · released Jul 2026

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.

Apache-2.0pure Python · 3.10+
393.5Mdownloads / mo

See also opentelemetry-instrumentation-google-genai · opentelemetry-instrumentation-openai · opentelemetry-instrumentation-openai-agents-v2 · langwatch · loongsuite-util-genai · opentelemetry-util-genai · opentelemetry-semantic-conventions-ai · opentelemetry-instrumentation-groq · opentelemetry-instrumentation-google-generativeai · openinference-instrumentation-portkey