Registry /
observability / opentelemetry-instrumentation-mcp
Install & Compatibility
Where this runs
tested against v? · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
init
✓ from openllmetry.sdk import init
The `opentelemetry-instrumentation-mcp` package is a meta-package that installs numerous individual AI/LLM instrumentations. The `init` function from `openllmetry.sdk` is used to enable all installed OpenLLMetry instrumentations.
This quickstart demonstrates how to initialize OpenLLMetry using `openllmetry.sdk.init()` after installing the `opentelemetry-instrumentation-mcp` meta-package. It then makes a sample call to OpenAI, which will be automatically traced. Ensure your `OPENAI_API_KEY` is set as an environment variable and an OpenTelemetry collector is configured (e.g., via `OTEL_EXPORTER_OTLP_ENDPOINT`).
import os
from openllmetry.sdk import init
from openai import OpenAI
# Initialize OpenLLMetry to enable instrumentation
init()
# Ensure OPENAI_API_KEY is set in your environment
openai_api_key = os.environ.get('OPENAI_API_KEY', '')
if not openai_api_key:
print("Warning: OPENAI_API_KEY not set. Skipping OpenAI call.")
else:
print("OpenAI API Key found. Making a sample call...")
client = OpenAI(api_key=openai_api_key)
try:
completion = client.chat.completions.create(
model="gpt-3.5-turbo",
messages=[
{"role": "user", "content": "What is OpenTelemetry?"}
]
)
print(f"OpenAI response: {completion.choices[0].message.content[:50]}...")
print("Traces for this call should be visible in your configured OpenTelemetry collector.")
except Exception as e:
print(f"Error during OpenAI call: {e}")
Debug
Known issues
breakingFrequent updates to OpenTelemetry GenAI Semantic Conventions may lead to changes in span and attribute names. This is common in a rapidly evolving ecosystem.fixRegularly update `opentelemetry-instrumentation-mcp` and `openllmetry-sdk` to the latest versions. Adjust any downstream monitoring queries or dashboards to reflect new semantic convention attribute names as they evolve.
affects: All versions before 0.58.0 (e.g., v0.55.0, v0.58.0 specifically mention GenAI semconv updates). Users should refer to release notes for exact attribute changes.
gotchaThis package (`opentelemetry-instrumentation-mcp`) is a meta-package, meaning installing it brings in a large number of individual `opentelemetry-instrumentation-*` packages. This can lead to a large dependency tree and potential version conflicts with other libraries in your project.fixIf you only need instrumentation for a specific LLM or AI framework (e.g., OpenAI), consider installing only `opentelemetry-instrumentation-openai` (and `openllmetry-sdk`) instead of the `mcp` meta-package to keep your dependency footprint smaller.
affects: All versions.
breakingInstrumentation for Pinecone switched from the deprecated `pinecone-client` to the `pinecone` package.fixEnsure your project uses the `pinecone` package (version >=3.0.0 typically) instead of `pinecone-client` if you intend for Pinecone calls to be instrumented. Update your `requirements.txt` accordingly.
affects: Prior to 0.53.0. Versions from 0.53.0 onwards use the new `pinecone` package.
Upgrade
Version history
0.62.3latest on PyPI · released Aug 10, 2026
Audit
Dependencies
openllmetry-sdkrequiredRequired to initialize and enable the instrumentations provided by this meta-package.
opentelemetry-apioptionalCore OpenTelemetry API, often a transitive dependency of openllmetry-sdk.
opentelemetry-sdkoptionalCore OpenTelemetry SDK, often a transitive dependency of openllmetry-sdk.
openaioptionalAn example of a library that this package instruments. Many other LLM/AI framework clients are implicitly instrumented upon installation.