skillfed

opentracing

OpenTracing API for Python. See documentation at http://opentracing.io

opentracing v2.4.0 812.9K downloads/30d#4,998 on PyPI750
Permissive license Apache License 2.0 Abandoned released

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 opentracing

uv

uv add opentracing

poetry

poetry add opentracing

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 2.7Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Libraries :: Python Modules

Tags

distributed tracing apiopentracing pythonspan context propagationrequest tracing instrumentationtrace context managementservice call tracingdistributed request tracking
distributed-tracingabandonedinstrumentation

More Python Modules packages

idna

Converts domain names between Unicode and…

permissive · top 100 on PyPI

setuptools

Setuptools is a Python build backend and…

permissive · top 100 on PyPI

PyYAML

PyYAML parses and emits YAML 1.1 data format,…

permissive · top 100 on PyPI

pydantic

Pydantic validates Python data structures…

permissive · top 100 on PyPI

annotated-types

Provides reusable metadata objects for use with…

permissive · top 100 on PyPI

typing-inspection

Provides runtime tools to inspect and…

permissive · top 100 on PyPI

opentelemetry-instrumentation-boto

Adds distributed tracing to AWS SDK (Boto)…

permissive · top 5,000 on PyPI

opentelemetry-propagator-ot-trace

Provides OpenTelemetry trace context…

permissive · top 5,000 on PyPI

jaeger-client

Jaeger-client instruments Python applications…

permissive · top 15,000 on PyPI

azure-core-tracing-opentelemetry

Integrates Azure SDK clients with OpenTelemetry…

unclear · top 5,000 on PyPI

openinference-instrumentation-mcp

Auto-instruments MCP tool calls to propagate…

permissive · top 15,000 on PyPI

opencensus-ext-flask

Adds distributed tracing instrumentation to…

permissive · top 15,000 on PyPI

opentelemetry-instrumentation-django

Adds distributed tracing to Django applications…

permissive · top 1,000 on PyPI

opentelemetry-instrumentation-threading

Ensures OpenTelemetry context is propagated…

permissive · top 1,000 on PyPI

opentelemetry-instrumentation-urllib

Captures and traces HTTP requests made by…

permissive · top 1,000 on PyPI

opentelemetry-instrumentation

Provides automatic instrumentation commands and…

permissive · top 1,000 on PyPI