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

Traceparent header through Dynatrace OneAgent

prabalr
Newcomer_

Hello All, 

I have a bunch of Java based microservices that are running on Kubernetes and have the Dynatrace OneAgent injected in the pods. Now I can see trace id and span id be automatically propagated by the One Agent. 

But now I have a requirement to propagate the traceparent header as well. I wanted to know: 

- Does Dynatrace automatically support the traceparent? 

- If not do we need to use the OTEL Java SDK for this? 

- If we set the traceparent with OTEL SDK, then we kind of need to set the traceid and span id as well right because then we override what the Dynatrace OneAgent does?

4 REPLIES 4

Hi @prabalr ,

as i see in the docs, the Traceparent is supported by Dynatrace OneAgent, see this link https://{environmentid}.apps.dynatrace.com/ui/apps/dynatrace.classic.distributed.traces/ui/diagnosti...

 

MostafaHussein_1-1731714609872.png

when investigating in this request and went through trace i found a sequence of 3 service calls as the below figure

MostafaHussein_2-1731714752193.png

and the 1st node has no traceparent id as it's the 1st service call and the 2nd and 3rd service calls has as the following 3 figures

1st and parent request (has no parent trace id)

MostafaHussein_3-1731714808809.png

2nd request (has parent id)

MostafaHussein_4-1731714890158.png

3rd request (has parent span id)

MostafaHussein_5-1731714938556.png

the above example is detected out-of-the-box by the OneAgent but there's another example I've found that using OpenTelemety as the below figures, check these 2 links
https://{environmentid}.apps.dynatrace.com/ui/apps/dynatrace.classic.distributed.traces/ui/diagnosti...

https://{environmentid}.apps.dynatrace.com/ui/apps/dynatrace.classic.distributed.traces/#trace;gtf=-...

 

MostafaHussein_6-1731715322392.png

MostafaHussein_7-1731715430543.png

 

BR,
Mostafa Hussein.

 

 

Certified Dynatrace Professional | Certified Dynatrace Services - Observability | Dynatrace Partner yourcompass.ca

Hi @MostafaHussein 

Sincerely appreciate your revert.

Would you know if Dynatrace uses the W3C Trace Context Propagators? I am specifically looking for the traceparent header that is set up here: 

opentelemetry-java/api/all/src/main/java/io/opentelemetry/api/trace/propagation/W3CTraceContextPropa...

I believe what Dynatrace OneAgent is doing is to probably extract this and parse it to trace_id, span_id, parent_span_id which anyway is the purpose of traceparent. 

Is this a right understanding?

Yes @prabalr Dynatrace is using the same context as mentioned in the docs This typically happens via HTTP headers (like the W3C trace context) or via unique IDs in messaging systems.

https://docs.dynatrace.com/docs/shortlink/distributed-traces-concepts#span-context

Thanks,
Mostafa Hussein.

Certified Dynatrace Professional | Certified Dynatrace Services - Observability | Dynatrace Partner yourcompass.ca

Peter_Youssef
Champion

Hello @prabalr 

In addition to the wonderful illustration provided by @MostafaHussein 

PFA below points:

  • Validate the enabled oneagent features related to the highlighted concern "Java && Opentelemetry and Oneagent SDK".
  • It's recommended to keep the OneAgent version up-to-date.
  • The related Java processes are restarted.

For the Oneagent Java SDK: 

Hoping it adds value,

KR, 
Peter

Featured Posts