Registry /
observability / opentelemetry-exporter-jaeger-thrift
Install & Compatibility
Where this runs
tested against v1.21.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 27.8MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 2.5s · import 0.000s · 25MB
24MB installed
● package 24MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
JaegerExporter
✓ from opentelemetry.exporter.jaeger.thrift import JaegerExporter
✗ from opentelemetry.exporter.jaeger.thrift import JaegerExporter
This example demonstrates how to configure the Jaeger Thrift exporter to send traces to a local Jaeger Agent. It sets up a TracerProvider with a service name, initializes the `JaegerExporter` (which by default connects to `localhost:6831`), adds it to a `BatchSpanProcessor`, and then creates a simple trace with parent and child spans. Ensure a Jaeger Agent is running and accessible on the specified host and port for traces to be received. For production environments or newer Jaeger versions, migrating to the OTLP exporter is recommended.
import os
from opentelemetry import trace
from opentelemetry.exporter.jaeger.thrift import JaegerExporter
from opentelemetry.sdk.resources import Resource, SERVICE_NAME
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import BatchSpanProcessor
# Ensure Jaeger Agent is running, e.g., via Docker: docker run -d --name jaeger -p 6831:6831/udp -p 16686:16686 jaegertracing/all-in-one:latest
# Configure the TracerProvider
trace.set_tracer_provider(
TracerProvider(
resource=Resource.create({SERVICE_NAME: "my-jaeger-service"})
)
)
# Configure JaegerExporter (defaults to agent_host_name='localhost', agent_port=6831)
jaeger_exporter = JaegerExporter(
service_name=os.environ.get('OTEL_SERVICE_NAME', 'my-python-app'),
agent_host_name=os.environ.get('JAEGER_AGENT_HOST', 'localhost'),
agent_port=int(os.environ.get('JAEGER_AGENT_PORT', 6831))
)
# Add the exporter to a BatchSpanProcessor and then to the TracerProvider
trace.get_tracer_provider().add_span_processor(
BatchSpanProcessor(jaeger_exporter)
)
# Get a tracer and create some spans
tracer = trace.get_tracer(__name__)
with tracer.start_as_current_span("root-operation"):
print("Starting root operation...")
with tracer.start_as_current_span("child-work"):
print("Performing child work...")
print("Root operation finished.")
# Spans will be sent to Jaeger Agent, viewable at http://localhost:16686 (if running locally)
Debug
Known issues
breakingThis `opentelemetry-exporter-jaeger-thrift` package is officially deprecated and no longer actively tested since late 2023. Jaeger itself supports the OpenTelemetry Protocol (OTLP) natively since version 1.35. All new deployments and existing users should migrate to the `opentelemetry-exporter-otlp` package for improved compatibility, features, and active maintenance.fixMigrate to `pip install opentelemetry-exporter-otlp` and configure `OTLPSpanExporter`. Update Jaeger Collector/Agent to a version that supports OTLP (>=1.35).
affects: >=1.22.0 (effectively, as active support ended)
deprecatedThe `opentelemetry.ext` import path for Jaeger exporter (e.g., `from opentelemetry.ext import jaeger`) is deprecated. Use the direct exporter module path.fixUpdate imports from `from opentelemetry.ext import jaeger` to `from opentelemetry.exporter.jaeger.thrift import JaegerExporter`.
affects: <1.0.0 (API/SDK); generally discouraged since 1.0.0, though old paths might still work for some time.
gotchaWhen exporting to a Jaeger Agent via UDP, exceeding the maximum UDP packet size can lead to dropped spans and potentially leave the exporter in a broken state, preventing further span exports. This is a common issue with Thrift UDP transport.fixReduce the batch size of spans (`BatchSpanProcessor(max_queue_size=..., max_export_batch_size=...)`), or preferably, switch to OTLP exporter which often uses gRPC or HTTP, mitigating UDP size limits. Ensure your Jaeger Agent/Collector configuration can handle large payloads if using HTTP.
affects: All versions using UDP agent export
gotchaIncorrect Jaeger Agent/Collector host or port configuration, or the Jaeger backend not running/accessible, will result in traces not being sent or received. There might be no explicit error if UDP is used, leading to silent data loss.fixDouble-check `agent_host_name` and `agent_port` (or `collector_host_name`, `collector_port`, `collector_endpoint` for HTTP) parameters. Verify that your Jaeger Agent/Collector is running and listening on the expected network interfaces and ports (e.g., `localhost:6831/udp` for agent, `localhost:14268/api/traces?format=jaeger.thrift` for collector HTTP).
affects: All versions
Upgrade
Version history
1.21.0latest on PyPI · released Nov 7, 2023
Audit
Dependencies
opentelemetry-apirequiredCore OpenTelemetry API for defining and interacting with telemetry.
opentelemetry-sdkrequiredOpenTelemetry SDK, providing implementation for API calls and managing telemetry pipelines.
thriftrequiredRequired for the Thrift serialization protocol used by this exporter.