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

How to monitor a jar file?



I'm trying to monitor a jar file but failed.

I've read this question below:

But I can't capture the data even though I added the agentpath to the command.

the Command I used is :

 java -agentpath:"C:\Program Files (x86)\Dynatrace\Dynatrace Agent 7.2\agent\lib64\dtagent.dll=name=Tomcat_TEST_02,server=" -jar helloworld.jar

I also used the CPU sampling when I run this command. But I still can't find the method and class which i wrote in this jar file.

Does anyone can give me some advise? Thanks for your help!


Dynatrace Champion
Dynatrace Champion

Your problem could be that you don't have a transaction entry point that's recognized by AppMon. AppMon starts monitoring transactions that start with known Web Request handlers such as doGet(), doPost(), jspServlet() methods, as well as other known method.class patterns. But I suspect your helloworld.jar does not have such types of classes implemented.

This is solvable by defining new entry points of methods.classes that exist in your helloworld app. Here's the doc page on defining a custom entry point.

Also, does your helloworld app run for an extended period of time, or does it exist quickly. If it doesn't do much, and runs very fast, it's hard for AppMon to collect useful data from CPU Sampling. Try putting some logic in it to make it run for a long time, such as 60+ seconds, then re-try CPU Sampling.


Hi Joseph
Thanks for your reply!

Sorry for my unclearly description . In fact, I'm trying to find the Entry point for a long time. That's the reason why I used the CPU sampling to capture the data. And I can not find the method which I wrote when I try to define custom sensor.

I've added "Thread.sleep()" to the code and let the program sleep 3 seconds. Does it enough to let AppMon to collect data?

Thread sleep isn't good option, because when thread is suspended, nothing is executed. There are two option for handling such case if this is test environment. First is using CPU Sampling, second is shotgun rule. This one may produce massive overhead so it's recommended on low environments and only for short period of time. In such case you can create sensor group with custom sensor made on top of whole class or package. Than you can mark such sensor group as placed on agent group and mark it as Entry Points. Then you should start see PurePaths. This will allow you from purepaths right click => Add sensor rules for method that are real entry points of those transactions. Than you should disable this really wide sensor you've created before and make hot sensor placement. After this you should see purepaths.



Hello, Sebastian,

Thanks for your reply!

After I try and error, I found that only when my jar file is running then I can see the connected Agent "Tomcat_TEST_02 ", which is the agent name I used in the parameter.

And then, I can capture my method by CPU sampling only when the agent is connecting.

However, I meet another question is: Even though I've added sensor rules from CPU sampling, I still can't see any PurePath during and after the jar file running.

I've tried some different way to solve it but failed. So I need some advise again.

Many thanks!


Sorry I had a wrong setting so that I can't see the purepath.

The "Capture" field should be change to active and start PurePaths.

Anyway, many thanks for Sebastian and Joseph's help!

I'm happy to read it 🙂