Registry / observability / jaeger-client

jaeger-client

JSON →
library4.8.0pypypiunverified

The `jaeger-client` library provides a Python implementation for OpenTracing tracers, enabling applications to send traces to a Jaeger backend. It is currently at version 4.8.0, actively maintained, and primarily used for distributed tracing and observability. Releases typically occur every few months, aligning with new features or Python version updates.

pip install jaeger-client
INSTALL
IMPORT
SIG · JAEGER-CLIENT
J
jaeger-client
observabilitypythonv4.8.0
Install
6.4s avg
Import
Disk
23MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v4.8.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
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 24.5MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 6.4s · import 0.000s · 25MB
23MB installed
● package 23MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Config
from jaeger_client import Config
from jaeger_client import Config

This quickstart demonstrates how to initialize the Jaeger tracer using `Config`, create root and child spans, and log key-value pairs. It leverages environment variables for agent host/port, falling back to defaults. Crucially, `tracer.close()` is called to ensure all buffered spans are sent to the Jaeger agent.

import os from jaeger_client import Config # Configure Jaeger client config = Config( config={ 'sampler': { 'type': 'const', 'param': 1, }, 'logging': True, 'local_agent': { 'reporting_host': os.environ.get('JAEGER_AGENT_HOST', 'localhost'), 'reporting_port': int(os.environ.get('JAEGER_AGENT_PORT', 6831)), }, }, service_name='my-python-app', validate=True, ) # Initialize tracer (it's recommended to do this once per application lifetime) tracer = config.initialize_tracer() # Create a root span with tracer.start_active_span('my-root-operation') as scope: scope.span.log_kv({'event': 'root_span_started'}) print(f"Root Span Trace ID: {scope.span.trace_id:x}") # Create a child span automatically inheriting from the active span with tracer.start_active_span('my-child-operation'): print("Doing some work in a child span...") scope.span.log_kv({'event': 'child_work_done'}) print("Spans created and ready to be flushed.") # It is crucial to close the tracer to ensure all buffered spans are flushed. # In a long-running application, this should be done during graceful shutdown. tracer.close()
Debug
Known issues
breakingJaeger-client v4.0.0 introduced support for OpenTracing API v2.0. This may require updating your application's `opentracing` dependency to `v2.0.0` or higher and potentially adjusting API calls.
fix
Ensure `opentracing` is updated to `v2.0.0` or later (`pip install --upgrade opentracing`). Review your code for deprecated OpenTracing v1 API patterns and migrate to v2 equivalents if necessary.
affects: 4.0.0+
breakingPython 2 support was officially dropped in version 4.5.0. Furthermore, version 4.7.0 raised the minimum required Python version to 3.7+.
fix
Upgrade your Python interpreter to version 3.7 or newer. If you must use Python 2.x or 3.6, you will need to pin `jaeger-client<4.5.0` or `jaeger-client<4.7.0` respectively, but this is strongly discouraged for security and maintenance reasons.
affects: 4.5.0+, 4.7.0+
gotchaIf `tracer.close()` is not called, especially in short-lived scripts or serverless functions, spans may not be flushed from the buffer and will never appear in Jaeger.
fix
Always ensure `tracer.close()` is called at the end of your application's lifecycle or after the last span has been created, to guarantee all buffered spans are sent to the Jaeger agent.
affects: All versions
gotchaSpans not appearing in the Jaeger UI is often due to misconfigured Jaeger agent host/port, incorrect sampler settings, or network issues.
fix
Verify `JAEGER_AGENT_HOST` and `JAEGER_AGENT_PORT` environment variables or `local_agent` config. Ensure the `sampler` type (e.g., `const`, `ratelimiting`) and `param` are correctly set to allow spans through. Check network connectivity to the Jaeger agent.
affects: All versions
Upgrade
Version history
4.8.0latest on PyPI · released Sep 14, 2021
Audit
Dependencies
opentracingrequiredProvides the OpenTracing API interface that jaeger-client implements.
prometheus_clientoptionalUsed for exposing metrics related to the tracer's operation (e.g., span counts, errors).
Agent activity
29 hits · last 30 days
node
26
OpenAI (training)
2
Resources
jaeger-client — pip install jaeger-client · libregistry