Skip to content

Give better APIs to control start, stop, and sampling of replays #7540

Closed
@jas-kas

Description

@jas-kas

This ticket will take a look at giving users more custom controls for handling their replay recording and sampling.

Scenarios

Here are a list of common scenarios that are requested:

  • Add a hook that is called before sending an error replay, similar to beforeSend. This will allow users to decide to send the replay or not. Note that we will need to have additional side-effects since replays are ongoing. (e.g. if it's discarded, we will need to stop recording).
  • Start recording as if it is an error replay (i.e. so that we save up to 60 seconds before the "send" event), but instead of sending the replay on error, it sends based on user calling a public function
  • Do not do any sampling at all, calling a public API (e.g. start()) should force a sampled session (and disregard any sampling configuration) and start recording
    • stop() should kill the session and stop recording (we currently do not end a session when stopping, it just pauses it!)
  • Custom sampling logic which is currently accomplished by setting sample rates to a value based on a condition This can be accomplished by updating the sample rates and calling addIntegration (https://docs.sentry.io/platforms/javascript/session-replay/#lazy-loading-replay)
  • Converting error session to normal session
### Tasks
- [ ] https://github.com/getsentry/sentry-javascript/issues/7735
- [ ] https://github.com/getsentry/sentry-javascript/issues/7737
- [ ] https://github.com/getsentry/sentry-javascript/issues/7738
### Existing Issues
- [ ] https://github.com/getsentry/sentry-javascript/issues/6420
- [ ] https://github.com/getsentry/sentry-javascript/issues/6537
- [ ] https://github.com/getsentry/sentry-javascript/issues/7192
- [ ] https://github.com/getsentry/sentry-javascript/issues/7193 

Metadata

Metadata

Assignees

Labels

Package: replayIssues related to the Sentry Replay SDK

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions