Examples of alerts

You're viewing Apigee X documentation.
View Apigee Edge documentation.

Apigee enables you to create complex alerts based on multiple conditions and logical combinations. The following sections present some examples of these types of alerts.

Alert for a decrease in responses with response code 200

The next example shows how to create an alert for a 5 percent decrease in responses with response code 200 (a successful response) over a 3 minute interval.

Initial steps

To create the alert, start by doing the Initial steps for creating an alert.

After doing so, the Target pane should appear as shown below.

Select a metric.

Target pane

In the Target pane, do the following steps:

  1. Add the response_count metric by copying the code below and pasting it in the Select a metric field.
    apigee.googleapis.com/proxyV2/response_count
  2. Add a filter for response_code as follows:
    1. In the Filter field, click Add a filter and select response_code from the drop-down menu.
    2. Select 200 in the Value field.
    3. Click APPLY.

    Add a filter.

  3. In the Aggregator drop-down menu, select sum.
  4. In the Period drop-down menu, select 1 minute. The last two settings specify that the responses will be summed over 1 minute time intervals.

Note: The Period is not the interval (3 minutes) for the decrease in responses that triggers the alert. That interval is specified in the Configuration pane, which is described below.

After doing these steps, the Target pane should appear as shown below:

Target pane.

Configuration

Next, make the following selections in the Configuration pane:

  • In the Configure drop-down menu, select decreases by.
  • In the Threshold field, enter 5 percent.
  • In the For menu, select 3 minutes. This specifies that the decrease in responses must last for 3 minutes to trigger the alert.

After doing so, the Configuration pane should appear as shown below:

Target pane.

Finally, click Add to add the condition.

With these settings, an alert will be triggered when sum of the response counts over the previous minute has a 5 percent decline over 3 minutes.

Using the Group By field

The Group By field enables you to divide a time series into groups that match selected labels. The next example divides the time series for response_count into four groups, based on all combinations of the HTTP methods GET and PUT, and the response codes 400 and 500, as shown in the following table.

Response code: 400 Response code: 500
HTTP method: GET GET&400 GET&500
HTTP method: PUT PUT&400 PUT&500

The example then creates an alert that is triggered if there is a 25 percent increase in responses over a 5 minute interval for any of the four combinations in the table above.

In this example, responses with response code 200 will be excluded from the count, which means that only unsuccessful responses are counted (as opposed to the previous example in only successful responses are counted).

Initial steps

To create the alert, start by doing the Initial steps for creating an alert.

After doing so, the Target pane should appear as shown below.

Select a metric.

Target

In the Target pane, do the following steps:

  1. Add the request_count metric by copying the code below and pasting it in the Select a metric field field.
    apigee.googleapis.com/proxyV2/response_count
  2. To exclude responses with response_code 200, do the following in the Filter field:
    1. Type response_code.
    2. In the field below, select !=.
    3. In the Value field, select 200.
    4. Click Apply.
  3. In the Group By field:
    1. Click + Add a label and select HTTP method below the Value.
    2. Click + Add a label again and select response_code below the Value.
  4. In the Aggregator drop-down menu, select sum.
  5. In the Period drop-down menu, select 1 minute.

After doing these steps, the Target pane should appear as shown below:

Target pane.

Configuration

Next, make the following selections in the Configuration pane:

  • In the Configure drop-down menu, select Increases by.
  • In the Threshold field, enter 20.
  • In the For menu, select 5 minutes.

After doing so, the Configuration pane should appear as shown below:

Target pane.

Finally, click Add to add the alert condition.

The alert is triggered if there is a 25 percent increase in responses for any of the four combinations of HTTP method and response code over 5 minutes.