How to mix the traces from Datadog and OpenTelemetry? #2724
-
Team, I am having some java services (SERVICE_A) being instrumented with Datadog agents. There are some services (SERVICE_B) which are not being instrumented by Datadog. These are legacy services written in a language which is not supported by any agent. The legacy services produces some traces in proprietary format. I am trying to convert these traces using opentelemetry SDK. This trace has Datadog parent TRACEID from SERVICE_A. I am not sure, whether Datadog would be able to take traces from SERVICE_A instrumented using Datadog agent and SERVICE_B traces produced using OpenTelemetry SDK and present as a single transaction. thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 10 replies
-
👋 Hello , i'm glad you brought this up, I think I can help here. So, for services you're migrating to opentelemetry- sdks, but you still want them to connect to datadog-trace- sdk instrumented applications, as long as you're adding Propagation to both OpenTelemetry and Datadog using B3 Headers, you should be able to correctly pass trace context between the apps and they'll be connected in the datadog backend Here's an example of how this would be enabled for opentelemetry-python <=> datadog-trace-rb, for example:
Also worth noting that opentelemetry- sdk traces would have to go through the opentelemetry-collector+datadogexporter, and datadog-trace- sdk traces would have to go through the datadog-agent, but they'd both be connected in your backend/UI. Does that help? |
Beta Was this translation helpful? Give feedback.
@MacNale Ah, thank you for the clarification. My original answer should be what you're looking for here, apologies as this is not well documented in our docs but is possible, I'll work with the documentation team on updating for this use case.
A Datadog-instrumented application (service_a), emitting traces to a datadog-agent, can have it's traces connected to an opentelemetry-instrumented application (service_b), emitting traces to an opentelemetry-collector (which would have a datadogexporter configured). It is necessary to enable
B3
trace context propagation (inject) on your datadog application, as well as on your opentelemetry-application. Here is an example for java: