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.
More on Tracing & Sampling
In production, when do you pick tail-based over head-based trace sampling, and what does it cost you?BeginnerHow do you set up tail sampling in the OpenTelemetry Collector?IntermediateWhy does tail sampling need a load-balancing tier, and how do you build it?AdvancedHow do you combine head and tail sampling in a high-traffic system?AdvancedHow do you get accurate RED metrics if traces are sampled?IntermediateWhat should you put in span attributes and what should you avoid?Beginner