-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add Prisma Tags to our Sql Commenter tracing for extra information #13360
Copy link
Copy link
Closed
Labels
kind/featureA request for a new feature.A request for a new feature.status/is-preview-featureThis feature request is currently available as a Preview feature.This feature request is currently available as a Preview feature.topic: tracing
Milestone
Description
Problem
At the moment Prisma can add a trace id as a SQL comment when a trace id is passed to the query.
- See this PR as an example Passing trace id from JS client to a database comment prisma-engines#2587
- The comment example https://github.com/prisma/quaint/pull/329/files#diff-4b2e8a5b67b97212d61df2fd30b5c5205e9368947f0262bde6c17bcf99b7c931R713
The comment doesn't give any more information around the query for example it doesn't mention this query is from Prisma and what operation it was for.
Suggested solution
Allow the ability to add in extra Sql Tags. For example:
SELECT * FROM FOO /* operation='CreateUser', ORM='Prisma',
traceparent='00-5bd66ef5095369c7b0d1f8f4bd33716a-c532cb4098ac3dd2-01',
tracestate='congo%3Dt61rcWkgMzE%2Crojo%3D00f067aa0ba902b7'*/
We could make it that we always add in those SQL comments even if the trace id is not added. So the Query would look like:
SELECT * FROM FOO /* operation='CreateUser', ORM='Prisma'*/
We could do this by default or allow the user to opt into adding them.
Alternatives
Additional context
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
kind/featureA request for a new feature.A request for a new feature.status/is-preview-featureThis feature request is currently available as a Preview feature.This feature request is currently available as a Preview feature.topic: tracing