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

This product reached the end of support date on March 31, 2021.

Why do Java methods called from a JSP page not show up in the Methods list in the Purepaths?

jan_moeyersons
Contributor

Dynatrace version 6.3.6.1004

Eclipse Neon 4.6.0

Tomcat 8.0.36

Java : openjdk version "1.8.0_91"
OpenJDK Runtime Environment (build 1.8.0_91-8u91-b14-0ubuntu4~16.04.1-b14)
OpenJDK 64-Bit Server VM (build 25.91-b14, mixed mode)

Ubuntu Linux

4.4.0-31-generic #50-Ubuntu SMP Wed Jul 13 00:07:12 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

As a newbee to Dynatrace and not really being a web developer either, please bear with me...

I am trying to get my head around the Dynatrace/Eclipse integration and how it works with a Tomcat application. So I installed and configured the AppMon plugin; it is connecting well to my Dynatrace client and I have set up a System Profile for it. As I can't find a way to run my Tomcat with the Run with Appmon option (there is no configuration applicable, so it says), I have added the -agentpath options to the VM arguments field in the Run Configuration of my Tomcat in my Eclipse. I can see the agent in Tomcat server connecting successfully to my Dynatrace collector; all the goodies appear in the console log; it finds its system profile, checks the license alright and instruments the code. So far so good.

In the meantime, the AppMon plugin in my Eclipse IDE has connected to my Dynatrace client too. The error log view in my Ecliipse is showing the REST requests going to the server and the responses coming back.

Now, I start up my (extremely) simple web application: a .jsp page invoking a method on a Java class. See the attached source code files for details. I open a browser and enter the URL and I am getting the expected result. The Dynatrace is monitoring and is capturing the visits and Purepaths.

So, I open the System Profile monitoring and see the typical layout with the browser and application server tiers. I click the Active visits, then drill down to the Purepaths and then to the methods. In the methods dashlet, the tree of packages, classes and methods appears, but it contains only org.apache packages and not my own package. I can see the helloWorld_jsp class that is generated off of my .jsp page and was expecting to see the invocation of the method that I know has been invoked, because I see the resulting text on the page... But the hierarchy of calls ends with the org.apache.jsp.helloWorld_jsp class and my be.gfi.helloworld.HelloWorld class is nowhere to be found.

In addition, when I ask to show me the source code of the methods that are there in the IDE, it says: "Source lookup was not successful".

I have exported the session from the Dynatrace client and have attached it to this question, along with the source code files.

Please tell me what I did wrong or what I am missing in my set up.

Thanks and very best regards,

Jantje.

helloworldjsp.dtshelloworldsource.tar.gz

6 REPLIES 6

dave_mauney
Dynatrace Champion
Dynatrace Champion

Hi Jantje,

Unless you add custom sensors to your own methods they will not show in either the Methods dashlet or as nodes on the PurePaths. You are currently seeing the "out of the box" instrumentation done with our sensors based on the technology. To instrument your own methods, investigate the "Custom Sensor" topic and experiment some with that.

HTH,

dave

Indeed, It is as simple as that: add the name of the package in the list of method sensors and, hey presto, not only do the methods show up in the list, but the Show in IDE finds the source code too.

graeme_william1
Inactive

Just to add some color to Dave's answer: the Methods dashlet shows methods for which sensors have been defined, whether out-of-the-box or custom. The PurePath will show methods either from defined sensors or from the auto-sensor mechanism which identifies slow methods.

Anyway, Dave is correct that you can see more detail using custom sensors. Note that you can define sensors for a single method, all methods in a class, or all methods in an entire package.

-- Graeme

I guess I'll have to read up on that auto-sensor thing too. Sounds promissing.

Indeed, methods that consume CPU in sufficient quantity or take a sufficiently long time do show up, even when the class and/or package is not defined in a sensor rule.

Nice!

And their source code is found too (provided the class is in the IDE, of course). Even nicer!