title | description | ms.author | ms.reviewer | ms.topic | ms.date |
---|---|---|---|---|---|
Tutorial - Create a metric alert for an Azure resource |
Learn how to create a metric chart with Azure metrics explorer. |
abbyweisberg |
nolavime |
tutorial |
11/28/2023 |
Azure Monitor alerts proactively notify you when important conditions are found in your monitoring data. Metric alert rules create an alert when a metric value from an Azure resource exceeds a threshold.
In this tutorial, you learn how to:
[!div class="checklist"]
- Create a metric alert rule from metrics explorer
- Configure the alert threshold
- Create an action group to define notification details
To complete this tutorial you need the following:
- An Azure resource to monitor. You can use any resource in your Azure subscription that supports metrics. To determine whether a resource supports metrics, go to its menu in the Azure portal and verify that there's a Metrics option in the Monitoring section of the menu.
- Chart in metrics explorer with one or more metrics that you want to alert on. Complete Tutorial: Analyze metrics for an Azure resource.
From metrics explorer, click New alert rule. The rule will be preconfigured with the target object and the metric that you selected in metrics explorer.
:::image type="content" source="media/tutorial-metric-alert/new-alert-rule.png" alt-text="New alert rule" lightbox="media/tutorial-metric-alert/new-alert-rule.png":::
The resource will already be selected. You need to modify the signal logic to specify the threshold value and any other details for the alert rule.
To view these settings, select the Condition tab.
:::image type="content" source="./media/tutorial-metric-alert/configuration.png" lightbox="./media/tutorial-metric-alert/configuration.png" alt-text="Alert rule configuration":::
The chart shows the value of the selected signal over time so that you can see when the alert would have been fired. This chart will update as you specify the signal logic.
:::image type="content" source="./media/tutorial-metric-alert/signal-logic.png" lightbox="./media/tutorial-metric-alert/signal-logic.png" alt-text="Alert rule signal logic":::
The Alert logic is defined by the condition and the evaluation time. The alert fires when this condition is true. Provide a Threshold value for your alert rule and modify the Operator and Aggregation type to define the logic you need.
:::image type="content" source="./media/tutorial-metric-alert/alert-logic.png" lightbox="./media/tutorial-metric-alert/alert-logic.png" alt-text="Alert rule alert logic":::
You can accept the default time granularity or modify it to your requirements. Check every defines how often the alert rule will check if the condition is met. Lookback period defines the time interval over which the collected values are aggregated. For example, every 5 minutes, you’ll be looking at the past 5 minutes.
:::image type="content" source="./media/tutorial-metric-alert/when-to-evaluate.png" lightbox="./media/tutorial-metric-alert/when-to-evaluate.png" alt-text="Screenshot that shows the When to evaluate options for the alert rule.":::
When you're done configuring the signal logic, click Next: Actions > or the Actions tab to configure actions.
[!INCLUDE Action groups]
[!INCLUDE Alert details]
:::image type="content" source="./media/tutorial-metric-alert/alert-details.png" lightbox="./media/tutorial-metric-alert/alert-details.png" alt-text="Alert rule details":::
Click Review + create and then Create to create the alert rule.
[!INCLUDE View alert]
Now that you've learned how to create a metric alert for an Azure resource, use one of the following tutorials to collect log data.
[!div class="nextstepaction"] Collect resource logs from an Azure resource [!div class="nextstepaction"] Collect guest logs and metrics from Azure virtual machine