Capture and expose system exception statistics in Mule using Coda Hale Metrics
This article describes how to use the Coda Hale metrics library to capture the counts and types of system exceptions thrown outside of Mule ESB flow processing. Historical exception information is exposed via JMX or written to disk using CodaHale reporters as described on the CodaHale metrics web site . You can use this same technique in any Java application. We inject instrumentation at the system context level. That component converts the wrapped exception stack to a counter name that is then created and incremented in the Coda Hale registry. I use the simple running counter because I don't find the native Coda Hale histogram data useful for this type of metric. You can use other metric types if you want more complex statistics. Components We use 2 injection components 2 codahale components and a custom listener to make this work: MetricsRegistry: A CodaHale singleton that maintains a reference to all statistics. It is injecte...