{"id":365,"library":"opentelemetry-exporter-otlp","title":"OpenTelemetry Collector Exporters","description":"The opentelemetry-exporter-otlp library provides OpenTelemetry Collector exporters, allowing users to send telemetry data to OpenTelemetry-supported backend systems. Current version: 1.40.0, released with a cadence of regular updates enhancing functionality and fixing issues.","status":"active","version":"1.40.0","language":"python","source_language":"en","source_url":"https://github.com/open-telemetry/opentelemetry-python","tags":["opentelemetry","telemetry","exporter"],"install":[{"cmd":"pip install opentelemetry-exporter-otlp","lang":"bash","label":"Install opentelemetry-exporter-otlp"}],"dependencies":[{"reason":"Required for exporting telemetry data","package":"opentelemetry-api","optional":false},{"reason":"For HTTP communication when exporting data","package":"requests","optional":true},{"reason":"For gRPC communication when exporting data","package":"grpcio","optional":true}],"imports":[{"note":"Ensure the module structure is correctly followed.","symbol":"OTLPSpanExporter","correct":"from opentelemetry.exporter.otlp.trace_exporter import OTLPSpanExporter"}],"quickstart":{"code":"import os\nfrom opentelemetry import trace\nfrom opentelemetry.exporter.otlp.trace_exporter import OTLPSpanExporter\nfrom opentelemetry.sdk.resources import Resource\nfrom opentelemetry.sdk.trace import TracerProvider\nfrom opentelemetry.trace import set_tracer_provider\n\n# Set up the OTLP exporter\nexporter = OTLPSpanExporter(endpoint=os.environ.get('OTEL_EXPORTER_OTLP_ENDPOINT', 'localhost:4317'))\n\nset_tracer_provider(TracerProvider(resource=Resource.create({'service.name': 'example-service'})))\n\ntracer = trace.get_tracer(__name__)\n\n# Example usage\nwith tracer.start_as_current_span('example-span'):\n    print('Hello, OpenTelemetry!')","lang":"python","description":"A simple quickstart example to set up an OTLP exporter and send telemetry data."},"warnings":[{"fix":"Update code to handle the new behavior in NoOpTracer.","message":"The behavior of start_span and start_as_current_span in NoOpTracer has changed; it now propagates the span context properly.","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":"Install either 'opentelemetry-exporter-otlp-proto-grpc' or 'opentelemetry-exporter-otlp-proto-http' (depending on the desired protocol) and update the import statement. For example, change 'from opentelemetry.exporter.otlp.trace_exporter import OTLPSpanExporter' to 'from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter' for the gRPC exporter.","message":"The module 'opentelemetry.exporter.otlp.trace_exporter' no longer exists. The OTLP exporter functionality was split into protocol-specific packages (gRPC and HTTP) and their import paths changed.","severity":"breaking","affected_versions":"1.12.0"},{"fix":"Install the missing OpenTelemetry OTLP exporter package. For example, run: `pip install opentelemetry-exporter-otlp`.","message":"The application failed with `ModuleNotFoundError: No module named 'opentelemetry.exporter.otlp.trace_exporter'`, indicating that the `opentelemetry-exporter-otlp` package is not installed.","severity":"breaking","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-05-12T13:19:05.126Z","next_check":"2026-06-26T00:00:00.000Z","problems":[{"fix":"Install the required protocol-specific package, for example, `pip install opentelemetry-exporter-otlp-proto-grpc` for gRPC or `pip install opentelemetry-exporter-otlp-proto-http` for HTTP.","cause":"The specific OTLP protocol exporter (e.g., gRPC or HTTP for traces, metrics, or logs) was not installed, as these are separate packages from the base `opentelemetry-exporter-otlp` library.","error":"ModuleNotFoundError: No module named 'opentelemetry.exporter.otlp.proto.grpc.trace_exporter'"},{"fix":"Verify that the OpenTelemetry Collector or backend service is running and configured to listen on the correct IP address and port (e.g., `0.0.0.0:4317` for gRPC or `0.0.0.0:4318` for HTTP to accept external connections). Check firewall rules and ensure the exporter's `endpoint` URL matches the Collector's listening address.","cause":"The OpenTelemetry Collector or the configured telemetry backend is either not running, not accessible from the application's network, or is listening on a different IP address or port than specified in the exporter configuration.","error":"rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing: dial tcp 127.0.0.1:4317: connect: connection refused\""},{"fix":"Configure the OTLP exporter with the necessary authentication headers or TLS client certificates as required by your telemetry backend. Enable debug logging for the exporter to view detailed authentication failure messages.","cause":"The OTLP exporter is attempting to send telemetry data to a secured endpoint without providing valid authentication credentials (e.g., API key, bearer token, or correct TLS certificates), resulting in an unauthorized (401) or forbidden (403) response, or a gRPC 'Unauthenticated' status.","error":"io.opentelemetry.exporter.internal.http.HttpExporter - Failed to export spans. Server responded with HTTP status code 401."},{"fix":"Update the OpenTelemetry Collector's configuration to include an `otlp` receiver in the relevant `pipelines` section (e.g., `metrics`, `traces`, or `logs`) and ensure it's connected to an appropriate exporter within the Collector's service definition. If the backend does not support a specific signal type, disable its export.","cause":"The OpenTelemetry Collector (or the final telemetry backend) is not configured to receive and process the specific type of telemetry data (metrics, traces, or logs) being sent via OTLP.","error":"Failed to export metrics. Server responded with UNIMPLEMENTED. This usually means that your collector is not configured with an otlp receiver in the \"pipelines\" section of the configuration."}],"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}]}}