Skip to content

feat: mobile replay beta #10711

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

Merged
merged 17 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,10 @@

# ###### Replays #######

# /src/docs/product/session-replay/ @getsentry/replay
# /src/includes/feature-stage-beta-session-replay.mdx @getsentry/replay
# /src/platform-includes/session-replay/ @getsentry/replay @getsentry/replay-sdk-web
# /src/platforms/javascript/common/session-replay/ @getsentry/replay @getsentry/replay-sdk-web
# /src/wizard/javascript/replay-onboarding/ @getsentry/replay @getsentry/replay-sdk-web
# /src/docs/product/session-replay/ @getsentry/replay
# /src/includes/session-replay-web-report-bug.mdx @getsentry/replay
# /src/platform-includes/session-replay/ @getsentry/replay @getsentry/replay-sdk-web
# /src/platforms/javascript/common/session-replay/ @getsentry/replay @getsentry/replay-sdk-web
# /src/wizard/javascript/replay-onboarding/ @getsentry/replay @getsentry/replay-sdk-web

# ###### End Replays #######

120 changes: 120 additions & 0 deletions docs/platforms/android/session-replay/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
---
title: Set Up Session Replay - Beta
sidebar_order: 5500
notSupported:
description: "Learn how to enable the Beta of Mobile Session Replay in your app."
---

<Note>

Mobile support for Session Replay is in Beta. Features available in Beta are still work-in-progress and may have bugs. We recognize the irony.

