Issue
I have replaysSessionSampleRate
set to 0, so I should not have any replays with no errors in them. But in the UI I still see many replays with no errors.
Applies To
- JavaScript SDK users
- Web Session Replay users
Resolution
Replays with no errors while only having an error sampling rate enabled can happen when the error that was sent along with the replay was filtered out server side. Any of Sentry's inbound filters can cause this.
Here's an example scenario:
- An error occurs in the application and is captured by the SDK.
- The
replaysOnErrorSampleRate
determines that a Session Replay should also be captured. - Both events get sent to Sentry by the SDK.
- The error event meets the criteria to be dropped by the project's inbound filters.
- The replay event is not dropped, but processed like normal.
To confirm whether these replays were triggered by the error sampling, you can go to the Tags section of the replay and check the replayType
. If the replayType
says buffer
, then it is a replay generated via error sampling. If the replayType
says session
, then it is a replay generated via session sampling.
If you would like these errors to stay filtered, while also preventing them from using up your replay quota, you will need to filter these out client side. The most common error that can trigger replays and then be dropped by inbound filters are React Hydration Errors, as these are dropped by default. You can refer to this article for help in filtering these errors out on the client.