fix(Prisma): update span description for Prisma v7+#19924
fix(Prisma): update span description for Prisma v7+#19924julien1619 wants to merge 1 commit intogetsentry:developfrom
Conversation
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Deps
Bug Fixes 🐛Core
Deps
Other
Internal Changes 🔧
🤖 This preview updates automatically when you update the PR. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
|
|
||
| // Make sure we use the query text as the span name, for ex. SELECT * FROM "User" WHERE "id" = $1 | ||
| if (spanJSON.description === 'prisma:engine:db_query' && spanJSON.data['db.query.text']) { | ||
| if ((spanJSON.description === 'prisma:engine:db_query' || spanJSON.description === 'prisma:client:db_query') && spanJSON.data['db.query.text']) { |
There was a problem hiding this comment.
Fix PR lacks test verifying the regression fix
Medium Severity
This fix PR does not include a test that verifies the regression is actually fixed. The existing v7 integration test at prisma-orm-v7/test.ts expects description === 'prisma:client:db_query' (the unfixed behavior), meaning it either doesn't cover this fix at all, or the fix is ineffective because db.query.text isn't available at spanStart time for v7. Compare with the v6 test, which properly asserts the description is updated to the actual SQL query text. A test confirming the span description gets updated for prisma:client:db_query spans is needed.
Triggered by project rule: PR Review Guidelines for Cursor Bot


This pull request makes a small but important update to the Prisma tracing integration. The change ensures that both engine-level and client-level database queries are properly named in tracing spans, improving visibility and debugging for Prisma queries.
prismaIntegrationto also coverprisma:client:db_queryevents (v7+), in addition toprisma:engine:db_query, ensuring that the query text is used as the span name for both types of database queries. (packages/node/src/integrations/tracing/prisma.ts)Relates to #18797