How do you configure head sampling correctly in OpenTelemetry?

BeginnerProductionTracing & Sampling
Answer

Use parentbased_traceidratio so downstream services follow the root decision and traces stay complete:

export OTEL_TRACES_SAMPLER=parentbased_traceidratio
export OTEL_TRACES_SAMPLER_ARG=0.1

A plain traceidratio in every service samples independently and produces broken, partial traces. Set the ratio only at the edge services in practice; downstream services inherit it via the traceparent sampled flag.

All Monitoring & Observability questions Roadmap: Logging & tracing

More on Tracing & Sampling