Tutorial: How to monitor Spring Cloud resources using alerts and action groups

This article applies to: ✔️ Java ✔️ C#

Azure Spring Cloud alerts support monitoring resources based on conditions such as available storage, rate of requests, or data usage. An alert sends notification when rates or conditions meet the defined specifications.

There are two steps to set up an alert pipeline:

  1. Set up an Action Group with the actions to be taken when an alert is triggered, such as email, SMS, Runbook, or Webhook. Action Groups can be re-used among different alerts.
  2. Set up Alert rules. The rules bind metric patterns with the action groups based on target resource, metric, condition, time aggregation, etc.

Prerequisites

In addition to the Azure Spring requirements, the procedures in this tutorial work with a deployed Azure Spring Cloud instance. Follow a quickstart to get started.

The following procedures initialize both Action Group and Alert starting from the Alerts option in the left navigation pane of a Spring Cloud instance. (The procedure can also start from the Monitor Overview page of the Azure portal.)

Navigate from a resource group to your Spring Cloud instance. Select Alerts in the left pane, then select Manage actions:

Screenshot portal resource group page

Set up Action Group

To begin the procedure to initialize a new Action Group, select + Add action group.

Screenshot portal Add action group

On the Add action group page:

  1. Specify an Action group name and Short name.

  2. Specify Subscription and Resource group.

  3. Specify Action Name.

  4. Select Action Type. This will open another pane on the right to define the action that will be taken on activation.

  5. Define the action using the options in the right pane. This case uses email notification.

  6. Click OK in the right action pane.

  7. Click OK in the Add action group dialog.

Screenshot Portal define action

Set up Alert

The previous steps created an Action Group that uses email. You could also use phone notification, webhooks, Azure functions, and so forth. The following steps configure an Alert.

  1. navigate back to the Alerts page, and click Manage Alert Rules.

    Screenshot Portal define alert

  2. Select the Resource for the alert.

  3. Click + New alert rule.

    Screenshot Portal new alert rule

  4. On the Create rule page, specify the RESOURCE.

  5. The CONDITION setting provides many options for monitoring your Spring Cloud resources. Click Add to open the Configure signal logic pane.

  6. Select a condition. This example uses System CPU Usage Percentage.

    Screenshot Portal new alert rule 2

  7. Scroll down the Configure signal logic pane to set the Threshold value to monitor.

    Screenshot Portal new alert rule 3

  8. Click Done.

    For details of the conditions available to monitor, see User portal metrics options.

  9. Under ACTIONS, click Select action group. From the ACTIONS pane select the previously defined Action Group.

    Screenshot Portal new alert rule 4

  10. Scroll down, and under ALERT DETAILS, name the alert rule.

  11. Set the Severity.

  12. Click Create alert rule.

    Screenshot Portal new alert rule 5

  13. Verify that the new alert rule is enabled.

    Screenshot Portal new alert rule 6

A rule can also be created using the Metrics page:

Screenshot Portal new alert rule 7

Next steps

In this tutorial you learned how to set up alerts and action groups for an Azure Spring Cloud application. To learn more about action groups, see: