Automon is an open source project that combines the power of AOP (using AspectJ) with any monitoring or logging tools you already use to declaratively monitor your Java methods for performance and any exceptions they may throw.
Automon let’s you control ‘what’ you want to monitor indepedently from the tool that you use to monitor (‘how’). This makes it easy to swap between monitoring tools such as Jamon, Yammer metrics, New Relic, StatsD, JavaSimon or your own implementation. Automon defers to these tools to time methods and count exceptions.
The other powerful part of Automon is that it uses AspectJ at runtime to allow you to declaratively determine what to monitor via an xml configuration file. You do this by defining AspectJ ’pointcuts’ in the config file. 'Pointcuts' match the code you want to monitor, and work similarly to regular expressions. For example to monitor your Rest api you might specify the following pointcut that will monitor all public methods in a rest package:
For more information see http://www.automon.org
. The best way to get started is to look in the examples directory available here: https://github.com/stevensouza/automon/tree/master/examples
. It is also available on Maven.