{"id":363,"library":"opentelemetry-exporter-otlp-proto-grpc","title":"OpenTelemetry Collector Protobuf over gRPC Exporter","description":"This library provides an exporter for sending telemetry data to the OpenTelemetry Collector using Protobuf over gRPC. The current version is 1.40.0, and releases are made regularly with updates and fixes.","status":"active","version":"1.40.0","language":"python","source_language":"en","source_url":"https://github.com/open-telemetry/opentelemetry-python","tags":["opentelemetry","exporter","grpc","telemetry","tracing"],"install":[{"cmd":"pip install opentelemetry-exporter-otlp-proto-grpc","lang":"bash","label":"Install OpenTelemetry OTLP Exporter"}],"dependencies":[],"imports":[{"note":"This import was previously under a different path.","symbol":"OTLPExporter","correct":"from opentelemetry.exporter.otlp.proto.grpc import OTLPExporter"}],"quickstart":{"code":"import os\nfrom opentelemetry import trace\nfrom opentelemetry.exporter.otlp.proto.grpc import OTLPExporter\n\nexporter = OTLPExporter(endpoint=os.environ.get('OTLP_ENDPOINT', 'localhost:4317'))\n\ntracer = trace.get_tracer(__name__)\nwith tracer.start_as_current_span('example-span'):\n    print('This is a traced span')","lang":"python","description":"A simple example of using the OTLP exporter to start a span."},"warnings":[{"fix":"Ensure that the current span context is properly propagated.","message":"Invalid span will no longer be returned in NoOpTracer methods.","severity":"breaking","affected_versions":">=1.40.0"},{"fix":"Use opentelemetry-instrumentation-logging instead.","message":"LoggingHandler in opentelemetry-sdk is deprecated.","severity":"deprecated","affected_versions":"<1.40.0"},{"fix":"Use 'OTLPSpanExporter' for traces or 'OTLPMetricExporter' for metrics. The import path has also changed; for example, use 'from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter' for traces or 'from opentelemetry.exporter.otlp.proto.grpc.metric_exporter import OTLPMetricExporter' for metrics.","message":"The class 'OTLPExporter' has been removed or renamed within the 'opentelemetry.exporter.otlp.proto.grpc' module and is no longer directly importable.","severity":"breaking","affected_versions":"opentelemetry-exporter-otlp-proto-grpc>=1.16.0"},{"fix":"Update the import statement. For general OTLP/gRPC export, import `OTLPGRPCExporter` from `opentelemetry.exporter.otlp.proto.grpc.exporter`. For trace exporting, import `OTLPTraceExporter` from `opentelemetry.exporter.otlp.proto.grpc.trace_exporter`. For metric exporting, import `OTLPMetricExporter` from `opentelemetry.exporter.otlp.proto.grpc.metric_exporter`.","message":"The `OTLPExporter` class is no longer available directly under `opentelemetry.exporter.otlp.proto.grpc` due to package restructuring.","severity":"breaking","affected_versions":"opentelemetry-exporter-otlp>=1.17.0"}],"env_vars":null,"last_verified":"2026-05-12T13:18:09.890Z","next_check":"2026-06-27T00:00:00.000Z","problems":[{"fix":"Install the necessary exporter package: `pip install opentelemetry-exporter-otlp-proto-grpc`.","cause":"The `opentelemetry-exporter-otlp-proto-grpc` package is not installed in your Python environment or there's a problem with your Python path.","error":"ModuleNotFoundError: No module named 'opentelemetry.exporter.otlp.proto.grpc'"},{"fix":"Ensure the OpenTelemetry Collector is running and accessible from your application. Verify the OTLP endpoint configuration in your code matches the Collector's listening address and port (default gRPC port is 4317). If running in Docker or Kubernetes, configure the Collector to listen on '0.0.0.0' and ensure your application uses the correct service name or IP.","cause":"Your application cannot establish a gRPC connection to the OpenTelemetry Collector or the configured OTLP endpoint. This often happens because the Collector is not running, is listening on an incorrect address (e.g., 'localhost' instead of '0.0.0.0' in a containerized environment), or a firewall is blocking the connection.","error":"grpc._channel._MultiThreadedRendezvous: <_Rendezvous object at ...> debug_error_string = \"{\"created\":\"@1679934000.000000000\",\"description\":\"Error received from peer ipv4:127.0.0.1:4317\",\"file\":\"src/core/lib/surface/call.cc\",\"file_line\":901,\"grpc_message\":\"Connect Failed\",\"grpc_status\":14}\" or \"failed to export traces: connection refused\""},{"fix":"Downgrade your `protobuf` package to a version compatible with your `grpcio` and OpenTelemetry packages, or update `grpcio` and `opentelemetry-proto` to versions that support `protobuf` 4.x. A common fix is `pip install 'protobuf<4.0.0'` or `pip install --upgrade grpcio opentelemetry-proto` to ensure compatible versions. Sometimes `PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python` can also temporarily work, but it's slower.","cause":"This error is typically caused by a version conflict with the `protobuf` library. It occurs when a newer version of `protobuf` (e.g., 4.x) is installed, but an OpenTelemetry dependency (like `grpcio` or `opentelemetry-proto`) expects an older `protobuf` version (e.g., 3.x) and has out-of-date generated `.proto` files.","error":"TypeError: Descriptors cannot not be created directly. If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0."},{"fix":"Ensure all OpenTelemetry packages are installed at compatible versions. It's often best to upgrade all OpenTelemetry-related packages to their latest stable versions simultaneously: `pip install --upgrade opentelemetry-api opentelemetry-sdk opentelemetry-exporter-otlp-proto-grpc grpcio` or perform a clean reinstall.","cause":"This indicates an incompatibility or version mismatch among different OpenTelemetry Python packages (e.g., `opentelemetry-api`, `opentelemetry-sdk`, and the exporter). Components might be expecting classes or attributes that exist in different versions of other packages.","error":"AttributeError: module 'opentelemetry.sdk.trace' has no attribute 'SpanLimits'"}],"ecosystem":"pypi","meta_description":null,"install_score":0,"install_tag":"stale","quickstart_score":0,"quickstart_tag":"stale","pypi_latest":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}]}}