Skip to content

Commit 38c1570

Browse files
authored
Update docs and add example for Prisma integration.
1 parent 0837c3d commit 38c1570

File tree

3 files changed

+49
-1
lines changed

3 files changed

+49
-1
lines changed

src/platforms/node/common/performance/database.mdx renamed to src/platforms/node/common/performance/database/auto-instrument.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Database integrations
2+
title: Auto-instrumented
33
---
44

55
Node.js integrations support tracking database queries as spans. Starting in version `6.4.0`, `@sentry/tracing` will auto-detect supported database drivers or ORMs being used in your project, and automatically enable the relevant integrations with default options - without needing additional code.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
title: Database integrations
3+
---
4+
5+
Node.js integrations support tracking database queries as spans.
6+
7+
## Supported platforms
8+
9+
Auto-instrumented:
10+
11+
- `pg` (Postgres)
12+
- `pg-native` (Postgres) _Available from version 6.12.0_
13+
- `mongodb` (Mongo)
14+
- `mongoose` (Mongo)
15+
- `mysql` (MySQL)
16+
17+
Opt-in:
18+
19+
- [Prisma ORM](https://www.prisma.io/) _Available from version 7.0.0_
20+
21+
## Next Steps
22+
23+
<PageGrid />
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
title: Opt-in
3+
---
4+
5+
## Prisma ORM Integration _(Available from `7.0.0`)_
6+
7+
Sentry supports tracing [Prisma ORM](https://www.prisma.io/) fetchers with Prisma Integration. This integration is an opt-in feature and requires a `PrismaClient` instance provided.
8+
9+
For example:
10+
11+
```javascript
12+
import { PrismaClient } from '@prisma/client';
13+
import * as Sentry from '@sentry/node';
14+
import * as Tracing from '@sentry/tracing';
15+
import { randomBytes } from 'crypto';
16+
17+
const client = new PrismaClient();
18+
19+
Sentry.init({
20+
dsn: ___PUBLIC_DSN___,
21+
release: '1.0',
22+
tracesSampleRate: 1.0,
23+
integrations: [new Tracing.Integrations.Prisma({ client })],
24+
});
25+
```

0 commit comments

Comments
 (0)