Head-Based Sampling
Decision made at the root span — propagated to all downstream services.
use opentelemetry_sdk::trace::{Sampler, ParentBased, TraceIdRatioBased};
let sampler = ParentBased::new(TraceIdRatioBased::new(0.01));
opentelemetry_sdk::trace::Config::default()
.with_sampler(sampler)
ParentBased: if the parent was sampled, sample the child. Consistent across services.
TraceIdRatioBased: deterministic — same trace ID always makes the same decision.