Skip to content

Commit 6740ea7

Browse files
AbhiPrasadcursoragent
authored andcommitted
feat: Document ignoreLayersType in koa integration (#14060)
Documents getsentry/sentry-javascript#16553, released with https://github.com/getsentry/sentry-javascript/releases/tag/9.29.0 --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
1 parent d21bc22 commit 6740ea7

File tree

1 file changed

+23
-0
lines changed
  • docs/platforms/javascript/common/configuration/integrations

1 file changed

+23
-0
lines changed

docs/platforms/javascript/common/configuration/integrations/koa.mdx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,29 @@ Sentry.init({
2626
});
2727
```
2828

29+
## Options
30+
31+
### `ignoreLayersType`
32+
33+
Requires SDK version `9.29.0` or higher.
34+
35+
_Type: `Array<'middleware' | 'router'>`_
36+
37+
An array of Koa layer types to ignore when creating spans. This allows you to filter out specific types of middleware or router spans from being sent to Sentry.
38+
39+
```javascript
40+
// To ignore middleware spans
41+
const Sentry = require('@sentry/node');
42+
43+
Sentry.init({
44+
integrations: [
45+
Sentry.koaIntegration({
46+
ignoreLayersType: ['middleware']
47+
})
48+
],
49+
})
50+
```
51+
2952
## Supported Versions
3053

3154
- `koa`: `^2.0.0`

0 commit comments

Comments
 (0)