Open telemetry with Prisma does not extract query params

36 Views Asked by At

I am using Prisma and trying to send data regarding my query to my exporter (very basic). When the processor receives the spans, it does not contain the actual query parameter values (only $1, $2, etc..).

{
  traceId: '143935679dd6ce6820615153508f1dda',
  parentId: '2a4ae27990ead0fb',
  traceState: undefined,
  name: 'prisma:engine:db_query',
  id: 'ca3725f6db13db48',
  kind: 0,
  timestamp: 1706011446653329,
  duration: 16392,
  attributes: {
    'db.statement': `SELECT "public"."Photo"."id", "public"."Photo"."description", "public"."Photo"."filename", "public"."Photo"."views", "public"."Photo"."isPublished" FROM "public"."Photo" WHERE ("public"."Photo"."id" = $1 AND "public"."Photo"."description" = $2) LIMIT $3 OFFSET $4 /* traceparent='00-143935679dd6ce6820615153508f1dda-1a2dc9debddf0d4c-01' */`
  },
  status: { code: 0 },
  events: [],
  links: []
}

I am using PrismaInstrumentation and SimpleSpanProcessor.

how can I get the parameters? it that possible without using any custom decorator on the method invoking the query?

0

There are 0 best solutions below