-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat: add flutter replay docs #11611
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,101 @@ | ||||||||||||||||
| --- | ||||||||||||||||
| title: Set Up Session Replay | ||||||||||||||||
| 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-dart/issues/new?template=BUG_REPORT.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 [product docs](/product/explore/session-replay/). | ||||||||||||||||
|
|
||||||||||||||||
| ## Pre-requisites | ||||||||||||||||
|
|
||||||||||||||||
| Make sure your Sentry Flutter SDK version is at least 8.9.0, which is required for Session Replay. | ||||||||||||||||
| You can update your `pubspec.yaml` to the matching version: | ||||||||||||||||
|
Comment on lines
+20
to
+23
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
that doesn't work here as below is not an executable script. It's a snippet of the configuration file and they already would have the |
||||||||||||||||
|
|
||||||||||||||||
| ```yaml | ||||||||||||||||
| dependencies: | ||||||||||||||||
| sentry_flutter: ^8.9.0 | ||||||||||||||||
| ``` | ||||||||||||||||
| ## Set Up | ||||||||||||||||
vaind marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||||||||
| To set up the integration, add the following to your Sentry initialization. | ||||||||||||||||
vaind marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||||||||
| ```dart | ||||||||||||||||
| await SentryFlutter.init( | ||||||||||||||||
| (options) { | ||||||||||||||||
| ... | ||||||||||||||||
| options.experimental.replay.sessionSampleRate = 1.0; | ||||||||||||||||
| options.experimental.replay.onErrorSampleRate = 1.0; | ||||||||||||||||
| }, | ||||||||||||||||
| appRunner: () => runApp(MyApp()), | ||||||||||||||||
| ); | ||||||||||||||||
| ``` | ||||||||||||||||
|
|
||||||||||||||||
| ## Verify | ||||||||||||||||
|
|
||||||||||||||||
| While you're testing, we recommend that you set <PlatformIdentifier name="replays-session-sample-rate" /> 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 <PlatformIdentifier name="replays-on-error-sample-rate" /> 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. <PlatformIdentifier name="replays-session-sample-rate" /> - The sample rate for | ||||||||||||||||
| replays that begin recording immediately and last the entirety of the user's session. | ||||||||||||||||
vaind marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||||||||
| 2. <PlatformIdentifier name="replays-on-error-sample-rate" /> - 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. <PlatformIdentifier name="replays-session-sample-rate" /> is evaluated first. If it's sampled, the replay recording will begin. Otherwise, <PlatformIdentifier name="replays-on-error-sample-rate" /> 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. | ||||||||||||||||
|
|
||||||||||||||||
vaind marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||||||||
| ## Privacy | ||||||||||||||||
|
|
||||||||||||||||
| The SDK is recording and aggressively redacting (masking) all text and images, according to the configuration in `options.experimental.replay`. | ||||||||||||||||
| You can tune this and add custom masking rules to fit your needs. For example, you can explicitly mask or unmask widgets by type, | ||||||||||||||||
| or you can even have a callback to decide whether a specific widget instance should be masked: | ||||||||||||||||
|
|
||||||||||||||||
| ```dart | ||||||||||||||||
| options.experimental.replay.mask<IconButton>(); | ||||||||||||||||
| options.experimental.replay.unmask<Image>(); | ||||||||||||||||
| options.experimental.replay.maskCallback<Text>( | ||||||||||||||||
| (Element element, Text widget) => | ||||||||||||||||
| (widget.data?.contains('secret') ?? false) | ||||||||||||||||
| ? SentryMaskingDecision.mask | ||||||||||||||||
| : SentryMaskingDecision.continueProcessing); | ||||||||||||||||
| ``` | ||||||||||||||||
|
|
||||||||||||||||
| You can find more details in respective methods' code documentation. | ||||||||||||||||
vaind marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||||||||
|
|
||||||||||||||||
| <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-dart/issues/new?template=BUG_REPORT.yml). | ||||||||||||||||
|
|
||||||||||||||||
vaind marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||||||||
| </Note> | ||||||||||||||||
|
|
||||||||||||||||
| To disable redaction altogether (not to be used on applications with sensitive data): | ||||||||||||||||
|
|
||||||||||||||||
| ```dart | ||||||||||||||||
| options.experimental.replay.maskAllText = false; | ||||||||||||||||
| options.experimental.replay.maskAllImages = false; | ||||||||||||||||
| ``` | ||||||||||||||||
|
|
||||||||||||||||
| ## Error Linking | ||||||||||||||||
|
|
||||||||||||||||
| Errors that happen 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. | ||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.