Const
Adds Sentry tracing instrumentation for Koa.
If you also want to capture errors, you need to call setupKoaErrorHandler(app) after you set up your Koa server.
setupKoaErrorHandler(app)
For more information, see the koa documentation.
Optional
Configuration options for the Koa integration.
const Sentry = require('@sentry/node');Sentry.init({ integrations: [Sentry.koaIntegration()],}) Copy
const Sentry = require('@sentry/node');Sentry.init({ integrations: [Sentry.koaIntegration()],})
// To ignore middleware spansconst Sentry = require('@sentry/node');Sentry.init({ integrations: [ Sentry.koaIntegration({ ignoreLayersType: ['middleware'] }) ],}) Copy
// To ignore middleware spansconst Sentry = require('@sentry/node');Sentry.init({ integrations: [ Sentry.koaIntegration({ ignoreLayersType: ['middleware'] }) ],})
Adds Sentry tracing instrumentation for Koa.
If you also want to capture errors, you need to call
setupKoaErrorHandler(app)after you set up your Koa server.For more information, see the koa documentation.