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-clientVerified import paths — ran on the pinned version, not inferred.
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.
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.
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.
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.
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.