DX Application Performance Management

Expand all | Collapse all

How do I use ExceptionErrorReporter?

Jump to Best Answer
  • 1.  How do I use ExceptionErrorReporter?

    Posted 02-02-2011 09:50 AM
    All,

    I tried to implement ExceptionErrorReporter but I'm suspicious that I did it wrong. I don't completely understand the docs.

    I started with this and it works as advertised:

    SetFlag: ABC
    IdentifyMatchingClassesAs: com.mycompany.service.provider.abc.*BindingStub ABC
    TraceComplexMethodsIfFlagged: ABC BackendMarker "Backends|ABC|{packageandclassname}|{method}"
    TurnOn: ABC

    In another file, I added this:

    TraceComplexMethodsIfFlagged: ABC ExceptionErrorReporter "Backends|ABC|{packageandclassname}|{method}:Errors Per Interval"

    I did this for other backends also (weeks ago,) but have never seen Errors Per Interval be anything other than 0. When I made the change, I saw Wily pick it up and process it successfully, according to the logs. There should be some occasional read timeouts and connect exceptions thrown out of the instrumented methods.

    Am I doing this correctly?

    thanks


  • 2.  RE: How do I use ExceptionErrorReporter?

    Broadcom Employee
    Posted 02-02-2011 10:49 AM
    Correct me if I'm wrong, but I believe that ExceptionErrorReporter is supposed to placed in errors.pbd for ErrorDetector's use and not in a custom PBD.

    So just place your custom monitoring there.

    -Hiko


  • 3.  RE: How do I use ExceptionErrorReporter?

    Broadcom Employee
    Posted 02-02-2011 02:13 PM
    John,
    I didn't mean to imply that you couldn't/shouldn't use it. Just make sure to place in errors.pbd so ErrorDetector can use it.

    -Hiko


  • 4.  RE: How do I use ExceptionErrorReporter?

    Posted 02-02-2011 03:32 PM
    I don't know what the Error Detector is, but I moved my definitions to errors.pbd but see no change. I guess something else is wrong.

    thanks


  • 5.  RE: How do I use ExceptionErrorReporter?

    Broadcom Employee
    Posted 02-02-2011 11:25 PM
    ErrorDetector is the plugin that provides all of the error capture capability in the agent.

    Where you able to generate some errors from the method you're wanting to monitor?

    -Hiko


  • 6.  RE: How do I use ExceptionErrorReporter?

    Posted 02-03-2011 11:02 AM
    The number is always 0 and I see exceptions in the log that I think should have registered as errors.

    Does it look like I have the error reported defined correctly? Might I be looking in the wrong place? I'm looking at the Errors Per Interval number that sits alongside the other 4 metrics Average Response Time, Stall Count, etc.

    thanks


  • 7.  RE: How do I use ExceptionErrorReporter?

    Broadcom Employee
    Posted 02-08-2011 02:52 PM
    John,
    Did you get this question answered by support when you opened the ticket on using the BackendMarker?

    -Hiko


  • 8.  RE: How do I use ExceptionErrorReporter?

    Posted 02-14-2011 10:05 AM
    Sounds like the issue is that I need to have the ErrorDetector installed in order for this to work. When I get it installed I'll report back.


  • 9.  RE: How do I use ExceptionErrorReporter?
    Best Answer

    Broadcom Employee
    Posted 02-18-2011 11:22 AM
    John,
    ErrorDetector is installed by default with your agent. There are, however, some details which need more explanation/clarification on the use of this tracer.
    A per interval counter based on the number of exceptions being thrown (i.e. uncaught) from the identified method(s). If an exception is thrown, the error message is based on the return value of the getMessage() method called on the exception object. In order to capture the error message, must be used with a WithParameters Directive, otherwise will only increment the Errors Per Interval metric. To see error messages, requires ErrorDetector, otherwise will only increment the Errors Per Interval metric.
    Make sure you're using one of the WithParameters directives as stated in your errors.pbd. Otherwise you'll have no details within your Errors tab for the event.

    There are examples of the syntax in errors.pbd. For details on descriptors, please refer to section 4.3 of the Sun JVM Specification.

    -Hiko


  • 10.  RE: How do I use ExceptionErrorReporter?

    Posted 06-08-2011 05:46 PM

    hdavis wrote:



    Make sure you're using one of the WithParameters directives as stated in your errors.pbd. Otherwise you'll have no details within your Errors tab for the event.

    -Hiko
    This turned out to be the answer, even if I didn't want or need the parameters. I didn't see it documented anywhere and it's certainly not intuitive, but it works.

    One drawback is that there is no TraceAllMethodsWithParametersOfClass or TraceAllMethodsWithParametersIfInherits, which basically means you can't report errors in those cases. You have to explicitly call out each method of relevant classes.

    thanks


  • 11.  RE: How do I use ExceptionErrorReporter?

    Broadcom Employee
    Posted 06-14-2011 02:57 PM
    Have you tried TraceComplexMethodsWithParametersIfFlagged?

    >
    Traces all public or package-visible non-synthetic methods that call any other method, except constructors (<init>) and static initializers (<clinit>) for classes associated with specified Tracer Group and reports metrics separately by value(s) of parameter(s) passed. The Metric name can include strings like "{#}" that are substituted with the value of the parameter at index # (where 0 is the first parameter, 1 is the second parameter, etc). Synthetic methods are ones that do not appear in the source code and are added by the compiler.

    The expected syntax is "TraceComplexMethodsWithParametersIfFlagged: <Tracer-group> <Tracer-name> <Resource-Metric>".


  • 12.  Re: RE: How do I use ExceptionErrorReporter?

    Posted 08-20-2015 11:50 AM

    Hi,

    After reading the above discussion and the document on ErrorDetector, I have enabled the Error Detector in the agent profile file. Do I need to copy error.pbd at EM home as well as I cannot find any errors under Error Per Interval.

    Though I see the errors tab for that particular agent, I want to trace the standard errors and those mentioned in errors.pbd. I have not done any changes to error.pbd and didn't get what does WithParameters implies.

    Please help.



  • 13.  Re: How do I use ExceptionErrorReporter?

    Posted 08-20-2015 12:39 PM

    Hi pvpalval,

     

     

     

    1)      You don’t need to copy errors.pbd to the EM. The EM has no clue what a pbd file is.

     

    2)      errors.pbd needs to be included in your Agent configuration, so probably in your pbl file (note: it should be there by default)

     

    3)      I’ll give you a simple example of using ExceptionErrorReporter in a pbd file below:

     

    SetFlag: MyCustomTracing

    TurnOn: MyCustomTracing

     

    IdentifyClassAs: com.acme.MyClass MyCustomTracing

     

    TraceOneMethodIFlagged: MyCustomTracing myMethod BlamePointTracer “CustomTracing|{classname}|{method}"

    TraceOneMethodWithParametersIFlagged: MyCustomTracing myMethod ExceptionErrorReporter “CustomTracing|{classname}|{method}:Errors Per Interval”

     

     

    Regards,

     

    Florian.

     

    (Message edited to restore the content between {} that was removed when I posted by email, thx Guenter for catching that)



  • 14.  Re: How do I use ExceptionErrorReporter?

    Broadcom Employee
    Posted 08-20-2015 01:01 PM

    Small correction:

     

    TraceOneMethodIfFlagged: MyCustomTracing myMethod BlamePointTracer “CustomTracing|{packageandclassname}|{method}

    TraceOneMethodWithParametersIFlagged: MyCustomTracing myMethod ErrorExceptionReporter “CustomTracing|{packageandclassname}|{method}:Errors Per Interval”

     

    The "WithParameters" is needed so we can catch the exception - otherwise exception information will not be passed to ErrorExceptionReporter and therefore it will report - nothing!

     

    ProbeBuilder directives and tracer types are described in Lists of PBDs, Metrics, and Tracers - CA Application Performance Management - 10.0 - CA Wiki

     

    If something is missing from the documentation please add a comment in the Wiki and our tech pub team will be notified and take action!

     

    Ciao,

    Guenter



  • 15.  Re: How do I use ExceptionErrorReporter?

    Posted 08-20-2015 01:54 PM

    Hi,

    But this will give me only the count of the particular class or method I assume and not the exact errors with names. Also there are some, mentioned in error.pbd for servlets, jsps, etc. So are you saying that I have to add the class and methods to the error.pbd according to the above mentioned format whichever I want to monitor for errors.

     

    Also what errors will be shown under Errors Per Interval just by including error.pbd as it is without any modifications?



  • 16.  Re: How do I use ExceptionErrorReporter?

    Broadcom Employee
    Posted 08-20-2015 03:11 PM

    errors.pbd (and the corresponding ErrorDetector component on the EM) are active OOTB for Servlets, JSPs, etc. Also http errors are caught and reported. If an error occurs you get:

    1. Errors Per Interval metric increased
    2. Errors event under "errors" tab (there's a clamp on the maximum number of errors reported by interval, you will see a message in the agent log if it is reached).
    3. Stack trace with error in "traces" tab

    You can see the error message (if properly implemented in the exception) in the error event and as a property in the stack trace.

     

    Only if you want to report errors in custom classes that are not covered by the OOTB errors.pbd then put your error tracer definitions in a separate pbd (not errors.pbd!).

     

    There are several error tracers available: ExceptionErrorReporter, HTTPErrorCodeReporter, MethodCalledErrorReporter and ThisErrorReporter

    Each one of them works differently but all report errors. Consult the docs to see how each of the works.

    Hiko_Davis already quoted the dosc above:

    ExceptionErrorReporter: A per interval counter based on the number of exceptions being thrown (i.e. uncaught) from the identified method(s). If an exception is thrown, the error message is based on the return value of the getMessage() method called on the exception object.

    That means ExceptionErrorReporter reports all exceptions being thrown from the instrumented method. If an exception is handled with a catch-block in the method it won't be reported. Then you would have to instrument the method that is called and throws the error.

     

    Ciao,

    Guenter



  • 17.  Re: How do I use ExceptionErrorReporter?

    Posted 09-02-2015 06:35 AM

    Hi Guenter_Grossberger, Hiko_Davis,

    Please confirm if the custom pbd created for error handling should be placed in error.pbd or not. I did the following but still I cannot see Errors Per Interval count increasing though I see the errors in fuse logs.

    1. Error Detector was already enabled that is error.pbd is included in PBL file and introscope.agent.errorsnapshots.enable=true was already true in profile file.

    2. Created separate custom pbd for tracing errors using ExceptionErrorReporter with WithParameters directive and placed it in hotdeploy folder. Autoprobe.log has successfully loaded my tracers and no errors around it.

    3. Created error scenerios but couldn't see Errors Per Interval to be increasing.

     

    Please let me know if am doing any mistake.

    ExceptionErrorReporter: A per interval counter based on the number of exceptions being thrown (i.e. uncaught) from the identified method(s). If an exception is thrown, the error message is based on the return value of the getMessage() method called on the exception object.

    That means ExceptionErrorReporter reports all exceptions being thrown from the instrumented method. If an exception is handled with a catch-block in the method it won't be reported. Then you would have to instrument the method that is called and throws the error.

    Also considering the above lines, only uncaught exceptions are reported, I didn't get this as we want all the errors to be reported and if not the error message, will it not increment the Errors Per Interval as well ?



  • 18.  Re: How do I use ExceptionErrorReporter?

    Broadcom Employee
    Posted 09-02-2015 01:05 PM

    Hi,

     

    I would strongly suggest to leave the original errors.pbd untouched and put all your custom tracers in a separate pbd. See Instrumentation Best Practices:

    1. Create a file <application>.pbl and reference this <application>.pbl in the introscope.autoprobe.directivesFile property in your IntroscopeAgent.profile. This relieves you of the need to update the profile.
    2. Reference your custom pbds in your <application>.pbl. You can add any number of pbd files independently of the profile. E.g. one application-error.pbd for custom error detection.
    3. Separate the TurnOn directives into a <application>-toggles.pbd (and reference that in your <application>.pbl)

     

    pvpalval wrote:

     

    That means ExceptionErrorReporter reports all exceptions being thrown from the instrumented method. If an exception is handled with a catch-block in the method it won't be reported. Then you would have to instrument the method that is called and throws the error.

    Also considering the above lines, only uncaught exceptions are reported, I didn't get this as we want all the errors to be reported and if not the error message, will it not increment the Errors Per Interval as well ?

    Yes. If an exception is caught and handled inside a method we don't see view and report this as an error. If we would report all thrown exceptions it would not be manageable.

     

    As I wrote above

    There are several error tracers available: ExceptionErrorReporter, HTTPErrorCodeReporter, MethodCalledErrorReporterand ThisErrorReporter

    Each one of them works differently but all report errors. Consult the docs to see how each of the works.

    In your case you will probably use one of those:

    • ThisErrorReporter: Traces the number of exceptions thrown (caught or uncaught) per interval by tracing the constructor of the specified exception class(es). The error message is based on the return value of the toString() method of the exception object. Recommended for custom exceptions. In order to capture the error message, must be used with a *WithParameters* Directive, otherwise will only increment the Errors Per Interval metric. Default Metric Name: Errors Per Interval
    • MethodCalledErrorReporter: A per interval counter based on methods where the very act of the method being called means that an error has occurred. The error message is based on the class and method called. In order to capture the error message, must be used with a *WithParameters* Directive and requires ErrorDetector, otherwise will only increment the Errors Per Interval metric. Default Metric Name: Errors Per Interval

     

    Usage:

    # report exception thrown from MyController.handle(), Error message = e.getMessage()
    TraceOneMethodWithParametersOfClass: com.ca.MyController handle ExceptionErrorReporter “My|Controller|Had|An|Error:Errors Per Interval”
    
    # report creation of com.ca.MyCustomException, Error message = e.toString()
    TraceOneMethodWithParametersOfClass: com.ca.MyCustomException <init> ThisErrorReporter "My|Exception|Was|Invoked:Errors Per Interval"
    
    # report invocation of MyController.onError(), Error message =~ "MyController.onError()"
    TraceOneMethodWithParametersOfClass: com.ca.MyController onError MethodCalledErrorReporter “My|Controller|onError|Was|Invoked:Errors Per Interval"
    
    

     

    Ciao,

    Guenter



  • 19.  Re: How do I use ExceptionErrorReporter?

    Posted 09-08-2015 01:01 PM

    Hi Guenter,

    Thanks for support. I implemented the Error Tracers over a method which throws exception and could get the count of errors incrementing under Errors Per Interval as well as error message in errors tab.

     

    But I have to implement one more method which does not throw errors or exceptions, instead the number of times that method is called or invoked == the number/count of errors.

    Please let me know how should I proceed to implement this.



  • 20.  Re: How do I use ExceptionErrorReporter?

    Broadcom Employee
    Posted 09-08-2015 08:41 PM

    Hi,

     

    that's exactly what MethodCalledErrorReporter is for!

     

    Ciao,

    Guenter



  • 21.  Re: How do I use ExceptionErrorReporter?

    Posted 09-09-2015 04:45 AM

    Hi,

    I tried using MethodCalledErrorReporter for that method but couldn't get any metrics for the same.

    How shall I find what is going wrong ?



  • 22.  Re: How do I use ExceptionErrorReporter?

    Posted 09-09-2015 05:18 AM

    Did you see that method being instrumented with the MethodCalledErrorReporter tracer in the Autoprobe.log?



  • 23.  Re: How do I use ExceptionErrorReporter?

    Posted 09-09-2015 05:28 AM

    Hi Guenter,

    The flow of the exception code is, for each and every service a proxy exception class is set which in turn calls the Abstract Exception class and its method.

    So if the exception for particular service is called, that proxy class (eg. ExceptionHandler) will be called which in turn will call the AbstractExceptionHandler class and its method.

     

    Please help how should I implement this.



  • 24.  Re: How do I use ExceptionErrorReporter?

    Posted 09-09-2015 05:37 AM

    Hi pvpalval,

     

    I'm not Guenter, Guenter_Grossberger is Guenter

     

    In which class is the actual method code that you want to instrument defined? The proxy one or the abstract one? Remember we use Bytecode instrumentation, so the Agent needs to modify the bytecode of the class method to put its callbacks in place, so you need to instruct it to instrument the class/method where the actual code is defined/run.

     

    Regs,

     

    Florian.



  • 25.  Re: How do I use ExceptionErrorReporter?

    Posted 09-09-2015 06:08 AM

    Hi,

    Consider there are 10 services and each service has a proxy class. When exception is thrown for particular service, proxy class for that exception is called. All proxy class extends Abstract class and abstract class's method (process) will be called at the end.



  • 26.  Re: How do I use ExceptionErrorReporter?

    Posted 09-09-2015 07:57 AM

    Ok, but in which class is the actual method body implementation? In the proxy one or in the abstract class?



  • 27.  Re: How do I use ExceptionErrorReporter?

    Posted 09-09-2015 09:51 AM

    Abstract class...



  • 28.  Re: How do I use ExceptionErrorReporter?

    Posted 09-09-2015 10:59 AM

    Ok, so then you have to put the MethodCalledErrorReporter tracer on the abstract class method

     

    TraceOneMethodWithParametersOfClass: com.acme.MyAbstractClass myMethod MethodCalledErrorReporter “Custom||:Errors Per Interval”

     

    Is this what you have done?



  • 29.  Re: How do I use ExceptionErrorReporter?

    Posted 11-03-2015 08:40 AM

    Hi,

    I could get the count of errors by using MethodCalledErrorReporter for the exception class earlier.

    But suddenly its not working and I am getting the below errors in log. Please can you help.

     

    [WARN] [IntroscopeAgent.ErrorFeature] decorateTransactionsWithError fails with null tcs. need to configure a tracer that creates tcs

    [ERROR] [IntroscopeAgent.Agent] Exception finishing method tracer for *.*.*.BaseResultSet.close

    [ERROR] [IntroscopeAgent.Agent] Exception finishing method tracer for *.*.*.ResultSetJavassistProxy.close

     

    Also I am getting many info messages as below :

    [INFO] [IntroscopeAgent.SOA] Configuration property set to default value of "1000"

     

    Even the Frontends and WebServices node is not getting activated, even if many requests are sent and I can see the same from SOAP UI.



  • 30.  Re: How do I use ExceptionErrorReporter?

    Posted 11-05-2015 03:00 AM

    Hi,

    Can someone help me with this please ?



  • 31.  Re: How do I use ExceptionErrorReporter?

    Broadcom Employee
    Posted 11-05-2015 11:13 AM

    Hi,

     

    decorateTransactionsWithError fails with null tcs means that an internal data structure (tcs) was missing when the error tracer tried to send its information.

     

    Did you change other tracers? If neither Frontends nor Webservices show up that usually means that there was an error loading the configuration. Are there any other errors in the IntroscopeAgent.log or AutoProbe.log?

     

    Ciao,

    Guenter



  • 32.  Re: How do I use ExceptionErrorReporter?

    Posted 11-09-2015 06:04 AM

    Hi Guenter,

    I made some changes, now am not getting the warning around tcs. Introscope.log contains info as directives loaded successfully.

    But Introscope.log contains many errors as mentioned below.

     

    [ERROR] [IntroscopeAgent.Agent] Exception finishing method tracer for *.*.*.BaseResultSet.close

    [ERROR] [IntroscopeAgent.Agent] Exception finishing method tracer for *.*.*.ResultSetJavassistProxy.close

     

    Can you please help.



  • 33.  Re: How do I use ExceptionErrorReporter?

    Broadcom Employee
    Posted 11-09-2015 11:48 AM

    Hi,

     

    check the Autoprobe log which tracers are instrumenting those classes. Some of those are not compatible with the class/version you are using. Remove all tracers on method and add them one by one to find the culprit.

     

    Ciao,

    Guenter



  • 34.  Re: How do I use ExceptionErrorReporter?

    Posted 11-16-2015 09:51 AM

    Hi Guenter,

    I tried implementing the error tracers one by one. What I observed is the tracers work well on the environment where Fuse fieldpack is installed.

    But it don't when I try to implement the same on other environment where Fuse fieldpack is not installed. I was of opinion that error handling is not related to fieldpack, but as soon as I reference my custom error pbl in profile file all the Frontends and WebServices don't show any data.

     

    Is the error reporting related to fieldpack ?



  • 35.  Re: How do I use ExceptionErrorReporter?

    Broadcom Employee
    Posted 11-18-2015 01:41 PM

    If the FP is the one responsible for flagging your packages/classes for instrumentation, then that would make sense why you see nothing when you don't have the FP deployed.



  • 36.  Re: How do I use ExceptionErrorReporter?

    Broadcom Employee
    Posted 11-18-2015 01:42 PM

    You're going to need to share with us the logs and any PBDs you have created.

    Otherwise, you will need to open ticket now as it's become more complex than something that can be handled on this forum.



  • 37.  Re: How do I use ExceptionErrorReporter?

    Posted 11-18-2015 04:58 AM

    Hi Guenter,

    I have implemented 20 exceptions, but all the exceptions have same class name and method name. Only the package name is different.

    What I observed is, when I hit one service exception I can see the same data under all other exceptions. And when I hit other service exceptions, I cannot see any data of that.

    Need Help.