Go to All Forums

APM Java agent - about tracking errors

Hi all,

I am monitoring my Java app using Site24*7. And I want to add some custom application information to tracking data(e.g. like adding internal transaction id and being able to see that data on monitor). But I could not find a way to do it on documents. Is there a way to add that info?

Also when I use Spring's Controller Advice classes to handle exceptions, my exceptions are not monitored as errors so I can not get java traces for that errors. Is there a way to get trace of those exceptions or to monitor them as errors while using Controller Advice at the same time?


Like (1) Reply
Replies (4)

Re: APM Java agent - about tracking errors


1. Custom instrumentation in Java agent can be achieved using Java annotations. It is at the method level. So, you can move the portion of the code that you want to monitor to a separate method and add annotations, for it to be tracked separately. Refer our help doc https://www.site24x7.com/help/apm/java-agent/custom-instrumentation-using-java-annotations.html for detailed instructions. If you are looking for adding custom metrics / parameters to be tracked, we are yet to support that. But, using this custom instrumentation, you can track any class / method / portion of your java code.

2. Again, Spring controller packages can be included as custom packages in configuration file and you will be able to track those classes and methods.


But, using custom instrumentation will get details in transactions and traces tab. The exception details may not be captured in exceptions tab. We will include these spring controller packages for exception handling and release it in our next update. Will keep this space updated too.

Until then, you can use our custom instrumentation feature for your requirements. Hope this helps.




Like (1) Reply

Re: Re: APM Java agent - about tracking errors

On #2 I'd also like more control over exception logging. With New Relic I could use their java lib to do NewRelic.noticeError(message, exceptionObject), so even if I was handling exceptions in my @ControllerAdvice class or somewhere else I could still have alerts on high error rates.

For example if I failed gracefully on cache errors by going direct to the source, I could still log the exceptions and get an alert about service degradation. Or I could log users hitting rate limits, etc. Is there an alternative route for sending custom errors/metrics to Site24x7 and building alerts on those?

Like (0) Reply

Re: Re: Re: APM Java agent - about tracking errors

API for custom exception tracking is work under progress. It will be available in the upcoming releases.

As an alternative, you can log these exceptions with logging level WARNING/SEVERE/FATAL. Agent will pick up those exceptions along with its stacktrace and list them under the APM application with its respective transaction where it occurred.


Thanks & Regards,


Like (1) Reply

Re: APM Java agent - about tracking errors

Hi all,

API for tracking exception has been released in the latest Java agent v3.5.1. Feel free to use them in your application and start tracking exceptions.

Please follow the instructions available in the help document

Like (0) Reply

Was this post helpful?