Skip to main content

How do I record replays more selectively?

Updated over a month ago

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, while replaysOnErrorSampleRate controls the percentage of error sessions to record. Lowering either one of the two, or even setting replaysSessionSampleRate 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.

  • 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.

  • Mobile

These approaches give you significant flexibility to control your replay quota while focusing on the sessions that matter most to your debugging needs.

Did this answer your question?