Expand description
This crate provides:
- A tracing layer,
TelemetryLayer
, that can be used to publish trace data to honeycomb.io - Utilities for implementing distributed tracing against the honeycomb.io backend
As a tracing layer, TelemetryLayer
can be composed with other layers to provide stdout logging, filtering, etc.
Re-exports§
pub use tracing_distributed::TelemetryLayer;
pub use tracing_distributed::TraceCtxError;
Structs§
- Honeycomb
Telemetry - Telemetry capability that publishes events and spans to Honeycomb.io.
- SpanId
- Unique Span identifier.
- TraceId
- A Honeycomb Trace ID.
Functions§
- current_
dist_ trace_ ctx - Retrieve the distributed trace context associated with the current span.
- new_
blackhole_ telemetry_ layer - Construct a TelemetryLayer that does not publish telemetry to any backend.
- new_
honeycomb_ telemetry_ layer - Construct a TelemetryLayer that publishes telemetry to honeycomb.io using the provided honeycomb config.
- new_
honeycomb_ telemetry_ layer_ with_ trace_ sampling - Construct a TelemetryLayer that publishes telemetry to honeycomb.io using the
provided honeycomb config, and sample rate. This function differs from
new_honeycomb_telemetry_layer
and thesample_rate
on thelibhoney::Config
there in an important way.libhoney
samplesEvent
data, which is individual spans on each trace. This means that using the sampling logic in libhoney may result in missing event data or incomplete traces. Calling this function provides trace-level sampling, meaning sampling decisions are based on a modulo of the traceID, and events in a single trace will not be sampled differently. If the trace is sampled, then all spans under it will be sent to honeycomb. If a trace is not sampled, no spans or events under it will be sent. When using this trace-level sampling, thesample_rate
parameter on thelibhoney::Config
should be set to 1, which is the default. - register_
dist_ tracing_ root - Register the current span as the local root of a distributed trace.