fix(v10/core): Sample errors after beforeSend while preserving session updates - #22819
Merged
Conversation
…updates (#22671) When `sampleRate` causes an error event to be dropped, the `_processEvent` method returned early before reaching `_updateSessionFromEvent`, so the session is never marked crashed/errored. This increased crash-free session rates. This PR moves error event sampling after event processors and `beforeSend`, while keeping the session update **before** the sampling decision. The updated pipeline is: `event processors → beforeSend → session update → sampleRate → send` This follows the [session update filtering spec](https://develop.sentry.dev/sdk/telemetry/sessions/#session-update-filtering). Closes #22615
s1gr1d
requested review from
a team,
Lms24,
logaretm and
msonnb
and removed request for
a team
July 29, 2026 12:22
nicohrubec
approved these changes
Jul 29, 2026
Contributor
size-limit report 📦
|
s1gr1d
commented
Jul 29, 2026
s1gr1d
enabled auto-merge (squash)
July 29, 2026 12:45
Lms24
approved these changes
Jul 29, 2026
…-session-update/test.ts Co-authored-by: Lukas Stracke <lukas.stracke@sentry.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
backport of #22671
Closes #22615