[Performance] How to trace Prisma down to the SQL query level? #9286
-
ContextI'd like to use Sentry to measure the performance impact of Prisma's decision to not use native JOINS for relational databases. Here's what they currently do: Prisma Client: const usersWithPosts = await prisma.user.findMany({
include: {
posts: true,
},
}) Resulting SQL: SELECT "public"."User"."id", "public"."User"."email", "public"."User"."name" FROM "public"."User" WHERE 1=1 OFFSET $1
SELECT "public"."Post"."id", "public"."Post"."title", "public"."Post"."authorId" FROM "public"."Post" WHERE "public"."Post"."authorId" IN ($1,$2,$3,$4) OFFSET $5 DescriptionToday, I'd love to be able to see each SQL call in it's own span. ResourcesPrisma provides it's own Open Telementry tracing which exposes these details. Is it possible to hook this into Sentry? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hey, thanks for writing in! I explored this a little with #5780, and Prisma is a bit of a black box, so OTEL is the way to go here. We have some docs about OpenTelemetry instrumentation with Sentry performance, but we're also working on improving this workflow as part of #8534. |
Beta Was this translation helpful? Give feedback.
Hey, thanks for writing in! I explored this a little with #5780, and Prisma is a bit of a black box, so OTEL is the way to go here.
We have some docs about OpenTelemetry instrumentation with Sentry performance, but we're also working on improving this workflow as part of #8534.