Splunk AppDynamics

Java Data Collector method getter chain

CommunityUser
Splunk Employee
Splunk Employee

Hey,

I hope this is possible because this would be so awesome for our Application Monitoring.

So our API returns an object that contains a List of that I need the last element. So I created a getter chain like this for testing of the first element:

getBody().getRoute().get(int/0).getLength()

and this worked.

My problem is that I can't seem to get the correct syntax right on how to get the last element. My last tries were the following:

getBody().getRoute().get(int/ReturnValue.getBody().getRoute().size()-1).getLength()

getBody().getRoute().get(int/this.getBody().getRoute().size()-1).getLength()

In both cases the Data Collector displays: 

[CANNOT EVALUATE: Error getting data from specified method parameter]

Is there something I'm missing? Or is this simply not possible?

Kind regards

Labels (1)
0 Karma
1 Solution

Peter_Holditch
Builder

@Anonymous 

I'm afraid it is only possible to pass constant parameter values to methods in getter chains so there is no way to achieve what you want by this route.

Is there any way you can change the application code to programatically collect the data you need using the java agent API?

Warm regards,

Peter

View solution in original post

Peter_Holditch
Builder

@Anonymous 

I'm afraid it is only possible to pass constant parameter values to methods in getter chains so there is no way to achieve what you want by this route.

Is there any way you can change the application code to programatically collect the data you need using the java agent API?

Warm regards,

Peter

CommunityUser
Splunk Employee
Splunk Employee

Hi @Peter.Holditch,

I was afraid that would be the case, so I left this matter be.

Fortunatelly I have acces to the code and can make adjustments. But it would have been nice if AppDynamics was able to do what I tried to do.

Kind regards

Get Updates on the Splunk Community!

Fueling your curiosity with new Splunk ILT and eLearning courses

At Splunk Education, we’re driven by curiosity—both ours and yours! That’s why we’re committed to delivering ...

Splunk AI Assistant for SPL 1.1.0 | Now Personalized to Your Environment for Greater ...

Splunk AI Assistant for SPL has transformed how users interact with Splunk, making it easier than ever to ...

Unleash Unified Security and Observability with Splunk Cloud Platform

     Now Available on Microsoft AzureOn Demand Now Step boldly into the AI revolution with enhanced security ...