{"id":338,"library":"opentelemetry-proto","title":"OpenTelemetry Python Proto","description":"OpenTelemetry is a set of APIs, libraries, agents, and instrumentation to provide observability for applications. Current version is 1.40.0, with releases following a regular cadence for improvements and bug fixes.","status":"active","version":"1.40.0","language":"python","source_language":"en","source_url":"https://github.com/open-telemetry/opentelemetry-python","tags":["observability","telemetry","logging","tracing"],"install":[{"cmd":"pip install opentelemetry-proto","lang":"bash","label":"Install OpenTelemetry Proto"}],"dependencies":[{"reason":"Provides necessary SDK components for usage.","package":"opentelemetry-sdk","optional":false}],"imports":[{"note":"Ensure you're importing from the correct submodule.","symbol":"NoOpTracer","correct":"from opentelemetry.proto.tracing import NoOpTracer"}],"quickstart":{"code":"from opentelemetry.proto.tracing import NoOpTracer\ntracer = NoOpTracer()\nspan = tracer.start_span('example')","lang":"python","description":"A simple example of using NoOpTracer to create a span."},"warnings":[{"fix":"Review the new behavior of NoOpTracer and update your span logic accordingly.","message":"start_span and start_as_current_span return behavior has changed.","severity":"breaking","affected_versions":">=1.40.0"},{"fix":"Switch to using opentelemetry-instrumentation-logging for logging.","message":"LoggingHandler in opentelemetry-sdk is deprecated; use opentelemetry-instrumentation-logging instead.","severity":"deprecated","affected_versions":">=1.40.0"},{"fix":"Avoid importing from `opentelemetry.proto`. If you were trying to access `NoOpTracer`, import it from `opentelemetry.trace` instead (e.g., `from opentelemetry.trace import NoOpTracer`).","message":"The module `opentelemetry.proto.tracing` is an internal module and not intended for direct import. It has been removed or is inaccessible through standard library imports.","severity":"breaking","affected_versions":">=1.40.0"},{"fix":"Update imports to use the correct location for `NoOpTracer` (e.g., `from opentelemetry.sdk.trace import NoOpTracer`) or remove references to the internal `proto` modules.","message":"`opentelemetry.proto.tracing` module has been removed or refactored. Direct imports from this path will now result in a `ModuleNotFoundError`.","severity":"breaking","affected_versions":">=1.40.0"}],"env_vars":null,"last_verified":"2026-05-12T13:09:55.015Z","next_check":"2026-06-26T00:00:00.000Z","problems":[{"fix":"Ensure that your `protobuf` installation is compatible with your OpenTelemetry packages. A common fix is to install a specific range, e.g., `pip install \"protobuf>=3.19,<5.0\"` or check the `opentelemetry-proto` package requirements via `pip show opentelemetry-proto | grep Requires` and install a compatible `protobuf` version.","cause":"These errors typically occur due to a version conflict between the `protobuf` library and the `opentelemetry-proto` package or other OpenTelemetry components that rely on specific `protobuf` versions.","error":"ImportError: cannot import name 'descriptor' from 'google.protobuf' OR TypeError: Descriptors cannot not be created directly"},{"fix":"Ensure all necessary OpenTelemetry packages are installed in the active virtual environment using `pip install opentelemetry-api opentelemetry-sdk opentelemetry-exporter-otlp opentelemetry-exporter-otlp-proto-grpc opentelemetry-proto`. It's also recommended to use `opentelemetry-bootstrap -a install` for auto-detection and installation of instrumentations.","cause":"This `ModuleNotFoundError` indicates that the required OpenTelemetry exporter package, or a specific module within it, is either not installed, installed in an incorrect Python environment, or there's a version mismatch among OpenTelemetry SDK components.","error":"ModuleNotFoundError: No module named 'opentelemetry.exporter.otlp.proto.grpc.metric_exporter'"},{"fix":"The most effective fix is to ensure all OpenTelemetry packages are at compatible versions. Use `pip list | grep opentelemetry` to check installed versions and consider pinning them to known compatible sets or performing a clean reinstall of all OpenTelemetry-related packages.","cause":"This `AttributeError` points to an incompatibility or version mismatch between different OpenTelemetry Python packages, where one package expects a class or function (like `SpanLimits`) that exists in a different version of another package.","error":"AttributeError: module 'opentelemetry.sdk.trace' has no attribute 'SpanLimits'"},{"fix":"This often resolves by reinstalling `opentelemetry-proto` or ensuring that no other packages are shadowing the expected `opentelemetry.proto` imports. Verify environment consistency and ensure `opentelemetry-proto` is correctly installed.","cause":"This error occurs when there's an issue with the Python-generated code from OpenTelemetry's Protocol Buffer definitions, usually due to conflicting installations of `opentelemetry-proto` or other packages that generate protobuf code, leading to an inability to correctly import components like `InstrumentationScope` from the expected module.","error":"ImportError: cannot import name 'InstrumentationScope' from 'opentelemetry.proto.common.v1.common_pb2'"}],"ecosystem":"pypi","meta_description":null,"install_score":0,"install_tag":"stale","quickstart_score":0,"quickstart_tag":"stale","pypi_latest":null,"cli_name":null,"install_checks":{"last_tested":"2026-05-12","tag":"stale","tag_description":"widespread failures or data too old to trust","results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null}]},"quickstart_checks":{"last_tested":"2026-04-23","tag":"stale","tag_description":"widespread failures or data too old to trust","results":[{"runtime":"python:3.10-alpine","exit_code":1},{"runtime":"python:3.10-slim","exit_code":1},{"runtime":"python:3.11-alpine","exit_code":1},{"runtime":"python:3.11-slim","exit_code":1},{"runtime":"python:3.12-alpine","exit_code":1},{"runtime":"python:3.12-slim","exit_code":1},{"runtime":"python:3.13-alpine","exit_code":1},{"runtime":"python:3.13-slim","exit_code":1},{"runtime":"python:3.9-alpine","exit_code":1},{"runtime":"python:3.9-slim","exit_code":1}]}}