Skip to content

Commit

Permalink
feat(node): Add docs for skipping instrumentation (#10803)
Browse files Browse the repository at this point in the history
  • Loading branch information
mydea committed Jul 23, 2024
1 parent a715187 commit e311ea8
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docs/platforms/javascript/common/install/esm.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,19 @@ NODE_OPTIONS="--import ./instrument.mjs" npm run start
```

We do not support ESM in Node versions before 18.19.0.

## Skipping instrumentation

By default, all packages are wrapped under the hood by [import-in-the-middle](https://www.npmjs.com/package/import-in-the-middle). If you run into a problem with a package, you can skip instrumentation for it by configuring `registerEsmLoaderHooks` in your `Sentry.init()` config:

```javascript {tabTitle:ESM} {filename: instrument.mjs}
import * as Sentry from "@sentry/node";

Sentry.init({
dsn: "___PUBLIC_DSN___",
registerEsmLoaderHooks: {
// Provide a list of package names to exclude from instrumentation
exclude: ["package-name"],
},
});
```

0 comments on commit e311ea8

Please sign in to comment.