Skip to content

Commit ec08af8

Browse files
author
Luca Forstner
authored
Improve everything around prisma (#10443)
1 parent fa35a15 commit ec08af8

28 files changed

+81
-208
lines changed

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

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Prisma
3-
description: "Adds instrumentation for Prisma. (default)"
3+
description: "Adds instrumentation for Prisma."
44
supported:
55
- javascript.node
66
- javascript.aws-lambda
@@ -27,4 +27,24 @@ This integration only works in the Node.js and Bun runtimes.
2727

2828
_Import name: `Sentry.prismaIntegration`_
2929

30-
The `prismaIntegration` adds instrumentation for the `prisma` library to capture spans using [`@prisma/instrumentation`](https://www.npmjs.com/package/@prisma/instrumentation).
30+
Sentry supports tracing [Prisma ORM](https://www.prisma.io/) queries with the Prisma integration.
31+
32+
The Prisma Integrations creates a spans for each query and reports to Sentry with relevant details inside `description` if available.
33+
34+
To install the integration, first enable the `tracing` feature flag in the `generator` block of your Prisma schema:
35+
36+
```txt {tabTitle: Prisma Schema} {filename: schema.prisma} {2}
37+
generator client {
38+
provider = "prisma-client-js"
39+
previewFeatures = ["tracing"]
40+
}
41+
```
42+
43+
Then, add the `prismaIntegration` to your Sentry initialization as follows:
44+
45+
```javascript {3}
46+
Sentry.init({
47+
tracesSampleRate: 1.0,
48+
integrations: [Sentry.prismaIntegration()],
49+
});
50+
```

docs/platforms/javascript/common/tracing/database/auto-instrument.mdx

Lines changed: 0 additions & 29 deletions
This file was deleted.

docs/platforms/javascript/common/tracing/database/index.mdx

Lines changed: 0 additions & 37 deletions
This file was deleted.

docs/platforms/javascript/common/tracing/database/opt-in.mdx

Lines changed: 0 additions & 39 deletions
This file was deleted.

docs/platforms/javascript/guides/aws-lambda/tracing/instrumentation/automatic-instrumentation.mdx

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,24 @@ description: "Learn what transactions are captured after tracing is enabled."
44
sidebar_order: 10
55
---
66

7-
When performance is enabled through `tracesSampleRate`, `enableTracing` or a `tracesSampler` function, the Sentry SDK will automatically capture spans for the following:
7+
When performance is enabled through `tracesSampleRate`, `enableTracing` or a `tracesSampler` function, the Sentry SDK will automatically capture spans for incoming requests, and HTTP requests made with:
88

9-
- HTTP requests made with:
10-
- `http`
11-
- `https`
12-
- `fetch`
9+
- `http`
10+
- `https`
11+
- `fetch`
1312

14-
These are automatically set up for you without any further configuration.
13+
Database instrumentation can be manually enabled by adding the corresponding integrations to the `integrations` array in the `init` method. The following packages are supported:
1514

16-
The following instrumentation can be manually enabled by adding the corresponding integration to the `integrations` array in the `init` method:
15+
- `mysql`
16+
- `mysql2`
17+
- `pg`
18+
- `graphql` (including Apollo Server)
19+
- `mongo`
20+
- `mongoose`
21+
- `ioredis`
22+
- `prisma` (requires additional configuration - see <PlatformLink to="/configuration/integrations/prisma/">Prisma Integration</PlatformLink>)
1723

18-
- DB queries made with:
19-
- `mysql`
20-
- `mysql2`
21-
- `pg`
22-
- `graphql` (including Apollo Server)
23-
- `mongo`
24-
- `mongoose`
25-
- `ioredis`
26-
- `prisma`
27-
28-
You can add these as follows:
24+
You can add the integrations as follows:
2925

3026
```javascript
3127
const Sentry = require("@sentry/aws-serverless");
@@ -34,7 +30,6 @@ Sentry.init({
3430
dsn: "___PUBLIC_DSN___",
3531
tracesSampleRate: 1.0,
3632
integrations: [
37-
Sentry.prismaIntegration(),
3833
Sentry.mysqlIntegration(),
3934
Sentry.mysql2Integration(),
4035
Sentry.pgIntegration(),

docs/platforms/javascript/guides/gcp-functions/tracing/instrumentation/automatic-instrumentation.mdx

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,28 @@ description: "Learn what transactions are captured after tracing is enabled."
44
sidebar_order: 10
55
---
66

7-
When performance is enabled through `tracesSampleRate`, `enableTracing` or a `tracesSampler` function, the Sentry SDK will automatically capture spans for the following:
7+
When performance is enabled through `tracesSampleRate`, `enableTracing` or a `tracesSampler` function, the Sentry SDK will automatically capture spans for incoming, and outgoing HTTP requests.
88

9-
- HTTP requests made with:
10-
- `http`
11-
- `https`
12-
- `fetch`
9+
Database instrumentation can be manually enabled by adding the corresponding integration to the `integrations` array in the `init` method. The following packages are supported:
1310

14-
These are automatically set up for you without any further configuration.
11+
- `mysql`
12+
- `mysql2`
13+
- `pg`
14+
- `graphql` (including Apollo Server)
15+
- `mongo`
16+
- `mongoose`
17+
- `ioredis`
18+
- `prisma` (requires additional configuration - see <PlatformLink to="/configuration/integrations/prisma/">Prisma Integration</PlatformLink>)
1519

16-
The following instrumentation can be manually enabled by adding the corresponding integration to the `integrations` array in the `init` method:
17-
18-
- DB queries made with:
19-
- `mysql`
20-
- `mysql2`
21-
- `pg`
22-
- `graphql` (including Apollo Server)
23-
- `mongo`
24-
- `mongoose`
25-
- `ioredis`
26-
- `prisma`
27-
28-
You can add these as follows:
20+
You can add the integrations as follows:
2921

3022
```javascript
31-
const Sentry = require("@sentry/aws-serverless");
23+
const Sentry = require("@sentry/google-cloud-serverless");
3224

3325
Sentry.init({
3426
dsn: "___PUBLIC_DSN___",
3527
tracesSampleRate: 1.0,
3628
integrations: [
37-
Sentry.prismaIntegration(),
3829
Sentry.mysqlIntegration(),
3930
Sentry.mysql2Integration(),
4031
Sentry.pgIntegration(),

docs/platforms/javascript/guides/remix/manual-setup.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ Sentry.init({
8585
});
8686
```
8787

88-
Initialize Sentry in your entry point for the server to capture exceptions and get performance metrics for your [`action`](https://remix.run/docs/en/main/route/action) and [`loader`](https://remix.run/docs/en/main/route/loader) functions. You can also initialize Sentry's database integrations, such as <Link to="/platforms/javascript/guides/node/tracing/database/opt-in/#prisma-orm-integration">Prisma</Link>, to get spans for your database calls.
88+
Initialize Sentry in your entry point for the server to capture exceptions and get performance metrics for your [`action`](https://remix.run/docs/en/main/route/action) and [`loader`](https://remix.run/docs/en/main/route/loader) functions.
8989

9090
To catch React component errors (in Remix v1) and routing transactions (in all Remix versions), wrap your Remix root with `withSentry`.
9191

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
When performance is enabled through `tracesSampleRate`, `enableTracing` or a `tracesSampler` function, the Sentry SDK will automatically capture spans for the following:
22

3-
- Routes & middlewares
4-
- HTTP requests made with:
5-
- `http`
6-
- `https`
7-
- `fetch`
8-
- DB queries made with:
3+
- Incoming requests
4+
- Outgoing HTTP requests
5+
- Database queries made with the following packages:
96
- `mysql`
107
- `mysql2`
118
- `pg`
@@ -14,14 +11,6 @@ When performance is enabled through `tracesSampleRate`, `enableTracing` or a `tr
1411
- `mongoose`
1512
- `ioredis`
1613

17-
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:
14+
The following packages are not automatically instrumented and need to be set up manually:
1815

19-
```javascript
20-
const Sentry = require("@sentry/node");
21-
22-
Sentry.init({
23-
dsn: "___PUBLIC_DSN___",
24-
tracesSampleRate: 1.0,
25-
integrations: [Sentry.prismaIntegration()],
26-
});
27-
```
16+
- `prisma` (see <PlatformLink to="/configuration/integrations/prisma/">Prisma Integration</PlatformLink>)

platform-includes/configuration/integrations/javascript.astro.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Depending on whether an integration enhances the functionality of a particular r
5555
| [`onUncaughtExceptionIntegration`](./onuncaughtexception) ||| | |
5656
| [`onUnhandledRejectionIntegration`](./unhandledrejection) ||| | |
5757
| [`postgresIntegration`](./postgres) || || |
58-
| [`prismaIntegration`](./prisma) | | || |
58+
| [`prismaIntegration`](./prisma) | | || |
5959
| [`redisIntegration`](./redis) || || |
6060
| [`requestDataIntegration`](./requestdata) || || |
6161
| [`anrIntegration`](./anr) | || | |

platform-includes/configuration/integrations/javascript.bun.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
| [`onUncaughtExceptionIntegration`](./onuncaughtexception) ||| | |
2222
| [`onUnhandledRejectionIntegration`](./unhandledrejection) ||| | |
2323
| [`postgresIntegration`](./postgres) || || |
24-
| [`prismaIntegration`](./prisma) | | || |
24+
| [`prismaIntegration`](./prisma) | | || |
2525
| [`redisIntegration`](./redis) || || |
2626
| [`requestDataIntegration`](./requestdata) || || |
2727
| [`captureConsoleIntegration`](./captureconsole) | | | ||

platform-includes/configuration/integrations/javascript.nextjs.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Depending on whether an integration enhances the functionality of a particular r
6262
| [`onUncaughtExceptionIntegration`](./onuncaughtexception) ||| | |
6363
| [`onUnhandledRejectionIntegration`](./unhandledrejection) ||| | |
6464
| [`postgresIntegration`](./postgres) || || |
65-
| [`prismaIntegration`](./prisma) | | || |
65+
| [`prismaIntegration`](./prisma) | | || |
6666
| [`redisIntegration`](./redis) || || |
6767
| [`anrIntegration`](./anr) | || | |
6868
| [`localVariablesIntegration`](./localvariables) | || | |

platform-includes/configuration/integrations/javascript.node.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
| [`onUncaughtExceptionIntegration`](./onuncaughtexception) ||| | |
2121
| [`onUnhandledRejectionIntegration`](./unhandledrejection) ||| | |
2222
| [`postgresIntegration`](./postgres) || || |
23-
| [`prismaIntegration`](./prisma) | | || |
23+
| [`prismaIntegration`](./prisma) | | || |
2424
| [`redisIntegration`](./redis) || || |
2525
| [`requestDataIntegration`](./requestdata) || || |
2626
| [`anrIntegration`](./anr) | || | |

platform-includes/configuration/integrations/javascript.remix.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Depending on whether an integration enhances the functionality of a particular r
5555
| [`onUncaughtExceptionIntegration`](./onuncaughtexception) ||| | |
5656
| [`onUnhandledRejectionIntegration`](./unhandledrejection) ||| | |
5757
| [`postgresIntegration`](./postgres) || || |
58-
| [`prismaIntegration`](./prisma) | | || |
58+
| [`prismaIntegration`](./prisma) | | || |
5959
| [`redisIntegration`](./redis) || || |
6060
| [`requestDataIntegration`](./requestdata) || || |
6161
| [`anrIntegration`](./anr) | || | |

platform-includes/configuration/integrations/javascript.sveltekit.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Depending on whether an integration enhances the functionality of a particular r
5555
| [`onUncaughtExceptionIntegration`](./onuncaughtexception) ||| | |
5656
| [`onUnhandledRejectionIntegration`](./unhandledrejection) ||| | |
5757
| [`postgresIntegration`](./postgres) || || |
58-
| [`prismaIntegration`](./prisma) | | || |
58+
| [`prismaIntegration`](./prisma) | | || |
5959
| [`redisIntegration`](./redis) || || |
6060
| [`requestDataIntegration`](./requestdata) || || |
6161
| [`anrIntegration`](./anr) | || | |

platform-includes/migration/javascript-v8/important-changes/javascript.astro.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ We now support the following integrations out of the box with 0 configuration:
2323
- `mysqlIntegration`: Automatically instruments MySQL
2424
- `mysql2Integration`: Automatically instruments MySQL2
2525
- `postgresIntegration`: Automatically instruments PostgreSQL
26-
- `prismaIntegration`: Automatically instruments Prisma
2726

2827
### Removal of `trackHeaders` option for Astro middleware
2928

platform-includes/migration/javascript-v8/important-changes/javascript.aws-lambda.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,5 @@ We now support the following integrations out of the box with 0 configuration:
6161
- `mysqlIntegration`: Automatically instruments MySQL
6262
- `mysql2Integration`: Automatically instruments MySQL2
6363
- `postgresIntegration`: Automatically instruments PostgreSQL
64-
- `prismaIntegration`: Automatically instruments Prisma
6564

6665
We also automatically instrument AWS SDK v2 and AWS SDK v3.

platform-includes/migration/javascript-v8/important-changes/javascript.azure-functions.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,3 @@ We now support the following integrations out of the box with 0 configuration:
5757
- `mysqlIntegration`: Automatically instruments MySQL
5858
- `mysql2Integration`: Automatically instruments MySQL2
5959
- `postgresIntegration`: Automatically instruments PostgreSQL
60-
- `prismaIntegration`: Automatically instruments Prisma

platform-includes/migration/javascript-v8/important-changes/javascript.bun.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ We now support the following integrations out of the box with 0 configuration:
4545
- `mysql2Integration`: Automatically instruments MySQL2
4646
- `nestIntegration`: Automatically instruments Nest.js
4747
- `postgresIntegration`: Automatically instruments PostgreSQL
48-
- `prismaIntegration`: Automatically instruments Prisma
4948
- `connectIntegration`: Automatically instruments Connect
5049

5150
### Ensure Request Isolation

0 commit comments

Comments
 (0)