{"id":5352,"library":"opentelemetry-exporter-jaeger-proto-grpc","title":"Jaeger Protobuf gRPC Exporter for OpenTelemetry","description":"This library provides an OpenTelemetry trace exporter for Jaeger, specifically utilizing the Protobuf format over gRPC. It's part of the OpenTelemetry Python Contrib project. The current version is 1.21.0. New releases are frequent and typically align with the broader OpenTelemetry Python SDK release cycle.","status":"active","version":"1.21.0","language":"en","source_language":"en","source_url":"https://github.com/open-telemetry/opentelemetry-python/tree/main/exporter/opentelemetry-exporter-jaeger-proto-grpc","tags":["opentelemetry","tracing","jaeger","exporter","grpc","protobuf"],"install":[{"cmd":"pip install opentelemetry-exporter-jaeger-proto-grpc","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Core OpenTelemetry SDK functionality for tracing.","package":"opentelemetry-sdk","optional":false},{"reason":"Core OpenTelemetry API for instrumentation.","package":"opentelemetry-api","optional":false},{"reason":"Required for gRPC communication with the Jaeger collector.","package":"grpcio","optional":false},{"reason":"Required for Protobuf serialization.","package":"protobuf","optional":false}],"imports":[{"note":"The other 'JaegerExporter' uses Thrift over HTTP/UDP, not Protobuf over gRPC.","wrong":"from opentelemetry.exporter.jaeger import JaegerExporter","symbol":"JaegerExporter","correct":"from opentelemetry.exporter.jaeger.proto.grpc import JaegerExporter"}],"quickstart":{"code":"import os\n\nfrom opentelemetry import trace\nfrom opentelemetry.sdk.resources import SERVICE_NAME, Resource\nfrom opentelemetry.sdk.trace import TracerProvider\nfrom opentelemetry.sdk.trace.export import BatchSpanProcessor\nfrom opentelemetry.exporter.jaeger.proto.grpc import JaegerExporter\n\n# Configure tracing\nresource = Resource.create({\"service.name\": os.environ.get(\"SERVICE_NAME\", \"my-python-app\")})\ntracer_provider = TracerProvider(resource=resource)\n\n# Configure Jaeger Exporter (default endpoint: localhost:14250 for gRPC)\n# Use OTEL_EXPORTER_JAEGER_ENDPOINT environment variable or endpoint param\njaeger_endpoint = os.environ.get(\"OTEL_EXPORTER_JAEGER_ENDPOINT\", \"localhost:14250\")\njaeger_exporter = JaegerExporter(endpoint=jaeger_endpoint)\n\n# Add the exporter to a BatchSpanProcessor and set it as the global tracer provider\nspan_processor = BatchSpanProcessor(jaeger_exporter)\ntracer_provider.add_span_processor(span_processor)\ntrace.set_tracer_provider(tracer_provider)\n\n# Get a tracer and create a span\ntracer = trace.get_tracer(__name__)\n\nwith tracer.start_as_current_span(\"my-first-span\"):\n    with tracer.start_as_current_span(\"my-nested-span\"):\n        print(\"Hello from OpenTelemetry with Jaeger!\")\n\n# Manually shut down the tracer provider to ensure all spans are exported\ntracer_provider.shutdown()\nprint(f\"Traces exported to Jaeger endpoint: {jaeger_endpoint}\")","lang":"python","description":"This example demonstrates how to configure the OpenTelemetry SDK with the Jaeger Protobuf gRPC exporter. It sets up a TracerProvider, creates a JaegerExporter targeting a specified endpoint (defaulting to localhost:14250), and exports two simple spans. Ensure a Jaeger agent or collector is running and accessible at the configured endpoint."},"warnings":[{"fix":"Always check PyPI for the exact version of the package you intend to install and use.","message":"The OpenTelemetry Python project uses a monorepo, where individual package versions on PyPI (e.g., `opentelemetry-exporter-jaeger-proto-grpc` v1.21.0) often differ from the overall project versions mentioned in GitHub release notes (e.g., v1.41.0). Always refer to the PyPI page for the specific package's version.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Verify your Jaeger collector/agent configuration (Thrift vs. gRPC protocol) and choose the corresponding OpenTelemetry exporter package and import path.","message":"There are two distinct Jaeger exporters for OpenTelemetry Python: `opentelemetry-exporter-jaeger` (uses Thrift over HTTP/UDP) and `opentelemetry-exporter-jaeger-proto-grpc` (uses Protobuf over gRPC). Ensure you install and import the correct one for your Jaeger backend setup.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure your Jaeger agent/collector is running and accessible from your application's host. Configure the exporter's endpoint using the `OTEL_EXPORTER_JAEGER_ENDPOINT` environment variable or the `endpoint` parameter in the `JaegerExporter` constructor (default is `localhost:14250`).","message":"The Jaeger exporter requires a running Jaeger agent or collector reachable at the specified endpoint. If the agent/collector is not running or the endpoint is misconfigured, traces will not be exported, and the application might not raise explicit errors for this data loss.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Check for `grpcio` and `protobuf` specific installation issues if you encounter problems. Using a virtual environment is highly recommended. For M1 Macs, `grpcio` might require specific compilation flags or pre-built wheels.","message":"The `grpcio` and `protobuf` dependencies are critical for this exporter. Occasionally, these packages can have complex installation requirements or version conflicts in highly constrained environments. Ensure they install correctly.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Always call `tracer_provider.shutdown()` at the graceful exit point of your application, for example, using a `atexit` hook or within a `try...finally` block in long-running services.","message":"When manually shutting down the `TracerProvider` using `tracer_provider.shutdown()`, it's important to do so before your application exits. Otherwise, pending spans in the `BatchSpanProcessor` might not be flushed and could be lost.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-13T00:00:00.000Z","next_check":"2026-07-12T00:00:00.000Z"}