# Koa | Sentry for Node.js

For more information on setting up Sentry Koa support, see the [Koa Sentry documentation](https://docs.sentry.io/platforms/javascript/guides/koa.md).

This integration only works in the Node.js and Bun runtimes.

*Import name: `Sentry.koaIntegration`*

This integration is enabled by default when performance monitoring is enabled. If you'd like to modify your default integrations, read [this](https://docs.sentry.io/.md#modifying-default-integrations).

The `koaIntegration` adds instrumentation for the Koa framework to capture spans using [`@opentelemetry/instrumentation-koa`](https://www.npmjs.com/package/@opentelemetry/instrumentation-koa.md).

```JavaScript
Sentry.init({
  integrations: [Sentry.koaIntegration()],
});
```

## [Options](https://docs.sentry.io/.md#options)

### [`ignoreLayersType`](https://docs.sentry.io/.md#ignorelayerstype)

Requires SDK version `9.29.0` or higher.

*Type: `Array<'middleware' | 'router'>`*

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.

```javascript
// To ignore middleware spans
const Sentry = require("@sentry/node");

Sentry.init({
  integrations: [
    Sentry.koaIntegration({
      ignoreLayersType: ["middleware"],
    }),
  ],
});
```

## [Supported Versions](https://docs.sentry.io/.md#supported-versions)

* `koa`: `^2.0.0`
* `@koa/router`: `>=8`
