NOTE: Some aspects of this product are in Beta. The hybrid installation options are GA. To join the Beta program, reach out to your Apigee representative.

Setting up alerts and notifications

API Monitoring enables you to set up alerts and notifications that are triggered by specific events, such as spikes in API traffic or latencies. After you set up a notification, an email will be sent to you when an event occurs. To learn more about alerts, see Introduction to alerting.

Creating an alert

To create an alert from the API Monitoring UI, start by doing the following steps, which you'll need to do whenever you create a new alert.

Initial steps

  1. Click ALERT at the top of the UI. This opens the Create alerting policy page in the Google Cloud Console, as shown below.

    Create alerting policy page

  2. Click ADD CONDITION. This opens a new page where you can add the alert condition.

    Configure an alert.

  3. In the Find resource type and metric field, enter Apigee proxyv2. The Target section now appears as in the picture below.

    Select a metric.

After doing these steps, you can select additional options for the alert, depending on what event you want alerted. The following sections give a couple of examples.

The last step above displays the Select a metric field, where you can specify the metric—the API quantity that triggers the alert. Here are a couple of examples of metrics you can use:

  • Total traffic: Number of requests per minute. Use this to detect unexpected traffic .
  • Latency percentile. Use this to detect a slowdown in request time.
  • Response count. Use this to detect unexpected activity related to "Status Code", "Fault Code", or "Fault Source," etc.

The next two sections present examples of creating alerts based on the first two metrics.

Traffic spike alert

The following sections show how to create an alert that is triggered when the total API traffic is above 3600 for 1 minute. To set up the alert, continue from step 2 in the Initial steps in the preceding section, and add the settings described below.

Target settings

In the Target section:

  • Click in the Select a metric field and type
    apigee.googleapis.com/proxyV2/request_count

    or select Apigee proxy request cumulative.

    Select a metric.

    This displays the fields shown below.

    Select target options.

  • In the Aggregator field, select sum. This sums the total traffic over the time span specified by Period, which is 1 minute by default.

    These settings will trigger an alert based on the total number of requests in each 1 minute interval of the time range.

Configuration settings

The Configuration settings specify the conditions that trigger the alert. The Threshold is the minimum value of the quantity specified in the Target section per second—which in this case is requests per second—that will set off the alert.

For example, suppose you want the alert to be triggered if the total traffic in any 1 minute interval is above 36. Since the threshold is measured in requests per second, you divide 3600 by 60 to get a threshold of 60.

Set the Threshold to 60, as shown below.

Configuration settings

Finally, click Add to add the alert condition. This takes you back to the Create alerting policy page where you started.

Creating a notification

To create a notification for the alert:

  1. Click NEXT.
  2. In the Who should be notified section, click Notification Channels and select the email address where you want notifications sent.

    To learn how to create your own email notifications channel, see Managing notification channels.

  3. Click NEXT. This displays the options for What are the steps to fix the issue? as shown below. Notification options
  4. In the Alert name field, enter a name for the alert.
  5. In the Documentation field, enter the URL for a web page that provides information on how to fix the issue that caused the alert. The URL will be included in the notification email.
  6. Click Save to create the alert.

When you receive an alert notification email, click VIEW IN APIGEE in the email. This will open the Apigee documentation page Using the Investigate view.

Latency alert

The following section shows how to create an alert that is triggered when the 90th percentile of the API's latency is above 600 ms for 10 minutes. To create the alert, continue from step 2 in the Initial steps described in the first section. After doing so, the Target section appears as shown below.

Select a metric.

Now do the following steps:

  1. In the Select a metric field, type
    apigee.googleapis.com/ProxyV2/latencies_percentile

    or select Percentile of Apigee proxy response.

    Select latency metric.

  2. Under Filter, click in the Add a filter field and select percentile.

    Select a metric.

  3. In the Value field that appears below Select a metric, select 90.

    Select a metric.

  4. Click Apply.
  5. In the Configuration section, set Threshold to 600.

    Select threshold.

With these settings, an alert will be triggered when the 90th percentile of the API's latency is above 600 for 10 minutes.

The UI displays the latency graph with the threshold, as shown below.

Select a metric.

To create the alert, click Add at the bottom of the UI. This takes you back to the Create alerting policy page where you started.

See Creating a notification to learn how to create an email notification for the alert. When you receive an alert notification email, click VIEW IN APIGEE in the email. This will open the Apigee documentation page Using the Investigate view.