Prisma

Adds instrumentation for Prisma. (default)

Import name: Sentry.prismaIntegration

Sentry supports tracing Prisma ORM queries with the Prisma integration.

The Prisma Integrations creates a spans for each query and reports to Sentry with relevant details inside thedescription if available.

This integration is enabled by default and supports Prisma versions 5 & 6. In Prisma v5, you need to follow the instructions below to enable tracing.

If you'd like to learn how to modify your default integrations, visit the docs on Modifying Default Integrations.

To use the integration with Prisma version >=6, no configuration is required - tracing in Prisma v6 is enabled by default.

Copied
Sentry.init({
  tracesSampleRate: 1.0,
integrations: [Sentry.prismaIntegration()],
});

To configure the integration for Prisma version 5, first add the tracing feature flag to the generator block of your Prisma schema:

schema.prisma
Copied
generator client {
  provider        = "prisma-client-js"
previewFeatures = ["tracing"]
}

Then, the prismaIntegration will automatically capture spans for Prisma queries.

Copied
Sentry.init({
  tracesSampleRate: 1.0,
integrations: [Sentry.prismaIntegration()],
});

  • prisma: >=5
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").