You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Continued traces propagate sample_rate=1.0 instead of upstream #8182
Inspect the outgoing baggage and the envelope trace header of the sent transaction.
Same result with trace_lifecycle="stream".
Expected Result
The incoming DSC is frozen, so sample_rate=0.01 is propagated as is, in both the envelope trace header and outgoing baggage. The DSC spec says the receiving SDK MUST consider the incoming DSC frozen and propagate its values "as is". Other SDKs propagate the incoming sample rate in this scenario.
Actual Result
Both the envelope trace header and outgoing baggage carry sample_rate=1.0:
When inheriting the parent decision, the SDK sets the transaction's sample rate to float(parent_sampled), i.e. 1.0, and then writes it over sample_rate in the frozen incoming DSC (Scope.start_transaction, and Scope._update_sample_rate for span streaming). This was introduced in #4018 (released in 2.22.0), which changed test_dsc_continuation_of_trace to expect 1.0 instead of the incoming rate.
Why this matters: Relay derives client_sample_rate from the DSC sample_rate, and Sentry uses it to extrapolate counts in the product. Data from any Python service that continues a trace gets weighted as if it were sampled at 100%. In the example above, extrapolated counts for that service end up 100x too low. Because the overwritten baggage is also propagated, every downstream service inherits 1.0 as well.
I can prepare a focused fix that preserves the incoming frozen DSC sample rate when inheriting an upstream sampling decision, while keeping local sampling decisions able to update it. I would cover both transaction sampling and span streaming, including outgoing baggage and envelope trace metadata. Could a maintainer confirm this approach before I start? The contribution guide requires maintainer discussion on the issue before implementation.
Activity
linear-code commentedon Nov 3, 2026
PY-3057
itsrayeedscodespace commentedon Nov 3, 2026
I can prepare a focused fix that preserves the incoming frozen DSC sample rate when inheriting an upstream sampling decision, while keeping local sampling decisions able to update it. I would cover both transaction sampling and span streaming, including outgoing baggage and envelope trace metadata. Could a maintainer confirm this approach before I start? The contribution guide requires maintainer discussion on the issue before implementation.
fix(sampling): Respect incoming sample rate if not explicitly overrid…