fn sample_based_on_probability(prob: f64, trace_id: TraceId) -> SamplingDecision
Expand description

The code here mainly refers to the relevant implementation of opentelemetry, and determines whether the span needs to be collected based on the TraceId and sampling rate (i.e. prob).