Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mobile Session Replay: SDK Recording parameters and API #63248

Open
6 tasks
Tracked by #70065
bruno-garcia opened this issue Jan 16, 2024 · 0 comments
Open
6 tasks
Tracked by #70065

Mobile Session Replay: SDK Recording parameters and API #63248

bruno-garcia opened this issue Jan 16, 2024 · 0 comments
Assignees

Comments

@bruno-garcia
Copy link
Member

bruno-garcia commented Jan 16, 2024

This ticket defines some aspects of recording a mobile app and supporting data/context to send to Sentry:
It serves to track what parameters we will need and to align between iOS and Android.

Recording parameters and Options

These parameters/options might not be public, but we'll use these to control or adjust video quality, size and recording overhead.

Let's not put this into SentryOptions directly, but create a new nested object SessionReplayOptions which contains all of these params. SentryOptions then holds a ref to this nested object (sentryOptions.setSessionReplayOptions(replayOptions)).

Public options:

  • sessionReplay.sessionSampleRate: float - sample rate
  • sessionReplay.errorSampleRate: float - If the entire session is not sampled, use the sample rate to sample sessions when an error occurs.
  • quality: high|medium|low - for later, predefined quality options that change bitrate, resolution, maybe mimeType under the hood

Masking:

We'll redact all text input controls, WebView, labels, images (except when loaded from the bundle), custom controls by default.

  • Provide a way to pause/resume recording for certain screens (E.g. a PIN-code screen we cannot really redact properly). It should probably be a top-level API of the static class (Sentry.resumeSessionReplay/Sentry.pauseSessionReplay)
    • Let's bring this up with frontend/backend, because there will be gaps between replay segments. Maybe we could add new RREvent types or breadcrumbs indicating the replay was paused/resumed to surface this in the frontend.
  • Provide a way to redact views based on their class name. We should do that on SDK init - register a list of classes that you know are sensitive from the beginning. sessionReplayOptions.addClassForMasking(), name TBD
  • Provide a way to redact specific view instances. Via an extension property/function on iOS and Kotlin Android, e.g. sampleView.sentryBlock = true|false
    • On Android we could also use view.setTag("sentry-block|unblock").
    • In case of Java, extension property wouldn't work so we probably need to call to Sentry static class, maybe let's not do it in the first version

Internal/Private Recording options:

  • frameRate: float: Screenshot every N seconds, default is 1, 0.5 is a valid option
  • bitRate: int: The quality of the 'video', defaults to 20.
  • mimeType: enum: h264 - let's always hardcode it to h264
  • height: Used on Android. The height of the video. Width adjusts proportionally. Default 720. This might depend on device it runs.
  • scaling: Used on iOS and Android. Default 1x that means,for an iPhone 15 Pro, the video is 320x840
@bruno-garcia bruno-garcia changed the title Mobile Session Replay: SDK Recording parameters Mobile Session Replay: SDK Recording parameters and API May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants