|
| 1 | +--- |
| 2 | +title: Set up alerts in Azure Container Apps |
| 3 | +description: Set up alerts to monitor your container app. |
| 4 | +services: container-apps |
| 5 | +author: cebundy |
| 6 | +ms.service: container-apps |
| 7 | +ms.custom: event-tier1-build-2022 |
| 8 | +ms.topic: how-to |
| 9 | +ms.date: 08/30/2022 |
| 10 | +ms.author: v-bcatherine |
| 11 | +--- |
| 12 | + |
| 13 | +# Set up alerts in Azure Container Apps |
| 14 | + |
| 15 | +Azure Monitor alerts notify you so that you can respond quickly to critical issues. There are two types of alerts that you can define: |
| 16 | + |
| 17 | +- [Metric alerts](../azure-monitor/alerts/alerts-metric-overview.md) based on Azure Monitor metric data |
| 18 | +- [Log alerts](../azure-monitor/alerts/alerts-unified-log.md) based on Azure Monitor Log Analytics data |
| 19 | + |
| 20 | +You can create alert rules from metric charts in the metric explorer and from queries in Log Analytics. You can also define and manage alerts from the **Monitor>Alerts** page. To learn more about alerts, refer to [Overview of alerts in Microsoft Azure](../azure-monitor/alerts/alerts-overview.md). |
| 21 | + |
| 22 | +The **Alerts** page in the **Monitoring** section on your container app page displays all of your app's alerts. You can filter the list by alert type, resource, time and severity. You can also modify and create new alert rules from this page. |
| 23 | + |
| 24 | +## Create metric alert rules |
| 25 | + |
| 26 | +When you create alerts rules based on a metric chart in the metrics explorer, alerts are triggered when the metric data matches alert rule conditions. For more information about creating metrics charts, see [Using metrics explorer](metrics.md#using-metrics-explorer) |
| 27 | + |
| 28 | +After creating a metric chart, you can create a new alert rule. |
| 29 | + |
| 30 | +1. Select **New alert rule**. The **Create an alert rule** page is opened to the **Condition** tab. Here you'll find a *condition* that is populated with the metric chart settings. |
| 31 | +1. Select the condition. |
| 32 | + :::image type="content" source="media/observability/metrics-alert-create-condition.png" alt-text="Screenshot of the metric explorer alert rule editor. A condition is automatically created based on the chart settings."::: |
| 33 | +1. Modify the **Alert logic** section to set the alert criteria. You can set the alert to trigger when the metric value is greater than, less than, or equal to a threshold value. You can also set the alert to trigger when the metric value is outside of a range of values. |
| 34 | + :::image type="content" source="media/observability/screenshot-configure-alert-signal-logic.png" alt-text="Screenshot of the configure alert signal logic in Azure Container Apps."::: |
| 35 | +1. Select **Done**. |
| 36 | +1. You can add more conditions to the alert rule by selecting **Add condition** on the **Create an alert rule** page. |
| 37 | +1. Select the **Details** tab. |
| 38 | +1. Enter a name and description for the alert rule. |
| 39 | +1. Select **Review + create**. |
| 40 | +1. Select **Create**. |
| 41 | + :::image type="content" source="media/observability/screenshot-alert-details-dialog.png" alt-text="Screen shot of the alert details configuration page."::: |
| 42 | + |
| 43 | + |
| 44 | +### Add conditions to an alert rule |
| 45 | + |
| 46 | +To add more conditions to your alert rule: |
| 47 | + |
| 48 | +1. Select **Alerts** from the left side menu of your container app page. |
| 49 | +1. Select **Alert rules** from the top menu. |
| 50 | +1. Select an alert from the table. |
| 51 | +1. Select **Add condition** in the **Condition** section. |
| 52 | +1. Select from the metrics listed in the **Select a signal** pane. |
| 53 | + :::image type="content" source="media/observability/metrics-alert-select-a-signal.png" alt-text="Screenshot of the metric explorer alert rule editor showing the Select a signal pane."::: |
| 54 | +1. Configure the settings for your alert condition. For more information about configuring alerts, see [Manage metric alerts](../azure-monitor/alerts/alerts-metric.md). |
| 55 | + |
| 56 | + You can receive individual alerts for specific revisions or replicas by enabling alert splitting and selecting **Revision** or **Replica** from the **Dimension name** list. |
| 57 | + |
| 58 | +Example of selecting a dimension to split an alert. |
| 59 | + |
| 60 | +:::image type="content" source="media/observability/metrics-alert-split-by-dimension.png" alt-text="Screenshot of the metrics explorer alert rule editor. This example shows the Split by dimensions options in the Configure signal logic pane."::: |
| 61 | + |
| 62 | + To learn more about configuring alerts, visit [Create a metric alert for an Azure resource](../azure-monitor/alerts/tutorial-metric-alert.md) |
| 63 | + |
| 64 | +## Create log alert rules |
| 65 | + |
| 66 | +You can create log alerts from queries in Log Analytics. When you create an alert rule from a query, the query is run at set intervals triggering alerts when the log data matches the alert rule conditions. To learn more about creating log alert rules, see [Manage log alerts](../azure-monitor/alerts/alerts-log.md). |
| 67 | + |
| 68 | +To create an alert rule: |
| 69 | + |
| 70 | +1. First, create and run a query to validate the query. |
| 71 | +1. Select **New alert rule**. |
| 72 | +:::image type="content" source="media/observability/log-alert-new-alert-rule.png" alt-text="Screenshot of the Log Analytics interface highlighting the new alert rule button."::: |
| 73 | +1. The **Create an alert rule** editor is opened to the **Condition** tab, which is populated with your log query. |
| 74 | + :::image type="content" source="media/observability/log-alerts-rule-editor.png" alt-text="Screenshot of the Log Analytics alert rule editor."::: |
| 75 | +1. Configure the settings in the **Measurement** section |
| 76 | + :::image type="content" source="media/observability/screenshot-metrics-alerts-measurements.png" alt-text="Screen shot of metrics Create an alert rule measurement section."::: |
| 77 | +1. Optionally, you can enable alert splitting in the alert rule to send individual alerts for each dimension you select in the **Split by dimensions** section of the editor. |
| 78 | + :::image type="content" source="media/observability/log-alerts-splitting.png" alt-text="Screenshot of the Create an alert rule Split by dimensions section"::: |
| 79 | +1. Enter the threshold criteria in the**Alert logic** section. |
| 80 | + :::image type="content" source="media/observability/log-alert-alert-logic.png" alt-text="Screenshot of the Create an alert rule Alert logic section."::: |
| 81 | +1. Select the **Details** tab. |
| 82 | +1. Enter a name and description for the alert rule. |
| 83 | +:::image type="content" source="media/observability/screenshot-alert-details-dialog.png" alt-text="Screen shot of the alert details configuration page."::: |
| 84 | +1. Select **Review + create**. |
| 85 | +1. Select **Create**. |
| 86 | + |
| 87 | +> [!div class="nextstepaction"] |
| 88 | +> [View log streams from the Azure portal](log-streaming.md) |
0 commit comments