Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/vue
SDK Version
10.65.0
Framework Version
Vue 3.5.12
Link to Sentry event
No response
Reproduction Example/SDK Setup
No response
Steps to Reproduce
- Sentry.init({ sampleRate: 0.01, ... })
- Throw an unhandled error on every session.
Expected Result
Crash-free session rate should be 0%
Actual Result
With sample rate set to 0.01 Crash-free session rate stays ~99–100% because ~99% of the time, the error is dropped by sampleRate before the session is ever marked crashed.
Additional Context
In Client._processEvent():
beforeSend returning null has the exact same effect, for the same reason (it also short-circuits before reaching _updateSessionFromEvent).
This is different to what docs say:
Please note that the number of crashes is not expected to match the number of crashed sessions because sessions are not subject to [inbound filters](https://docs.sentry.io/concepts/data-management/filtering/) or [sampling](https://docs.sentry.io/platform-redirect/?next=/configuration/sampling/).
Priority
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/vue
SDK Version
10.65.0
Framework Version
Vue 3.5.12
Link to Sentry event
No response
Reproduction Example/SDK Setup
No response
Steps to Reproduce
Expected Result
Crash-free session rate should be 0%
Actual Result
With sample rate set to
0.01Crash-free session rate stays ~99–100% because ~99% of the time, the error is dropped by sampleRate before the session is ever marked crashed.Additional Context
In Client._processEvent():
The sampleRate roll happens first and returns early on drop:
https://github.com/getsentry/sentry-javascript/blob/develop/packages/core/src/client.ts#L1446
Session status is only updated further down the same promise chain, so it's unreachable for anything dropped above:
https://github.com/getsentry/sentry-javascript/blob/develop/packages/core/src/client.ts#L1484-L1487
beforeSend returning null has the exact same effect, for the same reason (it also short-circuits before reaching _updateSessionFromEvent).
This is different to what docs say:
Please note that the number of crashes is not expected to match the number of crashed sessions because sessions are not subject to [inbound filters](https://docs.sentry.io/concepts/data-management/filtering/) or [sampling](https://docs.sentry.io/platform-redirect/?next=/configuration/sampling/).Priority
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding
+1orme too, to help us triage it.