Showing results for 
Show  only  | Search instead for 
Did you mean: 

Context Propagation for NodeJS (OA) to OpenTelemetry on same process

DynaMight Champion
DynaMight Champion

I'm working on a interesting usecase where we need to "continue" a trace on NodeJS to sub-processes on the same NodeJS instance. We wanted to address this with OTEL instrumentation but this works only in parts.

This is the scenario:

envoy -> node.js (main process) -> node.js (worker process) -> backend services (...)

Oneagent picks up and starts traces from envoy and the main node.js process (http requests), but it is unable to trace to the worker processes and beyond.
Following the instrumentation examples in the documentation we are able to create traces/spans for the worker processes and the backend services (this even works with the oneagent span sensor).
However stitiching those with the part that oneagent captures from envoy and the main process doesn't work. It seems that there is no way to propagate the context from the oneagent trace to the OTEL trace.
According to this documentation this seems to be possible, although it also mentions that trace consolidation between oneagent covered technologies (NodeJS) and OTEL traces on such technology is not safe? (We have created a propagation rule already, that should cover the case)

Any ideas how you could achieve this then? We were even looking at picking up a trace context from a created purepath with OneagentSDK to paste the context to OTEL, but there is a explicit remark in the OneagentSDK that mentions it is not intended for propagation.

Any insight is appreciated!

Certified Dynatrace Master, Dynatrace Partner -

Featured Posts