-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Prisma ORM Integration Docs. (#4961)
Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
- Loading branch information
1 parent
7ae7244
commit 3938178
Showing
3 changed files
with
53 additions
and
1 deletion.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...orms/node/common/performance/database.mdx → .../performance/database/auto-instrument.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
title: Database Integrations | ||
--- | ||
|
||
Node.js integrations support tracking database queries as spans. | ||
|
||
## Supported Platforms | ||
|
||
Auto-instrumented: | ||
|
||
- `pg` (Postgres) | ||
- `pg-native` (Postgres) _Available from version 6.12.0_ | ||
- `mongodb` (Mongo) | ||
- `mongoose` (Mongo) | ||
- `mysql` (MySQL) | ||
|
||
Opt-in: | ||
|
||
- [Prisma ORM](https://www.prisma.io/) _Available from version 7.0.0_ | ||
|
||
## Next Steps | ||
|
||
<PageGrid /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
title: Opt-in | ||
--- | ||
|
||
## Prisma ORM Integration | ||
|
||
_(Available from `7.0.0`)_ | ||
|
||
Sentry supports tracing [Prisma ORM](https://www.prisma.io/) fetchers with Prisma integration. This integration is an opt-in feature and requires that a `PrismaClient` instance is provided. | ||
|
||
Prisma integration creates a `db.prisma` span for each query and reports to Sentry with relevant details inside `description` if available. | ||
|
||
For example: | ||
|
||
```javascript | ||
import { PrismaClient } from '@prisma/client'; | ||
import * as Sentry from '@sentry/node'; | ||
import * as Tracing from '@sentry/tracing'; | ||
import { randomBytes } from 'crypto'; | ||
|
||
const client = new PrismaClient(); | ||
|
||
Sentry.init({ | ||
dsn: ___PUBLIC_DSN___, | ||
release: '1.0', | ||
tracesSampleRate: 1.0, | ||
integrations: [new Tracing.Integrations.Prisma({ client })], | ||
}); | ||
``` |