Expand description
OpenTelemetry tracing layer with zero overhead when disabled.
This module provides OpenTelemetry distributed tracing support that can be compiled into production builds but only activated at runtime when an endpoint is configured.
§Transport
Uses HTTP transport with a blocking reqwest client. This works without an async runtime context because:
- The BatchSpanProcessor spawns its own dedicated background thread
- The reqwest-blocking-client handles HTTP exports synchronously
This is important because Zebra’s tracing component initializes before the Tokio runtime starts.
Constants§
- EXPORTED_
SPANS 🔒 - The spans exported as traces, as
(crate, span name)pairs.
Functions§
- exporting_
layer 🔒 - Returns a layer that exports the spans and events
is_exportedselects totracer. - is_
exported 🔒 - Returns
trueif the OpenTelemetry layer should see this span or event. - layer
- Creates an OpenTelemetry layer if an endpoint is configured.
- sampler_
description 🔒 - Returns the sampler Zebra uses, as the OpenTelemetry SDK describes it.
- sampler_
env_ 🔒problem - Returns why the standard sampler environment variables won’t sample as an operator probably intended, if they won’t.
- sampler_
for_ 🔒percent - Returns the sampler for a percentage of traces, treating values above 100 as 100.
Type Aliases§
- Otel
Error - Error type for OpenTelemetry layer initialization.