-
-
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 Mobile Session Replay Beta 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: | ||
|
|
||
| ```yaml | ||
| dependencies: | ||
| sentry_flutter: ^8.9.0 | ||
| ``` | ||
|
|
||
| ## Setup | ||
|
|
||
| To set up the integration, add the following to your Sentry initialization: | ||
|
|
||
| ```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 a user's session. | ||
| 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 starts as soon as a session begins. The <PlatformIdentifier name="replays-session-sample-rate" /> is then evaluated. If the session is sampled, replay recording will start immediately. If not, <PlatformIdentifier name="replays-on-error-sample-rate" /> will be evaluated. If the session is sampled at this point, the replay will be buffered and will only be uploaded to Sentry if an error occurs. | ||
|
|
||
| ## 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 the documentation for each method. | ||
|
|
||
| <Note> | ||
|
|
||
| If you find that data isn't being redacted with the default settings, please let us know by creating a [GitHub issue](https://github.com/getsentry/sentry-dart/issues/new?template=BUG_REPORT.yml). | ||
|
|
||
| </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. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The 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
sentry_flutterdependency added - they just need to make sure they have the minimum version with replay available.