Skip to content

Commit cc46d56

Browse files
authored
feat(js): Update docs for prisma integration (#14876)
Once getsentry/sentry-javascript#17595 is merged support will be even better, but even today passing the `prismaInstrumentation` will actually fail, so not doing it is better even if some spans are missing. Also updating the docs to reflect that this is enabled by default now.
1 parent 56afeb2 commit cc46d56

File tree

1 file changed

+7
-22
lines changed
  • docs/platforms/javascript/common/configuration/integrations

1 file changed

+7
-22
lines changed

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

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Prisma
3-
description: "Adds instrumentation for Prisma."
3+
description: "Adds instrumentation for Prisma. (default)"
44
supported:
55
- javascript.node
66
- javascript.aws-lambda
@@ -36,13 +36,13 @@ Sentry supports tracing [Prisma ORM](https://www.prisma.io/) queries with the Pr
3636

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

39-
This integration is enabled by default when using Prisma version 6 or higher.
40-
When using Prisma version 5 this integration requires additional setup, which you can read about below.
39+
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.
40+
4141
If you'd like to learn how to modify your default integrations, visit the docs on <PlatformLink to="/configuration/integrations/#modifying-default-integrations">Modifying Default Integrations</PlatformLink>.
4242

4343
## Prisma Version >=6
4444

45-
To use the integration with Prisma version >=6, add the `prismaIntegration` to your Sentry initialization as follows:
45+
To use the integration with Prisma version >=6, no configuration is required - tracing in Prisma v6 is enabled by default.
4646

4747
```javascript {3}
4848
Sentry.init({
@@ -62,30 +62,15 @@ generator client {
6262
}
6363
```
6464

65-
For Prisma version 5 compatibility you must pass a specific version of the Prisma instrumentation to the Sentry Prisma integration. Add the `prismaIntegration` to your Sentry initialization as follows:
66-
67-
```javascript {1,6-9}
68-
import { PrismaInstrumentation } from "@prisma/instrumentation";
65+
Then, the `prismaIntegration` will automatically capture spans for Prisma queries.
6966

67+
```javascript {3}
7068
Sentry.init({
7169
tracesSampleRate: 1.0,
72-
integrations: [
73-
Sentry.prismaIntegration({
74-
// Override the default instrumentation that Sentry uses
75-
prismaInstrumentation: new PrismaInstrumentation(),
76-
}),
77-
],
70+
integrations: [Sentry.prismaIntegration()],
7871
});
7972
```
8073

81-
## Options
82-
83-
### `prismaInstrumentation`
84-
85-
_Type: `Instrumentation`_ (An OpenTelemetry type)
86-
87-
Overrides the instrumentation used by the Sentry SDK with the passed in instrumentation instance.
88-
8974
## Supported Versions
9075

9176
- `prisma`: `>=5`

0 commit comments

Comments
 (0)