'Approach For Adding Monitoring To Web Application With Spring Actuator

I am adding custom spring actuator endpoint to our web application for monitoring. In addition to "info" and "healthcheck", I am looking at the best way to design the metrics of the application apis (SOAP, REST, etc). I am wondering the best way to design the metrics. My first thought was to have custom tags on a timer that would allow searching like:

  • api : (soap, rest,...)
  • server : name of the server
  • endpoint : (web service name ..controller or wsdl)
  • invocation : name of service invoked.

This would allow us to monitor and drill down by the tags. However, I have a few questions about this approach:

  1. Are timers best constructed on the fly or upfront (as beans we can inject)
  2. Do I need a separate Timer for each web service invocation? Since tags are specified at timer construction time, that would require separate timers for each invocation. I did not see a way to dynamically set tags as part of Timer api.
  3. How much overhead does this add to the system?
  4. If endpoint is not exposed (via properties), does that remove the overhead?
  5. How do we set the time duration for the Timers? (for example, we want to see the values for the last hour.)

Thanks for any insight or experiences in this area?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source