Skip to content

Commit

Permalink
Add warning about using debuggers with includeLocalVariables (#11138)
Browse files Browse the repository at this point in the history
  • Loading branch information
lforst committed Aug 26, 2024
1 parent 5242d8b commit 8d7426e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ _Import name: `Sentry.localVariablesIntegration`_

This integration is enabled by default. If you'd like to modify your default integrations, read [this](./../#modifying-default-integrations).

This integration captures local variables to exception frames. To enable capturing local variables via the integration, set `includeLocalVariable: true` in the SDK configuration.
This integration captures local variables to exception frames. To enable capturing local variables via the integration, set `includeLocalVariable` to `true` in the SDK configuration.

```JavaScript
Sentry.init({
Expand All @@ -44,12 +44,22 @@ Sentry.init({

The local variables integration only captures local variables from application code (`in_app = true`). Frames of a stacktrace originating from `node_modules` will not have local variables attached to them.

<Alert level="warning">
<Alert level="warning" title="Minified Variables">

Minified local variable names attached to exception frames can't be unminified by Sentry at this time. There's an [active proposal](https://github.com/tc39/source-map/blob/main/proposals/scopes.md) for the sourcemaps spec that will add this capability.

</Alert>

<Alert level="warning" title="Incompatibility with Debuggers">

Setting `includeLocalVariables` to `true` can and will interfere with other debugger sessions attached to the process.
The integration works by briefly pausing execution on thrown exceptions, to collect variables in the scope and then instantly resuming it.
You may therefore examine your breakpoints being skipped over when this integration is active.

It is recommended to set `includeLocalVariables` to `false` when intending to use other debugger sessions.

</Alert>

## Options

### `captureAllExceptions`
Expand Down
6 changes: 5 additions & 1 deletion src/components/docPage/type.scss
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@
font-size: 1rem;
}

p code,
p code {
color: var(--codeColor);
margin: 0 2px;
}

li code {
color: var(--codeColor);
}
Expand Down

0 comments on commit 8d7426e

Please sign in to comment.