Plugins for Health Monitoring Tool
Adding New Plugins to Health Monitor
You can add new plugins that add additional checks that might affect the application’s health. For example, you can create a plugin that interacts with an external integration, such as an ESB (Enterprise Service Bus) or payment gateway.
Create a Spring configuration file in the
epmonitoring.xml
file at/extensions/integration/ext-integration-webapp/src/main/webapp/WEB-INF/spring/monitoring
.Add beans for each of the new
StatusCheckerTarget
classes to this file.To register the new beans, add them to one of the two lists used by the
StatusChecker
class.You must add them to the
ep-health-monitoring-<WEBAPP>.xml
file, where<WEBAPP>
is name of your webapp, that is available only in your webapp. You must also add this file to yourelastic-path-servlet.xml
context.
note
Spring does merge lists. To add new values you must override the existing list, including all of its default values. The default values are:
<util:list id="loadBalancerStatusCheckerTargetList" scope="prototype">
<ref bean="applicationStatusCheckerTarget"/>
<ref bean="databaseStatusCheckerTarget"/>
</util:list>
<util:list id="additionalInfoStatusCheckerTargetList" scope="prototype">
</util:list>
Do not add the new beans to the ep-health-monitoring-plugin.xml
file, because each webapp might have a different list of the touch points.
When a load balancer starts the status checker, using the URL /status/lb
, only the status checker targets in loadBalancerStatusCheckerTargetList
are examined. This list should therefore only contain status checker targets that can instruct a load balancer to stop sending traffic to a given node.
When any of the info URLs are invoked, such as /status/info.html
or /status/info.json
, the status checker targets in both lists are examined.
Monitoring plug-in
You can add a new monitoring plugin to monitor a webapp based on the availability of specific resource to declare that the webapp is down if resource is unavailable.
When the /status/lb
URL is requested for a webapp, if a health monitoring plug-in is available to check resource, the plug-in is configured for webapp,and the resource is available, an HTTP status 200
is returned.
When the /status/lb
URL is requested for webapp, if a health monitoring plugin is available to check the resource, the plugin is configured for webapp, and resource is unavailable, an HTTP status 503
is returned.
Information plug-in
You can use health monitoring to diagnose the infrastructure issues by querying a webapp to determine the availability of a specific resource.
note
An information plug-in affects only the info requests /status/info.json
and /status/info.html
, and has no effect on monitoring requests.
When the webapp requests the /status/info.html
URL,if a health monitoring plug-in is available to check the resource and the plug-in is configured for the webapp:
- If the resource is available: An HTTP page is returned showing that the resource is available
- If the resource is unavailable: An HTTP page is returned showing that the resource is unavailable
- If the resource in unavailable and does not affect monitoring: An HTTP status
200
is returned