cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Not a customer? Start a free trial

Click the Start a free trial link to start a 15-day SaaS trial of our product and join our community as a trial user. If you are an existing customer do not start a free trial.

AppDynamics customers and established members should click the sign in button to authenticate.

Java (Java Agent, Installation, JVM, and Controller Installation)

Getter Chain

Maria.Garcia
Builder

Getter Chain

Hi team,

 

We have the following custom code created in order to monitor calls to IBM MQs:

...

private String component, process, activity, sentTo, origin, message, response;

public String init(String component, String process, String activity, String payload, String regex, String queueOrigin) {

 

That method returns a "message".

 

Then the following "get" methods have been created for each case, for example to capture the size of the message:

 

...

           public int getMessageSizeBytes(){

            return message.getBytes().length;

      }

...

How to use them as getter chains to capture those information on Data Collectors? How to capture the result of getMessageSizeBytes?

I mean, the first method returns a message, that is already captured but... how to obtain its size?

The method getMessageSizeBytes is already added on the code, but the getter chain is not capturing that value...

Which configuration should be used? Please kindly check attached image

Thanks!

By replying you agree to the Terms and Conditions of the AppDynamics Community.
Getter Chain
14 REPLIES 14
Alex.Fedotyev
AppDynamics Team

Do you have a way to try these?

I think following should just work:

 

1. private bool SendBulkOrders(List<Order> orders) {}

DataCollector for method SendBulkOrders collecting Parameter 0.

Getter chain: [0].BucketId

(If you have a class which has a property type of List, then you would need to do something like "MyProperty.[0].BucketId")

 

 

2. private bool SendObject(Object sender) {}

Again,DataCollector for method SendObject collecting Parameter 0.

Getter chain: EmpId

Internally agent should be aware of the runtime type of the parameter, therefore I don't think you need to cast it in the getter chain.

 

 

Let me know if this doesn't work, I'll look up further.

 

 

Thanks,

-Alex

 

 

PS: If you leave the medhod body empty, .NET may optimize your method... in that case it is a good idea to add couple attributes like explained here: https://stackoverflow.com/questions/38632939/disable-compiler-optimisation-for-a-specific-function-o...

Narendra.Agarwal
Explorer

For .net property if i just use  ParamIndex_0.ClOrdID then value capture in Business transaction snapshot is showing just "[]" .. i sse data is collected but value [] does not make sense. Do i have to call toString()

Alex.Fedotyev
AppDynamics Team

Can you attach some screenshots of configuration and what you see in snapshots?

I suspect if you see [...], that means that the method you instrumented might be called multiple times per transaction.

You don't need ToString(), agent does it internally anyway to serialized non-string types.

Narendra.Agarwal
Explorer

1. private bool SendBulkOrders(List<Order> orders) {}

DataCollector for method SendBulkOrders collecting Parameter 0.

Getter chain: [0].BucketId

(If you have a class which has a property type of List, then you would need to do something like "MyProperty.[0].BucketId")

 

Above example does not work. getting error: [CANNOT EVALUATE: Error getting data from specified method paramter]   .. i am using  Getter chain: [0].BucketId  which ultimately tranlated into ParamIndex_0.[0].BucketId

Bhushan.Shinde
Explorer

Hi AppD team,

 

I'm working on few business use cases where requirement is to pull the value from request POST body of .Net web API.

Below is the sample code snapshot,

// POST api/wow
[RequestHandler]
public HttpResponseMessage Post([FromBody]dynamic requestInput)
{
try
{}

 

i need to get one of the body parameter value (string) of requestInput.

I'm doing this POC using Method Invocation Data Collectors and Information Points using Getter chain.

Can you guide me to achieve this task please.