Skip to content

Commit 93d4568

Browse files
authored
Merge pull request #224680 from AbbyMSFT/alert-schema
Add alert context fields to common schema and move samples
2 parents 6672c79 + 20a6a41 commit 93d4568

11 files changed

+710
-122
lines changed

.openpublishing.redirection.azure-monitor.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3863,12 +3863,12 @@
38633863
"redirect_document_id": false
38643864
},
38653865
{
3866-
"source_path_from_root": "/articles/azure-monitor/platform/alerts-common-schema-definitions.md",
3866+
"source_path_from_root": "/articles/azure-monitor/platform/alerts-common-schema.md",
38673867
"redirect_url": "/azure/azure-monitor/alerts/alerts-common-schema",
38683868
"redirect_document_id": false
38693869
},
38703870
{
3871-
"source_path_from_root": "/articles/azure-monitor/platform/alerts-common-schema.md",
3871+
"source_path_from_root": "/articles/azure-monitor/platform/alerts-common-schema-definitions.md",
38723872
"redirect_url": "/azure/azure-monitor/alerts/alerts-common-schema",
38733873
"redirect_document_id": false
38743874
},
@@ -3877,6 +3877,11 @@
38773877
"redirect_url": "/azure/azure-monitor/alerts/alerts-common-schema",
38783878
"redirect_document_id": false
38793879
},
3880+
{
3881+
"source_path_from_root": "/articles/azure-monitor/alerts/alerts-common-schema-test-action-definitions.md",
3882+
"redirect_url": "/azure/azure-monitor/alerts/alerts-payload-samples",
3883+
"redirect_document_id": false
3884+
},
38803885
{
38813886
"source_path_from_root": "/articles/azure-monitor/platform/alerts-common-schema-integrations.md",
38823887
"redirect_url": "/azure/azure-monitor/alerts/alerts-common-schema-integrations",

articles/active-directory/app-proxy/application-proxy-configure-complex-application.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,13 @@ To publish complex distributed app through Application Proxy with application se
6969

7070
3. On the Manage and configure application segments page, select "+ Add app segment"
7171

72-
:::image type="content" source="./media/application-proxy-configure-complex-application/add-application-segment-1.png" alt-text="Screenshot pf Manage and configure application segment blade.":::
72+
:::image type="content" source="./media/application-proxy-configure-complex-application/add-application-segment-1.png" alt-text="Screenshot of Manage and configure application segment blade.":::
7373

7474
4. In the Internal Url field, enter the internal URL for your app.
7575

7676
5. In the External Url field, drop down the list and select the custom domain you want to use.
7777

78-
6. Add CORS Rules (optional). For more information see [Configuring CORS Rule](https://learn.microsoft.com/graph/api/resources/corsconfiguration_v2?view=graph-rest-beta)
78+
6. Add CORS Rules (optional). For more information see [Configuring CORS Rule](/graph/api/resources/corsconfiguration_v2?view=graph-rest-beta).
7979

8080
7. Select Create.
8181

articles/azure-monitor/alerts/action-groups.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ When you create or update an action group in the Azure portal, you can test the
125125
126126
1. On the page that lists the information you entered, select **Test action group**.
127127

128-
:::image type="content" source="./media/action-groups/test-action-group.png" alt-text="Screenshot that shows the test action group start page with the Test option.":::
128+
:::image type="content" source="./media/action-groups/test-action-group.png" alt-text="Screenshot that shows the test action group page with the Test option.":::
129129

130130
1. Select a sample type and the notification and action types that you want to test. Then select **Test**.
131131

@@ -161,7 +161,7 @@ The following table describes the role membership requirements that are needed f
161161
>
162162
> When you configure an action group in the portal, you can opt in or out of the common alert schema:
163163
>
164-
> - To find common schema samples for all sample types, see [Common alert schema definitions for Test Action Group](./alerts-common-schema-test-action-definitions.md).
164+
> - To find common schema samples for all sample types, see [Alert payload samples](./alerts-payload-samples.md).
165165
> - To find non-common schema alert definitions, see [Non-common alert schema definitions for Test Action Group](./alerts-non-common-schema-definitions.md).
166166
167167
## Create an action group with a Resource Manager template
@@ -479,7 +479,7 @@ If you use the webhook action, your target webhook endpoint must be able to proc
479479
1. Copy the `$myApp.ObjectId` value that's in the script.
480480
1. In the webhook action definition, in the **Object Id** box, enter the value that you copied.
481481

482-
:::image type="content" source="./media/action-groups/action-groups-secure-webhook.png" alt-text="Screenshot that shows the Secured Webhook dialog in the Azure portal with the Object Id box." border="true":::
482+
:::image type="content" source="./media/action-groups/action-groups-secure-webhook.png" alt-text="Screenshot that shows the Secured Webhook dialog in the Azure portal with the Object ID box." border="true":::
483483

484484
#### Secure webhook PowerShell script
485485

articles/azure-monitor/alerts/activity-log-alerts-webhook.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ For more information on activity log alerts, see how to [create Azure activity l
1414
For information on action groups, see how to [create action groups](./action-groups.md).
1515

1616
> [!NOTE]
17-
> You can also use the [common alert schema](./alerts-common-schema.md) for your webhook integrations. It provides the advantage of having a single extensible and unified alert payload across all the alert services in Azure Monitor. [Learn about the common alert schema definitions](./alerts-common-schema-definitions.md)​.
17+
> You can also use the [common alert schema](./alerts-common-schema.md) for your webhook integrations. It provides the advantage of having a single extensible and unified alert payload across all the alert services in Azure Monitor. [Learn about the common alert schema](./alerts-common-schema.md)​.
1818
1919
## Authenticate the webhook
2020

@@ -272,7 +272,7 @@ For specific schema details on service health notification activity log alerts,
272272
| resourceProviderName |The resource provider of the affected resource. |
273273
| conditionType |Always `Event`. |
274274
| name |Name of the alert rule. |
275-
| id |Resource ID of the alert. |
275+
| ID |Resource ID of the alert. |
276276
| description |Alert description set when the alert is created. |
277277
| subscriptionId |Azure subscription ID. |
278278
| timestamp |Time at which the event was generated by the Azure service that processed the request. |

articles/azure-monitor/alerts/alerts-common-schema.md

Lines changed: 70 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
title: Common alert schema for Azure Monitor alerts
33
description: Understand the common alert schema, why you should use it, and how to enable it.
44
ms.topic: conceptual
5-
ms.date: 12/22/2022
5+
ms.date: 02/16/2023
66
ms.reviewer: ofmanor
77
author: AbbyMSFT
88
ms.author: abbyweisberg
99
---
1010

1111
# Common alert schema
1212

13-
The common alert schema standardizes the consumption experience for alert notifications in Azure. Historically, activity log, metric, and log alerts each had their own email templates and webhook schemas. The common alert schema provides one standardized schema for all alert notifications.
13+
The common alert schema standardizes the consumption of Azure Monitor alert notifications. Historically, activity log, metric, and log alerts each had their own email templates and webhook schemas. The common alert schema provides one standardized schema for all alert notifications.
1414

1515
A standardized schema can help you minimize the number of integrations, which simplifies the process of managing and maintaining your integrations.
1616

@@ -21,7 +21,7 @@ The common alert schema provides a consistent structure for:
2121
- Azure Functions
2222
- Azure Automation runbook
2323

24-
The new schema enables a richer alert consumption experience across both the Azure portal and the Azure mobile app.
24+
The new schema enables a richer alert consumption experience in both the Azure portal and the Azure mobile app.
2525

2626
> [!NOTE]
2727
> Alerts generated by [VM insights](../vm/vminsights-overview.md) do not support the common schema.
@@ -87,6 +87,7 @@ The common schema includes information about the affected resource and the cause
8787
}
8888
```
8989

90+
For sample alerts that use the common schema, see [Sample alert payloads](alerts-payload-samples.md).
9091
## Essentials fields
9192

9293
| Field | Description|
@@ -96,7 +97,7 @@ The common schema includes information about the affected resource and the cause
9697
| Severity | The severity of the alert. Possible values are Sev0, Sev1, Sev2, Sev3, or Sev4. |
9798
| signalType | Identifies the signal on which the alert rule was defined. Possible values are Metric, Log, or Activity Log. |
9899
| monitorCondition | When an alert fires, the alert's monitor condition is set to **Fired**. When the underlying condition that caused the alert to fire clears, the monitor condition is set to **Resolved**. |
99-
| monitoringService | The monitoring service or solution that generated the alert. The fields for the alert context are dictated by the monitoring service. |
100+
| monitoringService | The monitoring service or solution that generated the alert. The monitoring service determines which fields are in the alert context. |
100101
| alertTargetIds | The list of the Azure Resource Manager IDs that are affected targets of an alert. For a log alert defined on a Log Analytics workspace or Application Insights instance, it's the respective workspace or application. |
101102
| configurationItems |The list of affected resources of an alert.<br>In some cases, the configuration items can be different from the alert targets. For example, in metric-for-log or log alerts defined on a Log Analytics workspace, the configuration items are the actual resources sending the telemetry and not the workspace.<br><ul><li>In the log alerts API (Scheduled Query Rules) v2021-08-01, the `configurationItem` values are taken from explicitly defined dimensions in this priority: `Computer`, `_ResourceId`, `ResourceId`, `Resource`.</li><li>In earlier versions of the log alerts API, the `configurationItem` values are taken implicitly from the results in this priority: `Computer`, `_ResourceId`, `ResourceId`, `Resource`.</li></ul>In ITSM systems, the `configurationItems` field is used to correlate alerts to resources in a configuration management database. |
102103
| originAlertId | The ID of the alert instance, as generated by the monitoring service generating it. |
@@ -107,9 +108,34 @@ The common schema includes information about the affected resource and the cause
107108
|alertContextVersion | The version number for the `alertContext` section. |
108109

109110

110-
## Alert context fields for metric alerts
111-
112-
### Sample metric alert with a static threshold and the monitoringService = `Platform`
111+
## Alert context fields for metric alerts
112+
113+
|Field |Description |
114+
|---------|---------|
115+
|properties |(Optional.) A collection of customer-defined properties. |
116+
|conditionType |The type of condition selected for the alert rule:<br> - static threshold<br> - dynamic threshold<br> - webtest |
117+
|condition | |
118+
|windowSize |The time period analyzed by the alert rule.|
119+
|allOf |Indicates that all conditions defined in the alert rule must be met to trigger an alert.|
120+
|alertSensitivity |In an alert rule with a dynamic threshold, indicates how sensitive the rule is, or how much the value can deviate from the upper or lower threshold.|
121+
|failingPeriods |In an alert rule with a dynamic threshold, the number of evaluation periods that don't meet the alert threshold that will trigger an alert. For example, you can indicate that an alert is triggered when 3 out of the last five evaluation periods aren't within the alert thresholds. |
122+
|numberOfEvaluationPeriods|The total number of evaluations. |
123+
|minFailingPeriodsToAlert|The minimum number of evaluations that do no meet the alert rule conditions.|
124+
|ignoreDataBefore |(Optional.) In an alert rule with a dynamic threshold, the date from which the threshold is calculated. Use this value to indicate that the rule shouldn't calculate the dynamic threshold using data from before the specified date. |
125+
|metricName |The name of the metric monitored by the alert rule. |
126+
|metricNamespace |The namespace of the metric monitored by the alert rule. |
127+
|operator |The logical operator of the alert rule. |
128+
|threshold |The threshold defined in the alert rule. For an alert rule with a dynamic threshold, this value is the calculated threshold. |
129+
|timeAggregation |The aggregation type of the alert rule. |
130+
|dimensions |The metric dimension that triggered the alert. |
131+
|name |The dimension name. |
132+
|value |The dimension value. |
133+
|metricValue |The metric value at the time that it violated the threshold. |
134+
|webTestName |If the condition type is `webtest`, the name of the webtest. |
135+
|windowStartTime |The start time of the evaluation window in which the alert fired. |
136+
|windowEndTime |The end time of the evaluation window in which the alert fired. |
137+
138+
### Sample metric alert with a static threshold when the monitoringService = `Platform`
113139

114140
```json
115141
{
@@ -141,7 +167,7 @@ The common schema includes information about the affected resource and the cause
141167
}
142168
```
143169

144-
### Sample metric alert with a dynamic threshold and the monitoringService = Platform
170+
### Sample metric alert with a dynamic threshold when the monitoringService = `Platform`
145171

146172
```json
147173
{
@@ -173,7 +199,7 @@ The common schema includes information about the affected resource and the cause
173199
}
174200
}
175201
```
176-
### Sample metric alert for availability tests and the monitoringService = Platform
202+
### Sample metric alert for availability tests when the monitoringService = `Platform`
177203

178204
```json
179205
{
@@ -208,6 +234,39 @@ The common schema includes information about the affected resource and the cause
208234
> - The common schema is not supported for log alerts using webhooks with a custom email subject and/or JSON payload, since the common schema overwrites the custom configurations.
209235
> - Alerts using the common schema have an upper size limit of 256 KB per alert. If the log alerts payload includes search results that cause the alert to exceed the maximum size, the search results aren't embedded in the log alerts payload. You can check if the payload includes the search results with the `IncludedSearchResults` flag. Use `LinkToFilteredSearchResultsAPI` or `LinkToSearchResultsAPI` to access query results with the [Log Analytics API](/rest/api/loganalytics/dataaccess/query/get) if the search results are not included.
210236
237+
|Field |Description |
238+
|---------|---------|
239+
|SearchQuery |The query defined in the alert rule. |
240+
|SearchIntervalStartTimeUtc |The start time of the evaluation window in which the alert fired in UTC. |
241+
|SearchIntervalEndTimeUtc |The end time of the evaluation window in which the alert fired in UTC. |
242+
|ResultCount |The number of records returned by the query. For metric measurement rules, the number or records that match the specific dimension combination. |
243+
|LinkToSearchResults |A link to the search results. |
244+
|LinkToFilteredSearchResultsUI |For metric measurement rules, the link to the search results after they've been filtered by the dimension combinations. |
245+
|LinkToSearchResultsAPI |A link to the query results using the Log Analytics API. |
246+
|LinkToFilteredSearchResultsAPI |For metric measurement rules, the link to the search results using the Log Analytics API after they've been filtered by the dimension combinations. |
247+
|SearchIntervalDurationMin |The total number of minutes in the search interval. |
248+
|SearchIntervalInMin |The total number of minutes in the search interval. |
249+
|Threshold |The threshold defined in the alert rule. |
250+
|Operator |The operator defined in the alert rule. |
251+
|ApplicationID |The Application Insights ID on which the alert was triggered. |
252+
|Dimensions |For metric measurement rules, the metric dimensions on which the alert was triggered. |
253+
|name |The dimension name. |
254+
|value |The dimension value. |
255+
|SearchResults |The complete search results. |
256+
|table |The table of results in the search results. |
257+
|name |The name of the table in the search results. |
258+
|columns |The columns in the table. |
259+
|name |The name of the column. |
260+
|type |The type of the column. |
261+
|rows |The rows in the table. |
262+
|DataSources |The data sources on which the alert was triggered. |
263+
|resourceID |The resource ID affected by the alert. |
264+
|tables |The draft response tables included in the query. |
265+
|IncludedSearchResults | Flag that indicates if the payload should contain the results. |
266+
|AlertType |The alert type:<br> - Metric Measurement<br> - Number Of Results |
267+
268+
269+
211270
### Sample log alert when the monitoringService = Platform
212271

213272
```json
@@ -352,7 +411,6 @@ The common schema includes information about the affected resource and the cause
352411
}
353412
}
354413
```
355-
356414
### Sample log alert when the monitoringService = Log Alerts V2
357415

358416
> [!NOTE]
@@ -399,9 +457,9 @@ The common schema includes information about the affected resource and the cause
399457
}
400458
}
401459
```
402-
403460
## Alert context fields for activity log alerts
404461

462+
See [Azure activity log event schema](../essentials/activity-log-schema.md) for detailed information about the fields in activity log alerts.
405463
### Sample activity log alert when the monitoringService = Activity Log - Administrative
406464

407465
```json
@@ -427,7 +485,6 @@ The common schema includes information about the affected resource and the cause
427485
}
428486
}
429487
```
430-
431488
### Sample activity log alert when the monitoringService = Activity Log - Policy
432489

433490
```json
@@ -459,7 +516,6 @@ The common schema includes information about the affected resource and the cause
459516
}
460517
}
461518
```
462-
463519
### Sample activity log alert when the monitoringService = Activity Log - Autoscale
464520

465521
```json
@@ -488,7 +544,6 @@ The common schema includes information about the affected resource and the cause
488544
}
489545
}
490546
```
491-
492547
### Sample activity log alert when the monitoringService = Activity Log - Security
493548

494549
```json
@@ -520,7 +575,6 @@ The common schema includes information about the affected resource and the cause
520575
}
521576
}
522577
```
523-
524578
### Sample activity log alert when the monitoringService = ServiceHealth
525579

526580
```json
@@ -564,7 +618,6 @@ The common schema includes information about the affected resource and the cause
564618
}
565619
}
566620
```
567-
568621
### Sample activity log alert when the monitoringService = ResourceHealth
569622

570623
```json
@@ -591,9 +644,9 @@ The common schema includes information about the affected resource and the cause
591644
}
592645
}
593646
```
594-
595647
## Alert context fields for Prometheus alerts
596648

649+
See [Azure Monitor managed service for Prometheus rule groups (preview)](../essentials/prometheus-rule-groups.md) for detailed information about the fields in Prometheus alerts.
597650
### Sample Prometheus alert
598651

599652
```json
@@ -614,7 +667,6 @@ The common schema includes information about the affected resource and the cause
614667
}
615668
}
616669
```
617-
618670
## Enable the common alert schema
619671

620672
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.
@@ -628,14 +680,11 @@ Use action groups in the Azure portal or use the REST API to enable the common a
628680

629681
1. Open any existing action or a new action in an action group.
630682
1. Select **Yes** to enable the common alert schema.
631-
632683
### Enable the common schema using the REST API
633684

634685
You can also use the [Action Groups API](/rest/api/monitor/actiongroups) to opt in to the common alert schema. In the [create or update](/rest/api/monitor/actiongroups/createorupdate) REST API call,
635686
- Set the "useCommonAlertSchema" flag to `true` to enable the common schema
636687
- Set the "useCommonAlertSchema" flag to `false` to use the non-common schema for email, webhook, Logic Apps, Azure Functions, or Automation runbook actions.
637-
638-
639688
#### Sample REST API call for using the common schema
640689

641690
The following [create or update](/rest/api/monitor/actiongroups/createorupdate) REST API request:
@@ -685,7 +734,6 @@ The following [create or update](/rest/api/monitor/actiongroups/createorupdate)
685734
"tags": {}
686735
}
687736
```
688-
689737
## Next steps
690738

691739
- [Learn how to create a logic app that uses the common alert schema to handle all your alerts](./alerts-common-schema-integrations.md)

0 commit comments

Comments
 (0)