Skip to content

Add Prisma Tags to our Sql Commenter tracing for extra information #13360

@garrensmith

Description

@garrensmith

Problem

At the moment Prisma can add a trace id as a SQL comment when a trace id is passed to the query.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions