Add Support for Prisma ORM
See original GitHub issuePackage + Version
- [ x ]
@sentry/integrations - ^5.27.3
- [ x ]
@sentry/node - ^5.27.3
- [ x ]
@sentry/tracing - ^5.29.2
Description
I want to use the Postgres Tracing Integrations mentioned in these docs: https://docs.sentry.io/platforms/node/performance/database/ But for some reason, it does not work. I’m using Prisma to do my Postgres queries: https://github.com/prisma/prisma Underlying, Prisma is using the pg client package: https://github.com/prisma/prisma/blob/master/src/packages/client/src/utils/setupPostgres.ts
My code looks like this:
Sentry.init({
dsn: '***',
environment: env,
integrations: [
new ExtraErrorData({ depth: 20 }),
app && new Sentry.Integrations.Http({ tracing: true }),
app && new Tracing.Integrations.Express({ app }),
// Only works with pg client. Wait on support for Prisma
app && new Tracing.Integrations.Postgres(),
].filter(Boolean),
tracesSampleRate: 1.0,
normalizeDepth: 21,
});
Issue Analytics
- State:
- Created 3 years ago
- Reactions:26
- Comments:12 (3 by maintainers)
Top Results From Across the Web
Prisma | Next-generation ORM for Node.js & TypeScript
Prisma is a next-generation Node.js and TypeScript ORM for PostgreSQL, MySQL, SQL Server, SQLite, MongoDB, and CockroachDB. It provides type-safety, ...
Read more >Relational databases - Add to existing project - Prisma
Learn how to add Prisma to an existing Node.js or TypeScript project by connecting it to your database and generating a Prisma Client...
Read more >Express & Prisma | Next-Generation ORM for SQL DBs
Prisma is a next-generation ORM for Node.js & TypeScript. It's the easiest way to build Express apps with MySQL, PostgreSQL & SQL Server...
Read more >CRUD (Reference) - Prisma
This page describes how to perform CRUD operations with your generated Prisma Client API. CRUD is an acronym that stands for: Create; Read;...
Read more >Prisma Client
Prisma Client is an auto-generated, type-safe query builder generated based on the models and attributes of your Prisma schema.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
this is shipped in betas for V7! 🚀
we will close this request and would love to get any feedback on the usage!
I took a look at how this is implemented for the pg integration: https://github.com/getsentry/sentry-javascript/blob/master/packages/tracing/src/integrations/postgres.ts and applied prisma’s middleware concept to it: https://www.prisma.io/docs/concepts/components/prisma-client/middleware
Here’s what worked for me: