jenkinsci/appdynamics-plugin

Jenkins report image dead url

Closed this issue · 4 comments

image

  1. While trying out this product i could not retrieve any graphs in Jenkins.

  2. Another thing i noticed is that my maven unit test finished at 2017-09-27T16:38:13+02:00
    But the test results only show 1 measurement at 16:36:00 should it not make several measurements during the test run? (every minute or so?)

Hi,
From the screenshot itself I cannot really see what the problem is. Could you perhaps provide more detail and hopefully some logging? That might help in resolving the issue.

I have started a new Jenkins build at Oct 4, 2017 10:29
This build gets measured by AppDynamics using the plugin.

Included are the jenkins build and the system log during the time of the build.
JenkinsBuildLog.txt
JenkinsSystemLog.txt

My personal analysis and explanation:
It seems to get its first exception on:

Error while serving http://bridport.locgov.nl:8080/job/junit-cucumber-example/appdynamics-dashboard/summarizerGraphMainMetric
java.lang.ArrayIndexOutOfBoundsException ...

Aside from that first exception it seems to try and fetch the default metrics like "Overall Application Performance|Exceptions per Minute" and fails then it does not try to retrieve the other metrics. I however only require a custom metric JVM Memory displayed last after the default metrics in the Performance Report page.

After the build the "AppDynamics Performance Report" page on the jenkins build shows 0 for every metric result of the current build. (Note the previous build in the screenshot did retrieve an actual value for some reason)
image

Even though the build log shows it had measured a result:

Number of old reports located for average: 11
Calculated average from previous reports: 18.708333333333332
Current report average: 9.333333333333334
Current average as percentage of total average: 200.44642857142856%

I have configured my metric in the plugin like this:
image

The root cause at first glance seems to be the call to the summarizerGraphMainMetric but the name suggests it is for making the graphs. And a previous build did retrieve an actual metric value so sometimes it actually can get metric data. Therefore fixing the summarizerGraphMainMetric bug might not fix the incorrect metric value retrieval because it could be two seperate problems.

What do you think?

Thanks for the extensive information.

The plugin always collects a certain default set of metrics, next to the possible custom metric you may provide. Apparently the Overall Application Performance|Exceptions per Minute metric cannot be found, as you have noticed as well. This shouldn't be an issue however. Because the plugin should continue collecting all the other metrics. I don't suspect this is the problem of not getting any graphs at all.
What you could do is check in AD itself, or even better querying the REST interface of AD directly, to check if the metric Overall Application Performance|Exceptions per Minute gives any result. Looking at the docs the metric should still be there but I don't have access to an AppDynamics instance so cannot verify myself.

The clue for not getting any graphs might be in this exception;

Caused: java.lang.reflect.InvocationTargetException
        at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:347)
        at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:184)

But unfortunately from the stacktrace I cannot tell where it is coming from. It might have to do with doSummarizerGraphMainMetric, but to be certain I would need to add logging and dive in further. Something unfortunately I don't have much time for right now.

To answer your other question:

Another thing i noticed is that my maven unit test finished at 2017-09-27T16:38:13+02:00
But the test results only show 1 measurement at 16:36:00 should it not make several measurements during the test run? (every minute or so?)

No, this is not the way AppDynamics / the plugin works. Using the REST api, you can request measurements from AppDynamics over a certain time range. This time-range is provided as the Jenkins build time, with a minimum set to Minimum Measure Time (the parameter you can specify). AppDynamics will then calculate averages / summaries etc over this time-range and return it as one set of values. Those are the values the plugin works with.

Thank you for your reply. The Jenkins integration is a very important feature for the automated setup we are trying to create, so unfortunately i cannot use AppDynamics without it.