Skip to content

Commit 745d362

Browse files
authored
Add instructions on how to support prisma v6 (#12425)
1 parent 336d86a commit 745d362

File tree

1 file changed

+34
-3
lines changed
  • docs/platforms/javascript/common/configuration/integrations

1 file changed

+34
-3
lines changed

docs/platforms/javascript/common/configuration/integrations/prisma.mdx

+34-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ supported:
2424

2525
<Alert>
2626

27-
This integration only works in the Node.js and Bun runtimes. This integration only supports Prisma v5 at the current time. If you're interested in Prisma v6 support, please leave your thoughts on the [Prisma v6 tracking issue for the Sentry SDK](https://github.com/getsentry/sentry-javascript/issues/14793).
27+
This integration only works in the Node.js and Bun runtimes.
2828

2929
</Alert>
3030

@@ -34,7 +34,31 @@ Sentry supports tracing [Prisma ORM](https://www.prisma.io/) queries with the Pr
3434

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

37-
To install the integration, first enable the `tracing` feature flag in the `generator` block of your Prisma schema:
37+
## Prisma Version 6
38+
39+
The Sentry Prisma Integration comes with Prisma version 5 support by default. For Prisma version 6 compatibility we need to pass a specific version of the Prisma instrumentation to the Sentry Prisma integration.
40+
41+
To use the integration with Prisma version 6, first install the `@prisma/instrumentation` package on version 6 (ideally the exact same version as your `prisma` and `@prisma/client` packages).
42+
43+
Then, add the `prismaIntegration` to your Sentry initialization as follows:
44+
45+
```javascript {1,6-9}
46+
import { PrismaInstrumentation } from "@prisma/instrumentation";
47+
48+
Sentry.init({
49+
tracesSampleRate: 1.0,
50+
integrations: [
51+
Sentry.prismaIntegration({
52+
// Override the default instrumentation that Sentry uses
53+
prismaInstrumentation: new PrismaInstrumentation(),
54+
}),
55+
],
56+
});
57+
```
58+
59+
## Prisma Version 5
60+
61+
To install the integration for Prisma version 5, first enable the `tracing` feature flag in the `generator` block of your Prisma schema:
3862

3963
```txt {tabTitle: Prisma Schema} {filename: schema.prisma} {3}
4064
generator client {
@@ -52,7 +76,14 @@ Sentry.init({
5276
});
5377
```
5478

79+
## Options
80+
81+
### `prismaInstrumentation`
82+
83+
_Type: `Instrumentation`_ (An OpenTelemetry type)
84+
85+
Overrides the instrumentation used by the Sentry SDK with the passed in instrumentation instance.
5586

5687
## Supported Versions
5788

58-
- `prisma`: `>=5 <6`
89+
- `prisma`: `>=5`

0 commit comments

Comments
 (0)