DX Application Performance Management

Expand all | Collapse all

ConditionallyTraceOneMethodWithLabelOfClass help implementing

Hallett German

Hallett GermanSep 05, 2017 10:53 AM

Haruhiko Davis

Haruhiko DavisSep 05, 2017 01:40 PM

  • 1.  ConditionallyTraceOneMethodWithLabelOfClass help implementing

    Posted Sep 05, 2017 10:11 AM

    The expected syntax is "ConditionallyTraceOneMethodWithLabelOfClass: <class-name> <method> <label> <Tracer-name> <Tracer-group> <Resource-Metric> <calling-class> <calling-method>".

     

    This directive is a little confusing. It contains both the class-name and the tracer-group. If it contains the tracer-group, the class-name is not usually supplied (included in the IdentifyClassAs directive). Also, the directive would be IfFlagged. But, if you include the class-name, there should be no tracer-group. This directive does not follow the normal convention/syntax.

     

    With both class-name and tracer-group required, do we have to duplicate the class-name and use an IdentifyClassAs directive to get a  tracer group?

     

    Either way, we cannot get this metric to work without an error. Can someone provide a working example.

     

    Thanks,

     

    Mike

     

    #directive



  • 2.  Re: ConditionallyTraceOneMethodWithLabelOfClass help implementing

    Broadcom Employee
    Posted Sep 05, 2017 10:53 AM

    Sharing in Developer APM Group as well.



  • 3.  Re: ConditionallyTraceOneMethodWithLabelOfClass help implementing

    Broadcom Employee
    Posted Sep 05, 2017 12:13 PM

    The description of the directive is this:

     

    "Traces a specific method of the specified class, conditionally to the fact that the calling method in the calling class is part of the Thread stack. The specified class or interface should be the fully qualified name. The label parameter assigned to the tracer is used for query by Dynamic Instrumentation (DI) API. Supported on Java & .NET Agents.”

     

    You need to fully qualify the class or interface so that it can be properly identified by DI from the calling method.



  • 4.  Re: ConditionallyTraceOneMethodWithLabelOfClass help implementing

    Posted Sep 05, 2017 12:19 PM

    Here is our pbd info. Everything is fully qualified.

     

    IdentifyClassAs: ca.events.EventExceptionHandler Tracer_group_typical

     

    ConditionallyTraceOneMethodWithLabelOfClass: ca.events.EventExceptionHandler handleException handleExceptionOnMdb PerIntervalCounter Tracer_group_typical "Application-code|{classname}|{method} from MDB:Invocations per interval" ca.events.AbstractInboundEventMDB processMessage



  • 5.  Re: ConditionallyTraceOneMethodWithLabelOfClass help implementing

    Broadcom Employee
    Posted Sep 05, 2017 12:37 PM

    Make sure you escape any spaces, like the one in your Resource-Metric.



  • 6.  Re: ConditionallyTraceOneMethodWithLabelOfClass help implementing

    Posted Sep 05, 2017 12:52 PM

    If I leave the tracer group out, I get an error stating only 7 of 8 parameters are included. If I add the tracer group in, I get this error:

     

    *************

    Unable to instrument.  Invalid settings provided: 3 Can't proceed because (/test.pbd:41) the specified tracer class "Tracer_group_typical" is invalid.

    *************

     



  • 7.  Re: ConditionallyTraceOneMethodWithLabelOfClass help implementing

    Broadcom Employee
    Posted Sep 05, 2017 01:08 PM

    Tracer group is required. What does your autoprobe log say when you leave it in? do you see your methods being processed?



  • 8.  Re: ConditionallyTraceOneMethodWithLabelOfClass help implementing

    Posted Sep 05, 2017 01:25 PM

    It starts to load the pbd files and when it gets to that one, it fails with the error above.



  • 9.  Re: ConditionallyTraceOneMethodWithLabelOfClass help implementing

    Broadcom Employee
    Posted Sep 05, 2017 01:27 PM

    Did you see my response about escaping spaces in your Resource-Metric?



  • 10.  Re: ConditionallyTraceOneMethodWithLabelOfClass help implementing

    Broadcom Employee
    Posted Sep 05, 2017 01:40 PM

    Guenter_Grossberger any thoughts on this request?



  • 11.  Re: ConditionallyTraceOneMethodWithLabelOfClass help implementing

    Posted Sep 05, 2017 01:40 PM

    Yes I did. But as per the documentation, you can have spaces as long as they are in quotes.

     

    Metric names are allowed to have spaces, and all spaces in metric names must be contained within quotes. For example, the metric name "{classname}|Test One Node"

     

    But, I wonder if there should be a pipe | after the {method} and before  from MDB

     

    For example:

     

    "{method} from MDB"

    vs

    "{method}|from MDB"



  • 12.  Re: ConditionallyTraceOneMethodWithLabelOfClass help implementing

    Broadcom Employee
    Posted Sep 05, 2017 01:42 PM

    I can't tell that without a screen capture of you typing the whole path in a reply for evaluation.



  • 13.  Re: ConditionallyTraceOneMethodWithLabelOfClass help implementing

    Posted Sep 06, 2017 03:45 PM

    I but a pipe after the method argtument and it still did not work.

     

    {method}|fromMDB

     

    I still get the same error:

    *************

    Unable to instrument.  Invalid settings provided: 3 Can't proceed because (/test.pbd:41) the specified tracer class "Tracer_group_typical" is invalid.

    *************



  • 14.  Re: ConditionallyTraceOneMethodWithLabelOfClass help implementing

    Broadcom Employee
    Posted Sep 06, 2017 03:59 PM

    Can you show us what this metric looks like in the Investigator? I'm trying to get a feel for the full metric path.

    In your previous example, wasn't there a space between "from" and "MDB"?



  • 15.  Re: ConditionallyTraceOneMethodWithLabelOfClass help implementing

    Posted Sep 06, 2017 04:03 PM

    I took the spaces out and also added the pipe. There is nothing in the investigator because instrumentation loading halts at the error.



  • 16.  Re: ConditionallyTraceOneMethodWithLabelOfClass help implementing

    Broadcom Employee
    Posted Sep 06, 2017 04:10 PM

    Never mind; it's 15:00 and I've apparently not had enough coffee.

    Is there a particular reason you want to use this directive over another "IfFlagged" directive?

    Did you set the tracer group using "SetFlag:" and turn on the group using "TurnOn:"?



  • 17.  Re: ConditionallyTraceOneMethodWithLabelOfClass help implementing

    Posted Sep 06, 2017 04:19 PM

    This directive is interesting as it will only capture metrics when a specific class/method calls the target method. A regular directive will capture all calls to the method regardless of origin. Maybe we will have to do some other type of work

    around.

     

    Yes, the set flag is turned on in a toggle file. The other instrumentation in the pbd loaded and worked fine until I add this directive.

     

    Note: I tried it without the IdentifyClassAs directive and I still get the same error. If I leave out the tracer group, I will get Not enough arguments error - 7 supplied and needed 8.



  • 18.  Re: ConditionallyTraceOneMethodWithLabelOfClass help implementing

    Broadcom Employee
    Posted Sep 06, 2017 04:24 PM

    I just sent you a private message. It might be easier if we work on this offline and post the results when we have it working.



  • 19.  Re: ConditionallyTraceOneMethodWithLabelOfClass help implementing

    Broadcom Employee
    Posted Sep 06, 2017 07:55 PM

    Current research shows that these two directives are meant to be used for Dynamic Instrumentation (DI) of deep trace components (DTC).

    Assumptions are that users would be using transaction trace sessions, live and historical trace events, to view the details and to enable temporary or permanent instrumentation on these components. If you choose to make it permanent, custom.pbd will be available in the hotdeploy folder of your agent and then you will see that the instrumentation actually uses TraceOneMethodWithLabelOfClass, not ConditionallyTraceOneMethodWithLabelOfClass.

    I'll check internally to see when you might actually create something manually since the trace group appears to be fetched automatically by AutoProbe.



  • 20.  Re: ConditionallyTraceOneMethodWithLabelOfClass help implementing

    Broadcom Employee
    Posted Sep 08, 2017 03:15 PM

    Hi,


    phrodon wrote:

     

    I still get the same error:

    *************

    Unable to instrument.  Invalid settings provided: 3 Can't proceed because (/test.pbd:41) the specified tracer class "Tracer_group_typical" is invalid.

    *************

    The error message gives an indication of the problem. The "Tracer_group_typical" is interpreted as the tracer class. The ordering of the parameters is documented wrong.

     

    I looked up the code and it is:

    ConditionallyTraceOneMethodWithLabelOfClass: <class-name> <method> <label> <Tracer-group> <Tracer-name><Resource-Metric> <calling-class> <calling-method>

     

    Ciao,

    Guenter



  • 21.  Re: ConditionallyTraceOneMethodWithLabelOfClass help implementing

    Posted Sep 11, 2017 03:26 PM

    Yes!!! That worked. We also had to use a BlamePointTracer.

     

    CA should update their online documentation.

     

    Thanks again!



  • 22.  Re: ConditionallyTraceOneMethodWithLabelOfClass help implementing

    Broadcom Employee
    Posted Sep 13, 2017 09:05 AM

    Dear Michael:

    >CA should update their online documentation.

    I read your note and forwarded to the APM Tech Docs folks. It is assigned to someone already. 

    Thanks

    Hal German



  • 23.  Re: ConditionallyTraceOneMethodWithLabelOfClass help implementing

    Broadcom Employee
    Posted Sep 05, 2017 01:42 PM

    You will need a pipe is there is another branch in the metric path.