dd-trace-js icon indicating copy to clipboard operation
dd-trace-js copied to clipboard

[BUG]: Prisma DBM propagation does not work correctly.

Open public opened this issue 5 months ago • 7 comments

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

  1. Setup Prisma
  2. Setup dd-trace with dbmPropagationMode=full.
  3. Register the dd-trace OTel TracerProvider
  4. 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

public avatar Jul 09 '25 11:07 public

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 avatar Jul 09 '25 18:07 tlhunter

@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 avatar Jul 10 '25 08:07 public

@public to be clear, did you manage to get DBM propagation to work with prisma via prisma instrumentation as per zacharyliu ?

jeff-traba avatar Jul 23 '25 17:07 jeff-traba

+1 tracing this too. @tlhunter any movements so far?

jeff-traba avatar Jul 23 '25 17:07 jeff-traba

Hey any progress or any steps further to follow to get dd traces for prisma queries?

ravivarma4003 avatar Sep 02 '25 09:09 ravivarma4003

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?

TheLevti avatar Sep 24 '25 09:09 TheLevti

Bump on this?

jeff-traba avatar Nov 14 '25 17:11 jeff-traba