Registry / observability / opentelemetry-exporter-zipkin-json

opentelemetry-exporter-zipkin-json

JSON →
library1.44.0pypypi✓ verified 23d ago

This library allows to export tracing data to Zipkin using JSON for serialization. It is part of the OpenTelemetry Python project, which releases frequently (typically monthly or bi-monthly). The current version is 1.41.0.

pip install opentelemetry-exporter-zipkin-json opentelemetry-sdk requests
INSTALL
IMPORT
SIG · OPENTELEMETRY-EXPO
O
opentelemetry-exporter-zipkin-json
observabilitypythonv1.44.0
Install
2.6s avg
Import
467ms
Disk
24MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.44.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.95 runs
installs and imports cleanly · install 0.0s · import 0.476s · 25.3MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.6s · import 0.458s · 26MB
24MB installed
● package 24MB
Code
Verified usage

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

ZipkinExporter
from opentelemetry.exporter.zipkin.json import ZipkinExporter

This quickstart demonstrates how to set up the OpenTelemetry Python SDK with the Zipkin JSON Exporter. It initializes a TracerProvider, configures the ZipkinExporter to send traces to a default or environment-variable-defined endpoint, and uses a BatchSpanProcessor for efficient trace export. Finally, it creates a simple span and ensures proper shutdown.

import os from opentelemetry import trace from opentelemetry.sdk.resources import Resource from opentelemetry.sdk.trace import TracerProvider from opentelemetry.sdk.trace.export import BatchSpanProcessor from opentelemetry.exporter.zipkin.json import ZipkinExporter # Configure a TracerProvider with a service name resource = Resource.create({"service.name": "my-zipkin-service"}) tracer_provider = TracerProvider(resource=resource) trace.set_tracer_provider(tracer_provider) # Create a ZipkinExporter # The default endpoint is http://localhost:9411/api/v2/spans # You can override it with environment variable OTEL_EXPORTER_ZIPKIN_ENDPOINT # or by passing the 'endpoint' argument to ZipkinExporter zipkin_exporter = ZipkinExporter( endpoint=os.environ.get("OTEL_EXPORTER_ZIPKIN_ENDPOINT", "http://localhost:9411/api/v2/spans") ) # Add the exporter to a BatchSpanProcessor span_processor = BatchSpanProcessor(zipkin_exporter) tracer_provider.add_span_processor(span_processor) # Get a tracer and create a span tracer = trace.get_tracer(__name__) with tracer.start_as_current_span("my-span") as span: span.set_attribute("event.name", "hello") print("Hello, OpenTelemetry with Zipkin!") # Ensure all spans are exported before exiting tracer_provider.shutdown()
Debug
Known issues
gotchaMissing 'service.name' Resource Attribute: If the 'service.name' resource attribute is not explicitly set, traces may appear as 'unknown_service' in the Zipkin UI, making it difficult to identify the originating service.
fix
Always set the 'service.name' attribute when initializing the TracerProvider's Resource, e.g., `Resource.create({"service.name": "my-app-name"})`.
affects: All versions
gotchaSilent Export Failures: OpenTelemetry exporters, including Zipkin, often fail silently if there are configuration errors (e.g., incorrect endpoint URL, network issues, or timeouts). Traces might not reach Zipkin without any obvious error message.
fix
Enable OpenTelemetry debug logging (`OTEL_PYTHON_LOG_LEVEL=DEBUG`) and monitor exporter logs for errors. Verify the Zipkin collector is running and accessible at the configured endpoint (e.g., `http://localhost:9411/api/v2/spans`).
affects: All versions
gotchaUnended Spans Not Exported: Spans created but not explicitly ended (e.g., `span.end()` or exiting a `with` block) will remain in memory and will not be exported. Additionally, avoid using `SimpleSpanProcessor` in production as it blocks the application thread; `BatchSpanProcessor` is recommended for performance.
fix
Ensure all spans are properly ended. Use `with tracer.start_as_current_span(...)` or explicitly call `span.end()`. Always configure the SDK with a `BatchSpanProcessor` for production environments.
affects: All versions
gotchaIncorrect Zipkin Endpoint Configuration: The Zipkin exporter defaults to `http://localhost:9411/api/v2/spans`. A common mistake is using an incorrect host, port, or omitting the `/api/v2/spans` path, which can lead to connection refused or 404 errors at the Zipkin collector.
fix
Verify the `endpoint` URL matches your Zipkin collector's configuration, including the full path. Use the `OTEL_EXPORTER_ZIPKIN_ENDPOINT` environment variable or pass the `endpoint` argument directly to `ZipkinExporter`.
affects: All versions
Upgrade
Version history
1.44.0latest on PyPI · released Jul 16, 2026
Audit
Dependencies
opentelemetry-sdkrequiredRequired for OpenTelemetry SDK functionalities like TracerProvider and SpanProcessor.
requestsoptionalUsed internally by the ZipkinExporter for sending traces via HTTP.
Agent activity
11 hits · last 30 days
node
8
OpenAI (training)
2
Resources
opentelemetry-exporter-zipkin-json — pip install opentelemetry-exporter-zipkin-json · libregistry