Skip to content

Commit e311ea8

Browse files
authored
feat(node): Add docs for skipping instrumentation (#10803)
1 parent a715187 commit e311ea8

File tree

1 file changed

+16
-0
lines changed
  • docs/platforms/javascript/common/install

1 file changed

+16
-0
lines changed

docs/platforms/javascript/common/install/esm.mdx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,19 @@ NODE_OPTIONS="--import ./instrument.mjs" npm run start
4848
```
4949

5050
We do not support ESM in Node versions before 18.19.0.
51+
52+
## Skipping instrumentation
53+
54+
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:
55+
56+
```javascript {tabTitle:ESM} {filename: instrument.mjs}
57+
import * as Sentry from "@sentry/node";
58+
59+
Sentry.init({
60+
dsn: "___PUBLIC_DSN___",
61+
registerEsmLoaderHooks: {
62+
// Provide a list of package names to exclude from instrumentation
63+
exclude: ["package-name"],
64+
},
65+
});
66+
```

0 commit comments

Comments
 (0)