Alerting

Alerting is the most desirable feature in monitoring and is very important for a critical production system like an ESB. While alerts has to be real-time it shouldn’t increase an overhead on the usual message processing tasks. The main advantage of the Alerting implementation of the UltraESB is that it is built-in and is capable of handling many of the alerting criteria of an advanced monitoring and alerting system.

The alerting module of UltraESB is very tightly coupled with its metrics implementation and can be easily configured via a JSON based configuration. You could also add alert configurations from the programmable API of the UltraESB, via interceptors or a custom plugin.

This guide walks you through the configuration of alerts, its architecture and alert actions including notifications as well.

At the end of this guide the user will be able to configure alerts and understand the alert architecture. He/she will also be able to write a custom alert action and be able to configure it as well as the built-in alert actions like notifications.

Alert Configuration

The alerts are in-general configured in a file resides in the conf directory of the UltraESB distribution, with the file name monitoring/alert-configs.json where the file contains a list of JSON serialized alert configurations. The expected JSON format varies based on whether it is an alert configuration defining an alert for a gauge record or an event record.

Gauge Alert Configurations

A gauge alert configuration will take the following format.

Gauge Alert Configuration

{
      "stream": string,
      "id": number,
      "function": Function,
      "criteria": {
          "minThreshold": number?,
          "maxThreshold": number?,
          "hitCount": number?,
          "withinPeriod": number?,
      },
      "actions": [{
          "@class": ".NotificationAction",
          "protocol": Protocol,
          "address": String
      }?]
}
Event Alert Configuration

An event alert configuration will take the following format.

Event Alert Configuration

{
      "stream": string,
      "id": number,
      "event" : string,
      "secondEvent" : string?,
      "function": Function,
      "criteria": {
          "minThreshold": number?,
          "maxThreshold": number?,
          "hitCount": number?,
          "withinPeriod": number?,
      },
      "actions": [{
          "@class": ".NotificationAction",
          "protocol": Protocol,
          "address": String
      }?]
}
Sample Configuration

Here is a sample configuration that can be used to monitor the default configuration.

Sample conf/monitoring/alert-configs.json file

[
   {
        "id": 1,
        "stream": "proxy:echo-back:processedInCount",
        "description": "Test proxy counter alerts on server ${server}",
        "severity": "WARNING",
        "function": "COUNT",
        "criteria": {
            "minThreshold": 1,
            "maxThreshold": 3
        },
        "actions": [
            {
                "@class": ".NotificationAction",
                "protocol": "EMAIL",
                "address": "support@adroitlogic.com"
            }
        ]
    },
    {
        "id": 2,
        "stream": "proxy:echo-proxy:messageTimes",
        "description": "Test Event alerts",
        "severity":"ERROR",
        "event" : "proxy:in:start",
        "secondEvent" : "proxy:out:end",
        "function": "DIFF",
        "criteria": {
            "maxThreshold": 3E6
        }
    },

    {
        "id": 3,
        "stream": "proxy:echo-proxy:messageTimes",
        "description": "Test event with more than one occurrence alerts",
        "severity": "CRITICAL",
        "event" : "proxy:in:start",
        "secondEvent" : "proxy:out:end",
        "function": "DIFF",
        "criteria": {
            "maxThreshold": 3E5,
            "withinPeriod": 30000,
            "hitCount": 2
        }
    }
]

Notifications & Alert Actions

Alert actions are used to take automatic actions by the system upon an alert. Alert actions can be configured in the alert configurations itself, in which case that action is specific to that alert and is being invoked on any alert generated from that configuration.

Alert Action Configuration

Alert actions are configured again with JSON and will have the following format.

Aler Action Configuration

{
      "@class": "FQ Class Name",
      "property": "value"*
}

While the class specifies the alert action implementation any default alert actions in the package "org.adroitlogic.metrics.api.alert" can just start with the '.' and the simple class name is sufficient to configure the alert action.

If there are any dynamic properties associated with an alert action those can be given as name value pairs after the class attribute in the JSON configuration.

Notifications

Notifications are one of the alert actions which is available out of the box for configuration, as it is mostly being used in almost all alerts as a means of immediately communicating the alert information to the administrators to take an human intervention action for the alerts.

Global Alert Actions

Apart from that there can be global (all alert) actions which are invoked on all the alerts generated in the system. These alert actions are configured in a file named conf/monitoring/default-alert-actions.json and is again taking the form of JSON serialization of an alert action.

Sample Global Alert Action Configuration

Here is a sample global alert action configuration.

Sample conf/monitoring/global-alert-actions.json file

[
    {
        "@class": ".NotificationAction",
        "protocol": "EMAIL",
        "address": "info@adroitlogic.com"
    }
]
In this topic
In this topic
Contact Us