Issue
I am having trouble staying within my reserved replays. Are there any ways I can more selectively sample them?
Applies To
- All SaaS Customers
- Web and Mobile Session Replay
Resolution
Here are some methods that will allow you to more selectively use Session Replay:
-
Web + Mobile
-
Sample Rate Configuration:
replaysSessionSampleRate
controls the percentage of overall sessions to record, whilereplaysOnErrorSampleRate
controls the percentage of error sessions to record. Lowering either one of the two, or even settingreplaysSessionSampleRate
to 0 so that you record replays only when an error occurs, can have a signifficant impact on how many replays you send to Sentry.
-
Sample Rate Configuration:
-
Web
-
Filtering Specific Errors: If you want to capture replays only for specific errors and not others, you can use the
beforeErrorSampling
callback. This allows you to selectively decide which errors should trigger a replay recording. We recommend checking out our examples for custom sampling here as well. - Manual Control: For complete control, you can manually start and stop recordings.
-
Filtering Specific Errors: If you want to capture replays only for specific errors and not others, you can use the
-
Mobile
- Disable Replay for Low-End Devices: You can disable recording replays for lower end devices, since it might be causing performance issues for your application anyway.
These approaches give you significant flexibility to control your replay quota while focusing on the sessions that matter most to your debugging needs.