OpenTelemetry Exporter OTLP Proto Common

raw JSON →
1.40.0 verified Tue May 12 auth: no python install: stale quickstart: stale

This library provides Protobuf encoding for OpenTelemetry. The current version is 1.40.0, released regularly as part of the OpenTelemetry project. It is utilized to integrate with various tracing and monitoring systems.

pip install opentelemetry-exporter-otlp-proto-common
error ModuleNotFoundError: No module named 'opentelemetry.proto'
cause The 'opentelemetry-proto' package, which provides the necessary Protobuf definitions for OTLP data serialization, is not installed.
fix
pip install opentelemetry-proto
error ImportError: cannot import name 'OtlpSpanExporter' from 'opentelemetry.exporter.otlp.proto.common'
cause The `OtlpSpanExporter` class is provided by transport-specific OTLP exporter packages (e.g., `opentelemetry-exporter-otlp-grpc` or `opentelemetry-exporter-otlp-http`), not directly by `opentelemetry-exporter-otlp-proto-common` which only handles the Protobuf encoding logic.
fix
from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OtlpSpanExporter # Or .http.trace_exporter for HTTP
error ModuleNotFoundError: No module named 'opentelemetry.sdk.trace'
cause The core OpenTelemetry SDK package, which contains the necessary components for setting up tracing, metrics, and logging, is not installed.
fix
pip install opentelemetry-sdk
breaking Changes in `start_span` and `start_as_current_span` in NoOpTracer.
fix Update implementations to rely on the new behavior of propagating span context.
deprecated `LoggingHandler` is deprecated in favor of `opentelemetry-instrumentation-logging`.
fix Switch to using `opentelemetry-instrumentation-logging` for logging purposes.
python os / libc status wheel install import disk
3.10 alpine (musl) - - - -
3.10 slim (glibc) - - - -
3.11 alpine (musl) - - - -
3.11 slim (glibc) - - - -
3.12 alpine (musl) - - - -
3.12 slim (glibc) - - - -
3.13 alpine (musl) - - - -
3.13 slim (glibc) - - - -
3.9 alpine (musl) - - - -
3.9 slim (glibc) - - - -

This code initializes a NoOpTracer and starts a span.

import os
from opentelemetry.exporter.otlp.proto.common import NoOpTracer

tracer = NoOpTracer()

with tracer.start_as_current_span('example_span'):
    print('Hello, OpenTelemetry!')