py-zipkin
Library for using Zipkin in Python.
Decision gist · record as of 2026-08-14
Yes, if you are already running Zipkin and need Python instrumentation. The library is actively maintained, has low install friction, and provides a clean API for both simple and complex tracing scenarios. The Apache v2 license poses no restrictions. Consider it essential for microservice observability in a Zipkin-based infrastructure; not relevant if you use a different tracing backend (Jaeger, DataDog, etc.).AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires a transport handler implementation to send spans; without one, spans are created but not exported.
- Zipkin collector endpoint must be accessible from your application.
- Low install friction with a single runtime dependency (typing-extensions).
License · maintenance · safety
permissive license (permissive) — Licensed under Apache v2 (permissive). No restrictions on commercial or private use; modifications and redistribution are allowed under Apache terms.
last release 2023-03-24 (1239 days) · last repo commit 2026-04-02 · 222 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 484,185 downloads/mo, #6,404 on PyPI
Alternatives
Verify before relying
pip install py_zipkin
from py_zipkin.zipkin import zipkin_span
from py_zipkin.transport import BaseTransportHandler
class MyTransport(BaseTransportHandler):
def get_max_payload_bytes(self):
return None
def send(self, encoded_span):
pass # Send to Zipkin collector
with zipkin_span(
service_name='my_service',
span_name='my_operation',
transport_handler=MyTransport(),
port=9411,
sample_rate=0.05,
):
# Your code here
pass- Whether the package supports async/await patterns beyond the experimental multithreading guidance in the documentation.
- Current compatibility with Python versions beyond 3.7 and 3.8 (classifiers list only those two, but requires_python states >=3.7).
- Whether firehose mode overhead is acceptable for production workloads at scale.
What it is and what it does
py_zipkin is a Python library that integrates Zipkin distributed tracing into your applications. It provides the zipkin_span context manager and decorator to wrap code blocks or functions, automatically creating and sending trace spans to a Zipkin collector. The library handles span creation, sampling, and context propagation across service boundaries.
You supply a transport handler (HTTP, Kafka, or custom) that encodes spans in thrift format and sends them to your Zipkin backend. py_zipkin manages the trace context using thread-local storage by default, with support for explicit Stack and SpanStorage instances in multithreaded or async environments. It also offers utilities to add binary annotations, mark remote service calls, and generate HTTP headers for propagating trace context to downstream services.
Use it for
- Instrument a microservice to trace requests end-to-end across multiple services by propagating trace headers.
- Add sampling-based tracing to high-throughput services to monitor latency and service dependencies without capturing every request.
- Record custom span metadata (binary annotations) during request processing to track business logic or debug information.
- Mark calls to non-instrumented external services with remote endpoint annotations so the trace graph shows the full call chain.
- Implement firehose mode to capture 100% of spans for a subset of traffic and route them to a separate retention backend.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you are already running Zipkin and need Python instrumentation.
The library is actively maintained, has low install friction, and provides a clean API for both simple and complex tracing scenarios. The Apache v2 license poses no restrictions. Consider it essential for microservice observability in a Zipkin-based infrastructure; not relevant if you use a different tracing backend (Jaeger, DataDog, etc.).
Install
py-zipkin on PyPI
Before you install
Low install friction with a single runtime dependency (typing-extensions). Maintenance status is active with recent commits as of 2026-04-02, though the latest release was 2023-03-24.
Requires a transport handler implementation to send spans; without one, spans are created but not exported. Zipkin collector endpoint must be accessible from your application.
License in practice
Licensed under Apache v2 (permissive). No restrictions on commercial or private use; modifications and redistribution are allowed under Apache terms.
Quickstart
pip install py_zipkin
from py_zipkin.zipkin import zipkin_span
from py_zipkin.transport import BaseTransportHandler
class MyTransport(BaseTransportHandler):
def get_max_payload_bytes(self):
return None
def send(self, encoded_span):
pass # Send to Zipkin collector
with zipkin_span(
service_name='my_service',
span_name='my_operation',
transport_handler=MyTransport(),
port=9411,
sample_rate=0.05,
):
# Your code here
pass
Verify before relying
- Whether the package supports async/await patterns beyond the experimental multithreading guidance in the documentation.
- Current compatibility with Python versions beyond 3.7 and 3.8 (classifiers list only those two, but requires_python states >=3.7).
- Whether firehose mode overhead is acceptable for production workloads at scale.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.7 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagetyping-extensions |
| Maintenance | Actively maintained 1,239 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 484,185 / month, #6,404 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 3 - AlphaIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3.7Programming Language :: Python :: 3.8Topic :: Software Development :: Libraries :: Python Modules |
Evidence: py_zipkin-1.2.8-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “span context manager decorator”
- py-zipkinpy_zipkin provides context managers and decorators to instrument…
- otel-extensionsProvides helper classes, decorators, and functions to simplify setup…
- pidManages process ID files with stale detection, file locking, and…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also opentelemetry-exporter-zipkin-proto-http · opentelemetry-exporter-zipkin · opentelemetry-exporter-zipkin-json · opentelemetry-instrumentation-aiokafka · opentelemetry-instrumentation-kafka-python · opentelemetry-instrumentation-confluent-kafka · opentelemetry-instrumentation-httpx · jaeger-client · opentelemetry-instrumentation-ollama · opentracing