Sentry.init({ integrations: [ prismaIntegration({ // Override the default instrumentation that Sentry uses prismaInstrumentation:newPrismaInstrumentation() }) ] })
The passed instrumentation instance will override the default instrumentation instance the integration would use, while the prismaIntegration will still ensure data compatibility for the various Prisma versions.
Depending on your Prisma version (prior to version 6), add previewFeatures = ["tracing"] to the client generator block of your Prisma schema:
Adds Sentry tracing instrumentation for the prisma library. For more information, see the
prismaIntegrationdocumentation.NOTE: By default, this integration works with Prisma version 6. To get performance instrumentation for other Prisma versions,
Install the
@prisma/instrumentationpackage with the desired version.Pass a
new PrismaInstrumentation()instance as exported from@prisma/instrumentationto theprismaInstrumentationoption of this integration:The passed instrumentation instance will override the default instrumentation instance the integration would use, while the
prismaIntegrationwill still ensure data compatibility for the various Prisma versions.Depending on your Prisma version (prior to version 6), add
previewFeatures = ["tracing"]to the client generator block of your Prisma schema: