Skip to content

fix(sampling): Respect incoming sample rate if not explicitly overridden - #8185

Merged
sentrivana merged 1 commit into
masterfrom
ivana/preserve-incoming-sample-rate
Nov 5, 2026
Merged

sentrivana merged 1 commit into
masterfrom
ivana/preserve-incoming-sample-rate

Conversation

@sentrivana

@sentrivana sentrivana commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

Description

If there's an incoming sampling decision, traces_sample_rate is irrelevant and shouldn't overwrite the sampling rate in the DSC.

There are cases where we do want to override the incoming sampling decision, but only in cases where the SDK actually uses a different sample rate for some reason (traces_sampler).

Issues

Closes #8182

Reminders

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Coverage Results 📊

✅ 137214 passed | ⏭️ 7456 skipped | Total: 144670 | Pass Rate: 94.85% | Execution Time: 442m 23s

📊 Comparison with Base Branch

Metric Change
Total Tests —
Passed Tests —
Failed Tests —
Skipped Tests —

✨ Test counts unchanged from base.

All tests are passing successfully.

✅ Patch coverage is 100.00% (4 of 4 changed executable lines covered; target 80%).
Project statement coverage is 90.32% (down 0.01 percentage points from base (dbc50bd) to head (8a5a066)).

Changed files with executable lines (1)
File Patch coverage Changed executable lines
sentry_sdk/scope.py 100.00% 4/4 covered
Coverage diff
@@            Coverage Diff             @@
##        master     #8185       +/-##
==========================================
- Coverage    90.33%    90.32%    -0.01%
==========================================
  Files          203       203         —
  Tracked lines     26905     26907        +2
  Branches     10048     10048         —
==========================================
  Hits         24302     24302         —
- Misses        2603      2605        +2
- Partials      1516      1518        +2

Generated by Coverage Action

Comment thread sentry_sdk/scope.py Resolved
@sentrivana
sentrivana force-pushed the ivana/preserve-incoming-sample-rate branch from 3a43948 to 8a5a066 Compare November 5, 2026 09:04
Comment thread sentry_sdk/scope.py Resolved
@sentrivana
sentrivana marked this pull request as ready for review November 5, 2026 09:19
@sentrivana
sentrivana requested a review from a team as a code owner November 5, 2026 09:19
@sentrivana
sentrivana enabled auto-merge (squash) November 5, 2026 09:22
@sentrivana
sentrivana merged commit b787a9a into master Nov 5, 2026
324 of 327 checks passed
@sentrivana
sentrivana deleted the ivana/preserve-incoming-sample-rate branch November 5, 2026 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Continued traces propagate sample_rate=1.0 instead of upstream

2 participants