Expand description
Head sampler — per (full_name, sev) rate decision.
Spec 13 § 6, spec 11 § 4.1 step 4.
Decision order, mirroring spec 13 § 6:
- Inbound
traceparent.sampled— when set on the active scope frame, the upstream caller already decided. ReturnsSamplingDecision::ParentSet { sampled }so the caller stampssampling_reason = OVERRIDEon emit. - Severity floor (
always_log_at_or_above) — bypasses sampling. - Per-event rate from config; otherwise the global default rate.
The implementation uses fastrand::f64()-equivalent behaviour
via rand-free path — we cheat with a per-thread XorShift to keep
the runtime out of the rand dependency tree on the hot path.
Enums§
- Sampling
Decision - Outcome of the head-sampler decision.
Functions§
- decide
- Run the head sampler.
inbound_sampledis thetraceparent.sampledbit lifted off the active scope frame; passNonewhen no scope is active or the caller did not propagate W3C trace context.