Automatic Instrumentation

Learn what transactions are captured after tracing is enabled.

When performance is enabled through tracesSampleRate, enableTracing or a tracesSampler function, the Sentry SDK will automatically capture spans for the following:

  • Routes & middlewares
  • HTTP requests made with:
    • http
    • https
    • fetch
  • DB queries made with:
    • mysql
    • mysql2
    • pg
    • graphql (including Apollo Server)
    • mongo
    • mongoose
    • ioredis

All of these are automatically set up for you without any further configuration. The only exception is Prisma, which you have to opt-in for:

Copied
const Sentry = require('@sentry/node');

Sentry.init({
  dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0',
  tracesSampleRate: 1.0,
  integrations: [Sentry.prismaIntegration()],
});
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").