Head-based consistent sampling, also known as upfront sampling, makes the sampling decision once per trace at the beginning of the trace. The decision is usually made by the tracing libraries running inside the application, because consulting the tracing backend at the point of creating the first span would put the tracing infrastructure onto the critical path of the business requests, which is highly undesirable for performance and reliability reasons.
The decision is recorded as part of the trace metadata and propagated throughout the call graph as part of the context. This sampling scheme is consistent because it ensures that either all spans of a given trace are captured by the tracing system or none of them are. Head-based sampling is employed by the majority of existing industrial-grade tracing systems today.
When the sampling decision must be made at the root of the trace, there is relatively little information available to the tracer on which to base...