-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'getsentry:master' into unreal-engine
- Loading branch information
Showing
25 changed files
with
699 additions
and
533 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -21,7 +21,7 @@ | |
"@radix-ui/react-icons": "^1.3.0", | ||
"@radix-ui/react-toolbar": "^1.0.4", | ||
"@radix-ui/themes": "^2.0.3", | ||
"@sentry/nextjs": "8.34.0", | ||
"@sentry/nextjs": "8.36.0-beta.0", | ||
"@spotlightjs/spotlight": "^2.1.1", | ||
"next": "15.0.0-rc.1", | ||
"next-auth": "^4.24.5", | ||
|
@@ -63,4 +63,4 @@ | |
"@types/react": "npm:[email protected]", | ||
"@types/react-dom": "npm:[email protected]" | ||
} | ||
} | ||
} |
This file contains 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 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 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 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 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 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 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
104 changes: 104 additions & 0 deletions
104
docs/platforms/javascript/guides/nuxt/features/pinia.mdx
This file contains 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,104 @@ | ||
--- | ||
title: Pinia | ||
description: "Learn about enabling Sentry's Pinia plugin in Nuxt." | ||
--- | ||
|
||
To capture [Pinia](https://pinia.vuejs.org/) state data, add `trackPinia` to your client-side Sentry configuration: | ||
|
||
```javascript {3} {filename:sentry.client.config.ts} | ||
Sentry.init({ | ||
dsn: "___PUBLIC_DSN___", | ||
trackPinia: true // `true` will apply default options | ||
}); | ||
``` | ||
|
||
## Normalization Depth | ||
|
||
By default, Sentry SDKs normalize any context to a depth of 3. You may want to increase this for sending Pinia states by passing `normalizeDepth` to the `Sentry.init` call: | ||
|
||
```javascript {4} {filename:sentry.client.config.ts} | ||
Sentry.init({ | ||
dsn: "___PUBLIC_DSN___", | ||
trackPinia: true, | ||
normalizeDepth: 10, // Or however deep you want your state context to be. | ||
}); | ||
``` | ||
|
||
## Options | ||
|
||
When enabling `trackPinia` with `true`, all default options are automatically applied. To configure the Pinia plugin manually, pass an options object to `trackPinia`. | ||
|
||
<Alert level="warning" title="Note"> | ||
|
||
While we try our best to filter out Personally Identifiable Information (PII) such as user passwords, we advise against sending sensitive information to Sentry. | ||
|
||
</Alert> | ||
|
||
|
||
### `attachPiniaState` (Boolean) | ||
|
||
This is used to attach Pinia state to Sentry events. By default, this is set to `true`. If you don't want to attach Pinia state to events being sent to Sentry, set this to `false`: | ||
|
||
```javascript {2} {filename:sentry.client.config.ts} | ||
trackPinia: { | ||
attachPiniaState: false | ||
} | ||
``` | ||
|
||
### `addBreadcrumbs` (Boolean) | ||
|
||
This is used to add breadcrumbs to Sentry events. By default, this is set to `true`. If you don't want to add breadcrumbs to events being sent to Sentry, set this to `false`: | ||
|
||
```javascript {2} {filename:sentry.client.config.ts} | ||
trackPinia: { | ||
addBreadcrumbs: false | ||
} | ||
``` | ||
|
||
### `actionTransformer` (Function) | ||
|
||
This can be used to remove sensitive information from Pinia actions. The first parameter passed to the function is the Pinia action name. We send all actions by default, if you don't want an action name sent to Sentry, use `return null`: | ||
|
||
```javascript {2-9} {filename:sentry.client.config.ts} | ||
trackPinia: { | ||
actionTransformer: (action) => { | ||
if (action === "GOVERNMENT_SECRETS") { | ||
// Return null to not log the action to Sentry | ||
return null; | ||
} | ||
|
||
return action; | ||
}, | ||
} | ||
``` | ||
|
||
### `stateTransformer` (Function) | ||
|
||
This is used to remove sensitive information from a Pinia state. The first parameter passed to the function is the Pinia state. We attach all state changes by default. If you don't want to attach state changes to events being sent to Sentry, use `return null`. Note, that if you choose not to send state to Sentry, your errors might not have the latest version attached: | ||
|
||
```javascript {2-23} {filename:sentry.client.config.ts} | ||
trackPinia: { | ||
stateTransformer: (state) => { | ||
if (state.topSecret.doNotSend) { | ||
// Return null to not send this version of the state. | ||
return null; | ||
} | ||
|
||
// Transform the state to remove sensitive information | ||
const transformedState = { | ||
...state, | ||
topSecret: { | ||
...state.topSecret, | ||
// Replace sensitive information with something else | ||
nuclearLaunchCodes: "I love pizza", | ||
// or just remove it entirely | ||
hiddenTreasureLocation: null, | ||
}, | ||
// You should also remove large data that is irrelevant to debugging to not clutter your Sentry issues | ||
giganticState: null, | ||
}; | ||
|
||
return transformedState; | ||
}, | ||
} | ||
``` |
Oops, something went wrong.