Go to All Forums

APM Java agent - about tracking errors

by ceb1

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?

Thanks!

Reply 1
Replies (3)

Re: APM Java agent - about tracking errors

by Raji

Hi,

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.

https://www.site24x7.com/help/apm/java-agent/custom-instrumentation.html  

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.

 

Regards,
Raji.

 

Reply 1

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?

Reply 0

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,

Adhi

Reply 1