Default Integrations
System integrations are integrations enabled by default that hook into the standard library or the interpreter itself. They're documented so you can see what they do and know how to disable them if they cause issues.
To disable all default integrations, set defaultIntegrations: false
when calling init()
.
To disable one or more of the default integrations, pass in a function to the
integrations
option when calling init()
. The function should take an array
of default integrations and return a filtered array, excluding the integrations
you do not want to use.
For example, to disable the Console
integration:
integrations: defaults => defaults.filter(integration => integration.name !== 'Console')
.
To override an integration's settings, provide a new instance to the integrations
option when calling init()
.
For example, to change the fatal error handler:
integrations: [new Sentry.Integrations.OnUncaughtException({ onFatalError: () => { /** your implementation */ } })]
.
Core
InboundFilters
Import name: Sentry.Integrations.InboundFilters
This integration allows developers to ignore specific errors based on the error message or the URL from which the exception originated.
To configure it, use the ignoreErrors
, denyUrls
, and allowUrls
SDK options directly.
(Keep in mind that denyUrls
and allowUrls
only work for captured exceptions, not raw message events.)
FunctionToString
Import name: Sentry.Integrations.FunctionToString
This integration allows the SDK to provide original function and method names, even when those functions or methods are wrapped by our error or breadcrumb handlers.
Node-specific
Console
Import name: Sentry.Integrations.Console
This integration wraps the console
module in order to record all of its calls as breadcrumbs.
Http
Import name: Sentry.Integrations.Http
This integration wraps http
and https
modules to capture all network requests as breadcrumbs and/or tracing spans.
Available options:
{
breadcrumbs: boolean; // default: true
tracing: boolean; // default: false
}
OnUncaughtException
Import name: Sentry.Integrations.OnUncaughtException
This integration attaches a global uncaught exception handler. It can be modified to provide a custom shutdown function.
The onFatalError
option is meant to perform a cleanup before the process exits, not fully prevent it from exiting.
Note
Be aware that if you overwrite this setting, you will lose the default implementation, which handles draining queued events before exiting. If you want to examine how it works in order to be able to recreate it in your code, see the implementation of the logAndExitProcess
function.
Available options:
{
onFatalError: (firstError: Error, secondError?: Error) => void;
}
OnUnhandledRejection
Import name: Sentry.Integrations.OnUnhandledRejection
This integration attaches a global unhandled rejection handler. By default, all unhandled rejections trigger a warning and log the error. You can change this behavior using the mode
option, which is in line with Node's CLI options: https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode.
Available options:
{
mode: "none" | "warn" | "strict"; // default: "warn"
}
LinkedErrors
Import name: Sentry.Integrations.LinkedErrors
This integration allows you to configure linked errors. They'll be recursively read up to a specified limit and lookup will be performed by a specific key. By default, the limit is set to 5 and the key used is "cause"
.
Available options:
{
key: string; // default: "cause"
limit: number; // default: 5
}
- Package:
- npm:@sentry/node
- Version:
- 8.24.0
- Repository:
- https://github.com/getsentry/sentry-javascript