TraceOneMethodWithParametersOfClass does not map parameter value
search cancel

TraceOneMethodWithParametersOfClass does not map parameter value

book

Article ID: 105806

calendar_today

Updated On:

Products

CA Application Performance Management Agent (APM / Wily / Introscope) INTROSCOPE

Issue/Introduction

I implemented a PBD to map the values of a specific parameter of the classes of the application that we monitor, but for some methods the parameter is not mapped even generating tests calls. Instead, seeing the Introscope names with the configured index position: 

Example: 
User is offline 
Method: myMethod (int param1, int param2) 
Parameter configured in PBD: {1} 

Return on Introscope: 
Test -> 
myClass -> 
myMethod -> 
{1} -> 
Average Response Time (ms) 
Concurrent Invocations 
Errors Per Interval 
Responses Per Interval 
Stall Count 

Expected return: 
Test -> 
myClass -> 
myMethod -> 
ParamValue1 -> 
Average Response Time (ms) 
Concurrent Invocations 
Errors Per Interval 
Responses Per Interval 
Stall Count 
ParamValue2 -> 
Average Response Time (ms) 
Concurrent Invocations 
,

Environment

All supported APM releases.

Cause

Not putting the JNI signatures on the method to exactly match the method which has the parameter and not the one which does not have.  

Resolution

Development found the problem and the solution.

This quick test works  

Three methods are defined:


public static void method(){      

        method("Invocation1");  

}  

public static void method(String s1){   

        method("Invocation2", "Invocation1");  

}  

public static void method(String s1, String s2){       

}  

   

Since we are putting only the first parameter and the overloaded method which does not have the parameter will resolve to placeholder itself.  

   
So to have exact result you need is to put the JNI signatures on the method to exactly match the method which has the parameter and not the one which does not have it.  

 

Additional Information

From the links in additional /information:

https://community.broadcom.com/enterprisesoftware/viewdocument/instrumentation-best-practices

Important Note:  If you are unclear about what string the parameter will be converted to, do not use it in the metric name.  

When creating a “WithParameters” Tracer in Introscope, you will use the JNI notation of the method signature. For instructions on writing this signature, see the JNI Signatures page. Certain tracers, like the custom ConditionalMethodTraceIncrementor tracer, require that the WithParameters and JNI notation be used.  Please refer to the "Tracer Types" page for more details.