hyperlane-plugin-tracing 23.3.0

A lock-free W3C Trace Context (traceparent/tracestate), X-Request-Id, Server-Timing, and pluggable SpanExporter distributed tracing plugin for the Hyperlane framework.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use super::*;

/// Global process-wide [`TracingPlugin`] singleton initialized via [`TracingPlugin::init`].
pub(crate) static TRACING_PLUGIN: OnceLock<TracingPlugin> = OnceLock::new();

/// Lock-free monotonic counter feeding non-blocking trace and span ID generation.
pub(crate) static TRACE_SEQ: AtomicU64 = AtomicU64::new(1);

/// Process-unique entropy seed initialized once on first ID generation.
pub(crate) static TRACE_SEED: OnceLock<u64> = OnceLock::new();

thread_local! {
    /// Per-thread monotonic sequence slice avoiding cross-core atomic cache-line contention.
    pub(crate) static LOCAL_TRACE_SEQ: Cell<u64> = const { Cell::new(0) };
}