-
-
Notifications
You must be signed in to change notification settings - Fork 226
Description
Description
Overwrite Dynamic Sampling Context (DSC) sample_rate when sampling decision is made
See: https://linear.app/getsentry/project/update-the-dscs-sample-rate-e4e8398e6acc/overview
See also: getsentry/team-sdks#117
Description
As required by Relay and the EAP, the sample_rate in the DSC must specify the actual sample rate of the trace. If an SDK overrides the sample rate of an incoming trace, for example by invoking the tracesSampler, the new rate must be set on the DSC.
Note that usually the DSC is supposed to be immutable, which includes the sample rate, to ensure complete traces. Invoking the tracesSampler purposefully opts out of this and modifies the DSC.Implementation
On an incoming trace, the DSC's
sample_rateis updated if:
- an explicit sampling decision is forced, e.g.
startTransaction(sampled: true)- the
tracesSampleris invoked- the
tracesSampleRateis used- the SDK downsamples due to backpressure
Symptom
The Trace-View's extrapolation is based on the "sample_rate" of the Dynamic Sampling Context.
So it needs to reflect the actual "sample_rate" used, when the downstream SDK makes a sampling decision.
Metadata
Metadata
Assignees
Labels
Projects
Status