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

get current appmon tag.

Hi,

I've a JVM A calling another one B by an HTTP call.

The HTTP client A calling the JVM B is home made and Appmon doesn't put TAG in the HTTP call to contiue the purepath along the 2 JVM. (I have 2 purepath instead of one).

I would like to put the current purepath tag in the request sent by the Client A in HTTP header, but I don't find any method to get the current Tag which has been assigned by AppMon in ADK library.

Is there a way to get it ?

Thks

Pierre


5 REPLIES 5

christian_wegha
Advisor

Hello Pierre,

in purepath dashlet there is the option to add another columns to your view. Can you find the TAG ID column there?

Please let me know.

Regards,

Christian


christian_wegha
Advisor

See the attachment:

tag-id.png

Hi, thanks for your response, but I need to retrieve at java code level.

I mean my both JVM entry points are Servlet, but the JVM A is calling the JVM B via a custom class, and dynatrace doesn't put the TAG in HTTP Header when calling the JVM B.

So I want in my custom class to get the current Tag assigned by Dynatrace and put it in Header HTTP.

But I didn't find any method in com.dynatrace.adk.jar to get the TAG already assigned by dynatrace (there is only a way to create a custome TAG and start a purepath).

Pierre


christian_wegha
Advisor

Did you check this already?

https://www.dynatrace.com/support/doc/appmon/integrations-and-extensions/development-kits/agent-development-kit-adk/tagging-adk-for-java/


yes I did, but I doesn't work :-(.

Here an excerpt of the class calling the JVM B via HTTP, I tried to get TAG ID without success:

...

DynaTraceADKFactory.initialize();
Tagging dtADK = DynaTraceADKFactory.createTagging();
byte [] tag = dtADK.getTag();
dtADK.linkClientPurePath(true, tag);

System.out.println("### dtADK:"+ dtADK);
System.out.println("### dtADK.getTag()= "+ tag);
System.out.println("### dtADK.convertTagToString.= "+ dtADK.convertTagToString(tag));
System.out.println("### "+ dtADK.getTagAsString());

myConnection.setRequestProperty("X-dynaTrace", dtADK.getTagAsString());

it gives following info:

14:35:50,765 INFO [stdout] (Thread-54) ### dtADK:com.dynatrace.adk.impl.TaggingImpl@db31b58
14:35:50,765 INFO [stdout] (Thread-54) ### dtADK.getTag()= [B@7dadc04e
14:35:50,766 INFO [stdout] (Thread-54) ### dtADK.convertTagToString.= FW1;-1;-1;-1;-1;-1;-1;-1
14:35:50,766 INFO [stdout] (Thread-54) ###

while the Tag at purepath level is FW1;-1136384490;-519232369;16;6;-519232369;16;3.