If you have any questions, feedback or would like to report a bug, please open a [GitHub issue](https://github.com/getsentry/sentry-java/issues/new?assignees=&labels=Platform%3A+Android%2CType%3A+Bug&projects=&template=bug_report_android.yml) with a link to a relevant replay in Sentry if possible.

</Note>

[Session Replay](/product/explore/session-replay/) helps you get to the root cause of an error or latency issue faster by providing you with a reproduction of what was happening in the user's device before, during, and after the issue. You can rewind and replay your application's state and see key user interactions, like taps, swipes, network requests, and console entries, in a single UI.

By default, our Session Replay SDK masks all text content, images, and user input, giving you heightened confidence that no sensitive data will leave the device. To learn more, see <PlatformLink to="/product/session-replay/">Session Replay Product docs</PlatformLink>.

## Pre-requisites

Make sure your Sentry Android SDK version is at least 7.12.0.

## Install

The easiest way to update through the Sentry Android Gradle plugin to your app module's `build.gradle` file.

```groovy {filename:app/build.gradle}
plugins {
id "com.android.application"
id "io.sentry.android.gradle" version "{{@inject packages.version('sentry.java.android.gradle-plugin', '4.10.0') }}"
}
```

```kotlin {filename:app/build.gradle.kts}
plugins {
id("com.android.application")
id("io.sentry.android.gradle") version "{{@inject packages.version('sentry.java.android.gradle-plugin', '4.10.0') }}"
}
```

If you have the SDK installed without the Sentry Gradle Plugin, you can update the version directly in the `build.gradle` through:
```groovy {filename:app/build.gradle}
dependencies {
implementation 'io.sentry:sentry-android:{{@inject packages.version('sentry.java.android', '7.12.0') }}'
}
```

```kotlin {filename:app/build.gradle.kts}
dependencies {
implementation("io.sentry:sentry-android:{{@inject packages.version('sentry.java.android', '7.12.0') }}")
}
```

## Set Up

To set up the integration, add the following to your Sentry initialization.

```kotlin
SentryAndroid.init(context) { options ->
options.dsn = "___PUBLIC_DSN___"
options.isDebug = true

// Currently under experimental options:
options.experimental.sessionReplay.errorSampleRate = 1.0
options.experimental.sessionReplay.sessionSampleRate = 1.0
}
```

```xml {filename:AndroidManifest.xml}
<meta-data android:name="io.sentry.session-replay.error-sample-rate" android:value="1.0" />
<meta-data android:name="io.sentry.session-replay.session-sample-rate" android:value="1.0" />
```

<SignInNote />

## Verify

While you're testing, we recommend that you set `sessionSampleRate` to `1.0`. This ensures that every user session will be sent to Sentry.

Once testing is complete, **we recommend lowering this value in production**. We still recommend keeping `errorSampleRate` set to `1.0`.

## Sampling

Sampling allows you to control how much of your website's traffic will result in a Session Replay. There are two sample rates you can adjust to get the replays relevant to you:

1. `sessionSampleRate` - The sample rate for
replays that begin recording immediately and last the entirety of the user's session.
2. `errorSampleRate` - The sample rate for
replays that are recorded when an error happens. This type of replay will record
up to a minute of events prior to the error and continue recording until the session
ends.

Sampling begins as soon as a session starts. `sessionSampleRate` is evaluated first. If it's sampled, the replay recording will begin. Otherwise, `errorSampleRate` is evaluated and if it's sampled, the integration will begin buffering the replay and will only upload it to Sentry if an error occurs. The remainder of the replay will behave similarly to a whole-session replay.

## Privacy

The SDK is recording and aggressively redacting all text and images. We plan to add fine controls for redacting, but in this version, we just allow either on or off. The default is on. Please don’t turn it off if you have sensitive data in your app. Before the Beta is complete, we'll give you the controls you need.

<Note>

Jetpack Compose views are not yet redacted. This is being [tracked here](https://github.com/getsentry/sentry-java/issues/3577).
If you encounter any other data not being redacted with the default settings, please let us know through a [GitHub issue](https://github.com/getsentry/sentry-java/issues/new?assignees=&labels=Platform%3A+Android%2CType%3A+Bug&projects=&template=bug_report_android.yml).

</Note>

To disable redaction altogether (not to be used on applications with sensitive data):

```kotlin
options.experimental.sessionReplay.redactAllText = false
options.experimental.sessionReplay.redactAllImages = false
```

## Error Linking

Errors that happen on the page while a replay is running will be linked to the replay, making it possible to jump between related issues and replays. However, it's **possible** that in some cases the error count reported on the **Replays Details** page won't match the actual errors that have been captured. That's because errors can be lost, and while this is uncommon, there are a few reasons why it could happen:

- The replay was rate-limited and couldn't be accepted.
- The replay was deleted by a member of your org.
- There were network errors and the replay wasn't saved.
98 changes: 98 additions & 0 deletions docs/platforms/apple/guides/ios/session-replay/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
---
title: Set Up Session Replay - Beta
sidebar_order: 5500
notSupported:
description: "Learn how to enable the Beta of Mobile Session Replay in your app."
---

<Note>

Mobile support for Session Replay is in Beta. Features available in Beta are still work-in-progress and may have bugs. We recognize the irony.

If you have any questions, feedback or would like to report a bug, please open a [GitHub issue](https://github.com/getsentry/sentry-cocoa/issues/new?assignees=&labels=Platform%3A+Cocoa%2CType%3A+Bug&projects=&template=bug.yml) with a link to a relevant replay in Sentry if possible.

</Note>

[Session Replay](/product/explore/session-replay/) helps you get to the root cause of an error or latency issue faster by providing you with a reproduction of what was happening in the user's device before, during, and after the issue. You can rewind and replay your application's state and see key user interactions, like taps, swipes, network requests, and console entries, in a single UI.

By default, our Session Replay SDK masks all text content, images, and user input, giving you heightened confidence that no sensitive data will leave the device. To learn more, see <PlatformLink to="/product/session-replay/">Session Replay Product docs</PlatformLink>.

## Pre-requisites

Make sure your Sentry Cocoa SDK version is at least 8.31.1

## Install

If you already have the SDK installed, you can update it to the latest version with:

```swift {tabTitle:SPM}
.package(url: "https://github.com/getsentry/sentry-cocoa", from: "{{@inject packages.version('sentry.cocoa') }}"),
```
```ruby {tabTitle:Cocoapods}
pod update
```
```ruby {tabTitle:Carthage}
github "getsentry/sentry-cocoa" "{{@inject packages.version('sentry.cocoa') }}"
```


## Set Up

To set up the integration, add the following to your Sentry initialization.

```swift
SentrySDK.start(configureOptions: { options in
options.dsn = "___PUBLIC_DSN___"
options.debug = true

// Currently under experimental options:
options.experimental.sessionReplay.errorSampleRate = 1.0
options.experimental.sessionReplay.sessionSampleRate = 1.0
})
```

<SignInNote />

## Verify

While you're testing, we recommend that you set `sessionSampleRate` to `1.0`. This ensures that every user session will be sent to Sentry.

Once testing is complete, **we recommend lowering this value in production**. We still recommend keeping `errorSampleRate` set to `1.0`.

## Sampling

Sampling allows you to control how much of your website's traffic will result in a Session Replay. There are two sample rates you can adjust to get the replays relevant to you:

1. `sessionSampleRate` - The sample rate for
replays that begin recording immediately and last the entirety of the user's session.
2. `errorSampleRate` - The sample rate for
replays that are recorded when an error happens. This type of replay will record
up to a minute of events prior to the error and continue recording until the session
ends.

Sampling begins as soon as a session starts. `sessionSampleRate` is evaluated first. If it's sampled, the replay recording will begin. Otherwise, `errorSampleRate` is evaluated and if it's sampled, the integration will begin buffering the replay and will only upload it to Sentry if an error occurs. The remainder of the replay will behave similarly to a whole-session replay.

## Privacy

The SDK is recording and aggressively redacting all text and images. We plan to add fine controls for redacting, but in this version, we just allow either on or off. The default is on. Please don’t turn it off if you have sensitive data in your app. Before the Beta is complete, we'll give you the controls you need.

<Note>

If you encounter any data not being redacted with the default settings, please let us know through a [GitHub issue](https://github.com/getsentry/sentry-cocoa/issues/new?assignees=&labels=Platform%3A+Cocoa%2CType%3A+Bug&projects=&template=bug.yml).

</Note>

To disable redaction altogether (not to be used on applications with sensitive data):

```swift
options.experimental.sessionReplay.redactAllText = true
options.experimental.sessionReplay.redactAllImages = true
```

## Error Linking

Errors that happen on the page while a replay is running will be linked to the replay, making it possible to jump between related issues and replays. However, it's **possible** that in some cases the error count reported on the **Replays Details** page won't match the actual errors that have been captured. That's because errors can be lost, and while this is uncommon, there are a few reasons why it could happen:

- The replay was rate-limited and couldn't be accepted.
- The replay was deleted by a member of your org.
- There were network errors and the replay wasn't saved.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ notSupported:
description: "Learn about the general Session Replay configuration fields."
---

<Include name="feature-stage-beta-session-replay.mdx" />
<Include name="session-replay-web-report-bug.mdx" />

## General Integration Configuration

Expand Down
2 changes: 1 addition & 1 deletion docs/platforms/javascript/common/session-replay/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ notSupported:
description: "Learn how to enable Session Replay in your app if it is not already set up."
---

<Include name="feature-stage-beta-session-replay.mdx" />
<Include name="session-replay-web-report-bug.mdx" />

[Session Replay](/product/explore/session-replay/) helps you get to the root cause of an error or latency issue faster by providing you with a video-like reproduction of what was happening in the user's browser before, during, and after the issue. You can rewind and replay your application's DOM state and see key user interactions, like mouse clicks, scrolls, network requests, and console entries, in a single combined UI inspired by your browser's DevTools.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ notSupported:
description: "Configuring Session Replay to maintain user and data privacy."
---

<Include name="feature-stage-beta-session-replay.mdx" />
<Include name="session-replay-web-report-bug.mdx" />

There are several ways to deal with personally identifiable information (PII). By default, the Session Replay SDK will mask all text content with `*` and block all media elements (`img`, `svg`, `video`, `object`, `picture`, `embed`, `map`, `audio`) on the client, before it is sent to the server. This can be disabled by setting `maskAllText` to `false`. It's also possible to add the following CSS classes to specific DOM elements to prevent recording their contents: `sentry-block`, `sentry-ignore`, and `sentry-mask`. The following sections will show examples of how content is handled by the differing methods.

Expand Down
Loading
Loading