This library allows to export tracing data to Zipkin.
UsageThe OpenTelemetry Zipkin JSON Exporter allows exporting of OpenTelemetry traces to Zipkin. This exporter sends traces to the configured Zipkin collector endpoint using JSON over HTTP and supports multiple versions (v1, v2).
import requests from opentelemetry import trace from opentelemetry.exporter.zipkin.json import ZipkinExporter from opentelemetry.sdk.trace import TracerProvider from opentelemetry.sdk.trace.export import BatchSpanProcessor trace.set_tracer_provider(TracerProvider()) tracer = trace.get_tracer(__name__) # create a ZipkinExporter zipkin_exporter = ZipkinExporter( # version=Protocol.V2 # optional: # endpoint="http://localhost:9411/api/v2/spans", # local_node_ipv4="192.168.0.1", # local_node_ipv6="2001:db8::c001", # local_node_port=31313, # max_tag_value_length=256, # timeout=5 (in seconds), # session=requests.Session(), ) # Create a BatchSpanProcessor and add the exporter to it span_processor = BatchSpanProcessor(zipkin_exporter) # add to the tracer trace.get_tracer_provider().add_span_processor(span_processor) with tracer.start_as_current_span("foo"): print("Hello world!")
The exporter supports the following environment variable for configuration:
APIBases: SpanExporter
Exports a batch of telemetry data.
Shuts down the exporter.
Called when the SDK is shut down.
Hint to ensure that the export of any spans the exporter has received prior to the call to ForceFlush SHOULD be completed as soon as possible, preferably before returning from this method.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4