LocalVariables

Add local variables to exception frames. (default)

Import name: Sentry.localVariablesIntegration

This integration is enabled by default. If you'd like to modify your default integrations, read this.

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

Copied
Sentry.init({
  includeLocalVariables: true,
});

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.

Type: boolean

Defaults to true. If enabled, local variables are captured for both caught and uncaught exceptions.

  • When false, only uncaught exceptions will have local variables
  • When true, both caught and uncaught exceptions will have local variables.

Capturing local variables for all exceptions can be expensive since the debugger pauses for every throw to collect local variables.

To reduce the likelihood of this feature impacting app performance or throughput, this feature is rate-limited. Once the rate limit is reached, local variables will only be captured for uncaught exceptions until a timeout has been reached.

Type: number

The maximum number of exceptions to capture local variables for per second before rate limiting is triggered.

Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").