Package 

Class SessionRebasedSampler

  • All Implemented Interfaces:
    com.datadog.android.core.sampling.Sampler , com.datadog.android.trace.internal.net.SpanAwareSampler

    
    public final class SessionRebasedSampler
     implements Sampler<DatadogSpan>, SpanAwareSampler
                        

    A Sampler decorator that rebases the trace sample rate against the RUM session sample rate.

    When the span carries a LogAttributes.RUM_SESSION_SAMPLE_RATE tag (injected by com.datadog.android.trace.internal.RumContextPropagator), the effective sample rate becomes traceSampleRate * sessionSampleRate / 100. This ensures that the combined probability of a trace being sampled within a sampled RUM session is correctly represented.

    Only DeterministicTraceSampler delegates participate in rebasing; this constraint is enforced at the construction sites, which only wrap the default trace sampler (or one set via setTraceSampleRate). Custom samplers passed via setTraceSampler are not wrapped and bypass rebasing entirely.