[BUG]: Prisma DBM propagation does not work correctly.
Tracer Version(s)
5.58.0
Node.js Version(s)
22
Bug Report
DBM propagation should work with Prisma but it doesn't because the traceparent is invalid.
Reproduction Code
- Setup Prisma
- Setup dd-trace with
dbmPropagationMode=full. - Register the dd-trace OTel
TracerProvider - Run some queries.
Prisma supports trace propagation via OTel and adds the traceparent comment based on the OTel context. However using the new dd-trace Prisma support this comment always comes out as /* traceparent='00-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bbbbbbbbbbbbbbbb-01' */ because it is hard coded to that value here.
Error Logs
No response
Tracer Config
No response
Operating System
No response
Bundling
Unsure
IIRC we weren't able to support dbm propagation with this plugin since the query is generated and transmitted from within the compiled Prisma native addon.
I've never seen @prisma/instrumentation before and I don't believe the engineers who did the implementation have seen it either. It sounds like that package supports injecting traceparent comments into the underlying SQL query so it seems that we should be able to support dbm propagation after all.
I'll see if one of the original engineers has capacity to take a look. Has anyone created a helpdesk ticket for this?
@tlhunter I have a support ticket open at https://help.datadoghq.com/hc/en-us/requests/2182389
I think the solution to this problem is to just (sorry) implement getTraceParent along the lines described in this comment on the original issue https://github.com/DataDog/dd-trace-js/issues/1244#issuecomment-1212462924
@public to be clear, did you manage to get DBM propagation to work with prisma via prisma instrumentation as per zacharyliu ?
+1 tracing this too. @tlhunter any movements so far?
Hey any progress or any steps further to follow to get dd traces for prisma queries?
Having the same issue. Finally we have a prisma integration, but the DBM correlation is not working. That would be quite important.
Any way, this issue can be prioritized?
Bump on this?