opentracing
OpenTracing API for Python. See documentation at http://opentracing.io
What it is and what it does
OpenTracing is a vendor-neutral API specification for distributed tracing in Python. It defines interfaces for creating spans (units of work), managing trace context across service boundaries, and propagating tracing information through HTTP headers or other carriers. The library itself provides only the API contract and a basic no-op implementation; actual tracing backends (like Zipkin or Jaeger) are implemented separately by instrumentation libraries.
The package is designed for use by framework and library authors who want to instrument their code to participate in distributed traces. It handles three core tasks: extracting trace context from inbound requests, storing the active span in request-local storage via a ScopeManager, and injecting trace context into outbound calls. Multiple ScopeManager implementations are included for thread-local, gevent, Tornado, asyncio, and contextvars-based storage.
Use it for:
- Instrument a web service to extract and propagate trace context from incoming HTTP requests to child spans for outbound calls
- Create a custom ScopeManager for an async framework to manage active spans across coroutines or tasks
- Build an instrumentation library that wraps a third-party service client to automatically create and tag spans for each call
- Integrate with a tracing backend by implementing a Tracer that records spans and sends them to a collector
- Propagate trace IDs across microservices to correlate logs and metrics from a single user request
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides the OpenTracing API for Python, enabling distributed tracing instrumentation across services through span creation, context propagation, and scope management.
No. The package is abandoned (repository archived, no releases since 2020-11-19, last commit 2022-07-01) and the OpenTracing standard itself has been superseded by OpenTelemetry. While the API remains stable and has no known vulnerabilities, new projects should adopt OpenTelemetry instead. Use this only if you are maintaining legacy code that already depends on it.
Install
opentracing on PyPI
pip
pip install opentracinguv
uv add opentracingpoetry
poetry add opentracingInstalling opentracing
Before you install
High install friction; the package is abandoned (last commit 2022-07-01, repository archived) and has not been released in over 3 years. No runtime dependencies, but maintenance has ceased entirely.
License in practice
Licensed under Apache License 2.0 (permissive). You may use, modify, and distribute this package freely in commercial and open-source projects, provided you include the license notice.
Quickstart
pip install opentracing==2.4.0
import opentracing
from opentracing.scope_managers import ThreadLocalScopeManager
tracer = opentracing.Tracer(scope_manager=ThreadLocalScopeManager())
with tracer.start_active_span('operation_name', finish_on_close=True) as scope:
scope.span.set_tag('key', 'value')
The package is abandoned; no active maintenance or support. Classifiers list Python 2.7, 3.5–3.7; compatibility with modern Python versions is unverified.
Verify before relying
- Whether the API remains compatible with modern Python versions beyond those listed in classifiers (3.5–3.7)
- Whether instrumentation libraries and tracer implementations built on this API are still actively maintained
- Current state of the OpenTracing specification and whether it has been superseded by OpenTelemetry or other standards
Package facts
| License | Apache License 2.0 (permissive) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | abandoned — 2,094 days since the last release |
| Last repo commit | (repository archived) |
| First released | |
| Downloads | 812,864/month — #4,998 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: opentracing-2.4.0.tar.gz
Keywords: opentracing
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
opentelemetry-instrumentation-botoAdds distributed tracing to AWS SDK (Boto)…
permissive · top 5,000 on PyPI
opentelemetry-propagator-ot-traceProvides OpenTelemetry trace context…
permissive · top 5,000 on PyPI
jaeger-clientJaeger-client instruments Python applications…
permissive · top 15,000 on PyPI
azure-core-tracing-opentelemetryIntegrates Azure SDK clients with OpenTelemetry…
unclear · top 5,000 on PyPI
openinference-instrumentation-mcpAuto-instruments MCP tool calls to propagate…
permissive · top 15,000 on PyPI
opencensus-ext-flaskAdds distributed tracing instrumentation to…
permissive · top 15,000 on PyPI
opentelemetry-instrumentation-djangoAdds distributed tracing to Django applications…
permissive · top 1,000 on PyPI
opentelemetry-instrumentation-threadingEnsures OpenTelemetry context is propagated…
permissive · top 1,000 on PyPI
opentelemetry-instrumentation-urllibCaptures and traces HTTP requests made by…
permissive · top 1,000 on PyPI
opentelemetry-instrumentationProvides automatic instrumentation commands and…
permissive · top 1,000 on PyPI