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

x-dynatrace header tagging


Hi! Due to an unsupported client (Java + OKHTTP) we have broken purepaths from service a to service b. service b is just a typical Jax-RS application, so I'm looking for information on how to custom construct an x-dynatrace header which i can define in the request from the client side. I have no control of the code in service b.

I see documentation about the tagging ADK but can't find information around just adding the tag in Java such that servlets on the other end picks it up natively. Any link/tips would be super helpful


Rick B



Hi Rick, we are facing the same problem . did you find a solution?

According to our devs I have to write this myself, haha, so I don't think it's going to be done for another month or two, but I think shortly after I wrote this I found something that essentially said if you use the Tagging ADK and just set the tag value as the value of the "x-dynatrace" header that it should work

Dynatrace Participant
Dynatrace Participant

Hi Rick,

I ran into the same issue (also with OKHTTP).

You can use the ADK to create the x-dynatrace header:

Then create an "x-dynatrace" header in the request with the created tag as string value. No changes necessary on service b.

Thanks Eduard! awesome to hear. Is the only way, to your knowledge, to parse/set this in the OKHttp attributes on the method? do you have code examples?

Code example below:

private static void sendTaggedRequest() throws IOException {
Tagging x = DynaTraceADKFactory.createTagging();
String tag = x.getTagAsString();

Request request = new Request.Builder()
.header("X-dynatrace", tag)

Response response = client.newCall(request).execute();

thanks! I think our implementation is slightly different but i will float this by some smart people here to see what we can do. In any case it's a super straightforward example of getting it into the http header just generically