Automatic Instrumentation

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

  • Fastify routes & middlewares
  • HTTP requests made with http, https and fetch
  • DB queries made with:
    • mysql
    • mysql2
    • pg
    • graphql (including Apollo Server)
    • mongo
    • mongoose
    • prisma

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").