Koa

Adds performance instrumentation for Koa. (default)

For more information on setting up Sentry Koa support, see the Koa Sentry documentation.

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.

The koaIntegration adds instrumentation for the Koa framework to capture spans using @opentelemetry/instrumentation-koa.

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

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.

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

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

  • koa: ^2.0.0
  • @koa/router: >=8
Was this helpful?
Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").