|
| 1 | +--- |
| 2 | +title: "Tutorial: Monitor Azure Spring Cloud resources using alerts and action groups | Microsoft Docs" |
| 3 | +description: Learn how to use Spring Cloud alerts. |
| 4 | +author: MikeDodaro |
| 5 | +ms.author: barbkess |
| 6 | +ms.service: spring-cloud |
| 7 | +ms.topic: tutorial |
| 8 | +ms.date: 11/18/2019 |
| 9 | + |
| 10 | +--- |
| 11 | +# Tutorial: Monitor Spring Cloud resources using alerts and action groups |
| 12 | + |
| 13 | +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. |
| 14 | + |
| 15 | +There are two steps to set up an alert pipeline: |
| 16 | +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. |
| 17 | +2. Set up Alert rules. The rules bind metric patterns with the action groups based on target resource, metric, condition, time aggregation, etc. |
| 18 | + |
| 19 | +## Prerequisites |
| 20 | +In addition to the Azure Spring requirements, this tutorial depends on the following resources. |
| 21 | + |
| 22 | +* A deployed Azure Spring Cloud instance. Follow our [quickstart](spring-cloud-quickstart-launch-app-cli.md) to get started. |
| 23 | + |
| 24 | +* An Azure resource to monitor, for example the database implemented in this article: [How to use Spring Data Apache Cassandra API with Azure Cosmos DB](https://docs.microsoft.com/azure/java/spring-framework/configure-spring-data-apache-cassandra-with-cosmos-db) |
| 25 | + |
| 26 | +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.) |
| 27 | + |
| 28 | +Navigate from a resource group to your Spring Cloud instance. Select **Alerts** in the left pane, then select **Manage actions**: |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | +## Set up Action Group |
| 33 | + |
| 34 | +To begin the procedure to initialize a new **Action Group**, select **+ Add action group**. |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | +On the **Add action group** page: |
| 39 | + |
| 40 | + 1. Specify an **Action group name** and **Short name**. |
| 41 | + |
| 42 | + 1. Specify **Subscription** and **Resource group**. |
| 43 | + |
| 44 | + 1. Specify **Action Name**. |
| 45 | + |
| 46 | + 1. Select **Action Type**. This will open another pane on the right to define the action that will be taken on activation. |
| 47 | + |
| 48 | + 1. Define the action using the options in the right pane. This case uses email notification. |
| 49 | + |
| 50 | + 1. Click **OK** in the right action pane. |
| 51 | + |
| 52 | + 1. Click **OK** in the **Add action group** dialog. |
| 53 | + |
| 54 | +  |
| 55 | + |
| 56 | +## Set up Alert |
| 57 | + |
| 58 | +The previous steps created an **Action Group** that uses email. You could also use phone notification, webhooks, Azure functions, etc. |
| 59 | + |
| 60 | +To configure an **Alert**, navigate back to the **Alerts** page, and click **Manage Alert Rules**. |
| 61 | + |
| 62 | +  |
| 63 | + |
| 64 | +1. Select the **Resource** for the alert. |
| 65 | + |
| 66 | +1. Click **+ New alert rule**. |
| 67 | + |
| 68 | +  |
| 69 | + |
| 70 | +1. On the **Create rule** page, specify the **RESOURCE**, **CONDITION**, and **ACTIONS**. From **ACTIONS** pane select the previously defined **Action Group**. |
| 71 | + |
| 72 | +1. Under **ALERT DETAILS**, Name the alert rule. |
| 73 | + |
| 74 | +1. Click **Create alert rule**. |
| 75 | + |
| 76 | +  |
| 77 | + |
| 78 | +Verify that the new alert rule is enabled. |
| 79 | + |
| 80 | +  |
| 81 | + |
| 82 | +## Next steps |
| 83 | +* [Create and manage action groups in the Azure portal](https://docs.microsoft.com/azure/azure-monitor/platform/action-groups) |
| 84 | +* [SMS Alert Behavior in Action Groups](https://docs.microsoft.com/azure/azure-monitor/platform/alerts-sms-behavior) |
| 85 | +* [Tutorial: Using Distributed Tracing with Azure Spring Cloud](https://docs.microsoft.com/azure/spring-cloud/spring-cloud-tutorial-distributed-tracing) |
0 commit comments