Skip to content

sampleRate for error events silently prevents crash-free session marking #22615

Description

@lukapozega

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

  1. Sentry.init({ sampleRate: 0.01, ... })
  2. 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.

Metadata

Metadata

Assignees

Projects

Status
No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions