You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-monitor/alerts/alerts-common-schema.md
+4-15Lines changed: 4 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,8 @@ The common alert schema provides a consistent structure for:
22
22
- Azure Automation runbook
23
23
24
24
> [!NOTE]
25
-
> Alerts generated by [VM insights](../vm/vminsights-overview.md) do not support the common schema.
25
+
> - Alerts generated by [VM insights](../vm/vminsights-overview.md) do not support the common schema.
26
+
>- Smart detection alerts use the common schema by default. You don't have to enable the common schema for smart detection alerts.
26
27
27
28
## Structure of the common schema
28
29
@@ -31,10 +32,8 @@ The common schema includes information about the affected resource and the cause
31
32
32
33
If you want to route alert instances to specific teams based on criteria such as a resource group, you can use the fields in the **Essentials** section to provide routing logic for all alert types. The teams that receive the alert notification can then use the context fields for their investigation.
33
34
-**Alert context**: Fields that vary depending on the type of the alert. The alert context fields describe the cause of the alert. For example, a metric alert would have fields like the metric name and metric value in the alert context. An activity log alert would have information about the event that generated the alert.
34
-
-**Custom properties**: You can add more information to the alert payload by adding custom properties if you've configured action groups for a metric alert rule.
35
+
-**Custom properties**: Additional information that is not included in the alert payload by default can be included in the alert payload using custom properties. Custom properties are a **Key:Value** pair that can include any information configured in the alert rule.
35
36
36
-
> [!NOTE]
37
-
> Custom properties are currently only supported by metric alerts. For all other alert types, the **custom properties** field is null.
38
37
## Sample alert payload
39
38
40
39
```json
@@ -139,8 +138,6 @@ For sample alerts that use the common schema, see [Sample alert payloads](alerts
139
138
|webTestName |If the condition type is `webtest`, the name of the webtest. |
140
139
|windowStartTime |The start time of the evaluation window in which the alert fired. |
141
140
|windowEndTime |The end time of the evaluation window in which the alert fired. |
142
-
|customProperties ||
143
-
144
141
### Sample metric alert with a static threshold when the monitoringService = `Platform`
145
142
146
143
```json
@@ -675,21 +672,13 @@ See [Azure Monitor managed service for Prometheus rule groups (preview)](../esse
675
672
```
676
673
## Custom properties fields
677
674
678
-
If you've configured action groups for a metric alert rule, you can add more information to the alert payload by adding custom properties.
679
-
680
-
The custom properties section contains “key: value” objects that are added to webhook notifications.
675
+
If the alert rule that generated your alert contains action groups, custom properties can contain additional information about the alert. The custom properties section contains “key: value” objects that are added to webhook notifications.
681
676
682
677
If custom properties aren't set in the alert rule, the field is null.
683
-
684
-
> [!NOTE]
685
-
> Custom properties are currently only supported by metric alerts. For all other alert types, the **custom properties** field is null.
686
678
## Enable the common alert schema
687
679
688
680
Use action groups in the Azure portal or use the REST API to enable the common alert schema. Schemas are defined at the action level. For example, you must separately enable the schema for an email action and a webhook action.
689
681
690
-
> [!NOTE]
691
-
> Smart detection alerts support the common schema by default. You don't have to enable the common schema for smart detection alerts.
692
-
693
682
### Enable the common schema in the Azure portal
694
683
695
684

Copy file name to clipboardExpand all lines: articles/azure-monitor/alerts/alerts-create-new-alert-rule.md
+21-26Lines changed: 21 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -243,6 +243,19 @@ Alerts triggered by these alert rules contain a payload that uses the [common al
243
243
244
244
:::image type="content" source="media/alerts-create-new-alert-rule/alerts-rule-actions-tab.png" alt-text="Screenshot that shows the Actions tab when creating a new alert rule.":::
245
245
246
+
1. (Optional) In the **Custom properties** section, if you've configured action groups for this alert rule, you can add custom properties in key:value pairs to the alert payload to add more information to the payload. Add the property **Name** and **Value** for the custom property you want included in the payload.
247
+
248
+
You can also use custom properties to extract and manipulate data from alert payloads that use the common schema. You can use those values in the action group webhook or logic app.
249
+
250
+
The format for extracting values from the common schema, use a "$", and then the path of the common schema field inside curly brackets. For example: `${data.essentials.monitorCondition}`.
251
+
252
+
For example, you could use these values in the **custom properties** to utilize data from the payload.
253
+
254
+
|Custom properties name |Custom properties value |Result |
|Alert ${data.essentials.monitorCondition} reason |“${data.alertContext.condition.allOf[0].metricName} ${data.alertContext.condition.allOf[0].operator}${data.alertContext.condition.allOf[0].threshold} ${data.essentials.monitorCondition}. The value is ${data.alertContext.condition.allOf[0].metricValue}" |Examples of the results could be: <br> - Alert Resolved reason": "Percentage CPU GreaterThan5 Resolved. The value is 3.585 <br>Percentage CPU GreaterThan5 Fired. The value is 10.585 |
258
+
246
259
1. On the **Details** tab, define the **Project details**.
247
260
- Select the **Subscription**.
248
261
- Select the **Resource group**.
@@ -267,9 +280,8 @@ Alerts triggered by these alert rules contain a payload that uses the [common al
267
280
|---------|---------|
268
281
|Enable upon creation| Select for the alert rule to start running as soon as you're done creating it.|
269
282
|Automatically resolve alerts (preview) |Select to make the alert stateful. When an alert is stateful, the alert is resolved when the condition is no longer met.<br> If you don't select this checkbox, metric alerts are stateless. Stateless alerts fire each time the condition is met, even if alert already fired.<br> The frequency of notifications for stateless metric alerts differs based on the alert rule's configured frequency:<br>**Alert frequency of less than 5 minutes**: While the condition continues to be met, a notification is sent somewhere between one and six minutes.<br>**Alert frequency of more than 5 minutes**: While the condition continues to be met, a notification is sent between the configured frequency and double the frequency. For example, for an alert rule with a frequency of 15 minutes, a notification is sent somewhere between 15 to 30 minutes.|
270
-
1. (Optional) If you've configured action groups for this alert rule, you can add custom properties to the alert payload to add more information to the payload. In the **Custom properties** section, add the property **Name** and **Value** for the custom property you want included in the payload.
271
283
272
-
:::image type="content" source="media/alerts-create-new-alert-rule/alerts-metric-rule-details-tab.png" alt-text="Screenshot that shows the Details tab when creating a new alert rule.":::
284
+
:::image type="content" source="media/alerts-create-new-alert-rule/alerts-metric-rule-details-tab.png" alt-text="Screenshot that shows the Details tab when creating a new alert rule.":::
273
285
274
286
### [Log alert](#tab/log)
275
287
@@ -285,48 +297,31 @@ Alerts triggered by these alert rules contain a payload that uses the [common al
285
297
|Mute actions |Select to set a period of time to wait before alert actions are triggered again. If you select this checkbox, the **Mute actions for** field appears to select the amount of time to wait after an alert is fired before triggering actions again.|
286
298
|Check workspace linked storage|Select if logs workspace linked storage for alerts is configured. If no linked storage is configured, the rule isn't created.|
287
299
288
-
1. (Optional) If you've configured action groups for this alert rule, you can add custom properties to the alert payload to add more information to the payload. In the **Custom properties** section, add the property **Name** and **Value** for the custom property you want included in the payload.
289
-
290
-
> [!NOTE]
291
-
> The [common schema](alerts-common-schema.md) overwrites custom configurations. Therefore, you can't use both custom properties and the common schema for log alerts.
292
-
293
-
:::image type="content" source="media/alerts-create-new-alert-rule/alerts-log-rule-details-tab.png" alt-text="Screenshot that shows the Details tab when creating a new log alert rule.":::
300
+
:::image type="content" source="media/alerts-create-new-alert-rule/alerts-log-rule-details-tab.png" alt-text="Screenshot that shows the Details tab when creating a new log alert rule.":::
294
301
295
302
### [Activity log alert](#tab/activity-log)
296
303
297
304
1. Enter values for the **Alert rule name** and the **Alert rule description**.
298
305
1. Select the **Region**.
299
-
1. (Optional) In the **Advanced options** section, select **Enable upon creation** for the alert rule to start running as soon as you're done creating it.
300
-
1. (Optional) If you've configured action groups for this alert rule, you can add custom properties to the alert payload to add more information to the payload. In the **Custom properties** section, add the property **Name** and **Value** for the custom property you want included in the payload.
301
-
302
-
> [!NOTE]
303
-
> The [common schema](alerts-common-schema.md) overwrites custom configurations. Therefore, you can't use both custom properties and the common schema for activity log alerts.
306
+
1. Select **Enable upon creation** for the alert rule to start running as soon as you're done creating it.
304
307
305
-
:::image type="content" source="media/alerts-create-new-alert-rule/alerts-activity-log-rule-details-tab.png" alt-text="Screenshot that shows the Actions tab when creating a new activity log alert rule.":::
308
+
:::image type="content" source="media/alerts-create-new-alert-rule/alerts-activity-log-rule-details-tab.png" alt-text="Screenshot that shows the Actions tab when creating a new activity log alert rule.":::
306
309
307
310
### [Resource Health alert](#tab/resource-health)
308
311
309
312
1. Enter values for the **Alert rule name** and the **Alert rule description**.
310
313
1. Select the **Region**.
311
-
1. (Optional) In the **Advanced options** section, select **Enable upon creation** for the alert rule to start running as soon as you're done creating it.
312
-
1. (Optional) If you've configured action groups for this alert rule, you can add custom properties to the alert payload to add more information to the payload. In the **Custom properties** section, add the property **Name** and **Value** for the custom property you want included in the payload.
314
+
1. Select **Enable upon creation** for the alert rule to start running as soon as you're done creating it.
313
315
314
-
> [!NOTE]
315
-
> The [common schema](alerts-common-schema.md) overwrites custom configurations. Therefore, you can't use both custom properties and the common schema for resource health alerts.
316
-
317
-
:::image type="content" source="media/alerts-create-new-alert-rule/alerts-activity-log-rule-details-tab.png" alt-text="Screenshot that shows the Actions tab when creating a new activity log alert rule.":::
316
+
:::image type="content" source="media/alerts-create-new-alert-rule/alerts-activity-log-rule-details-tab.png" alt-text="Screenshot that shows the Actions tab when creating a new activity log alert rule.":::
318
317
319
318
### [Service Health alert](#tab/service-health)
320
319
321
320
1. Enter values for the **Alert rule name** and the **Alert rule description**.
322
321
1. Select the **Region**.
323
-
1. (Optional) In the **Advanced options** section, select **Enable upon creation** for the alert rule to start running as soon as you're done creating it.
324
-
1. (Optional) If you've configured action groups for this alert rule, you can add custom properties to the alert payload to add more information to the payload. In the **Custom properties** section, add the property **Name** and **Value** for the custom property you want included in the payload.
325
-
326
-
> [!NOTE]
327
-
> The [common schema](alerts-common-schema.md) overwrites custom configurations. Therefore, you can't use both custom properties and the common schema for service health alerts.
322
+
1. Select **Enable upon creation** for the alert rule to start running as soon as you're done creating it.
328
323
329
-
:::image type="content" source="media/alerts-create-new-alert-rule/alerts-activity-log-rule-details-tab.png" alt-text="Screenshot that shows the Actions tab when creating a new activity log alert rule.":::
324
+
:::image type="content" source="media/alerts-create-new-alert-rule/alerts-activity-log-rule-details-tab.png" alt-text="Screenshot that shows the Actions tab when creating a new activity log alert rule.":::
0 commit comments