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

X-Dynatrace header in Kafka in a readable format

sselzer
Visitor

Hi,

I tried to read manually the tracing header in a Kafka message set by Dynatrace in a readable format, but it seems to be not mappable to a String. Can someone tell me what format the header has? I see it is a byte array, but when I map it to a string it is gibberish, so probably it is in a different format.

What I actually want to do is to create a message receiver that is not monitored by Dynatrace but still use the tracing information provided by Dynatrace e.g. for logging purposes.

5 REPLIES 5

mark_bley
Dynatrace Pro
Dynatrace Pro

Hi @sselzer ,

the format of the header is like following:

FW4;-470596006;4;1832383454;1102798;3;926782514;348;a479;2h01;3h6d37f3de;4h10d3ce;5h01;6h9f0a7961bfc17a806711020a76b2b914;7haf633cfee8390519

Best,

Mark

Hi @mark_bley , how can I read this string representation from the byte array in the header? I can't find a fitting decoding to get something readable out like your example above.

Best regards

Sascha

mark_bley
Dynatrace Pro
Dynatrace Pro

The x-dynatrace header has information about the current trace/span and it's passed from service to service in order to keep further traces in the same context. There is no need to decode anything from your side

mark_bley_0-1685457477346.png

 

Thanks for the answer. But this would mean that a trace will break at the first service in the chain not observed by Dynatrace. So it is not meant to decode this header outside of Dynatrace and there is also no way, correct?

If the header is lost(usually we see it gets blocked by FW) and with it the traces' context, the OneAgent will start a new trace (yes the chain would be broken/split).

Maybe these pages in our documentation can help further 

https://www.dynatrace.com/support/help/shortlink/service-distributed-traces#faqs

https://www.dynatrace.com/support/help/extend-dynatrace/opentelemetry/opentelemetry-traces/trace-con...

 

Featured Posts