Skip to content

Commit

Permalink
[Hub Generated] Review request for Microsoft.AlertsManagement to add …
Browse files Browse the repository at this point in the history
…version stable/2023-03-01 (#22284)

* Adds base for updating Microsoft.AlertsManagement from version preview/2021-07-22-preview to version 2023-03-01

* Updates readme

* Updates API version in new specs and examples

* adding PrometheusRuleGroups stable api-version

* rename example titles

* improve descriptions

* improve examples

* fix lintdiff errors

* add pattern to rule name

* fix pattern

* remove validations

* add recomandations

* change actions

* change to last acions property version

* run prettier

* fix PR review comments

---------

Co-authored-by: Moshe Malka <momalka@microsoft.com>
  • Loading branch information
moshemal and Moshe Malka authored Mar 15, 2023
1 parent c72a972 commit 5342f41
Show file tree
Hide file tree
Showing 8 changed files with 1,118 additions and 1 deletion.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
{
"parameters": {
"subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7",
"resourceGroupName": "promResourceGroup",
"ruleGroupName": "myPrometheusRuleGroup",
"api-version": "2023-03-01",
"parameters": {
"location": "East US",
"properties": {
"description": "This is the description of the following rule group",
"enabled": true,
"interval": "PT10M",
"clusterName": "myClusterName",
"scopes": [
"/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace"
],
"rules": [
{
"record": "job_type:billing_jobs_duration_seconds:99p5m",
"expression": "histogram_quantile(0.99, sum(rate(jobs_duration_seconds_bucket{service=\"billing-processing\"}[5m])) by (job_type))",
"labels": {
"team": "prod"
}
},
{
"alert": "Billing_Processing_Very_Slow",
"expression": "job_type:billing_jobs_duration_seconds:99p5m > 30",
"enabled": true,
"severity": 2,
"for": "PT5M",
"labels": {
"team": "prod"
},
"annotations": {
"annotationName1": "annotationValue1"
},
"resolveConfiguration": {
"autoResolved": true,
"timeToResolve": "PT10M"
},
"actions": [
{
"actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myactiongroup",
"actionProperties": {
"key11": "value11",
"key12": "value12"
}
},
{
"actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myotheractiongroup",
"actionProperties": {
"key21": "value21",
"key22": "value22"
}
}
]
}
]
}
}
},
"responses": {
"200": {
"headers": {},
"body": {
"id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/promResourceGroup/providers/providers/Microsoft.AlertsManagement/prometheusRuleGroups/myPrometheusRuleGroup",
"type": "Microsoft.AlertsManagement/prometheusRuleGroups",
"location": "East US",
"properties": {
"description": "This is the description of the following rule group",
"enabled": true,
"interval": "PT10M",
"clusterName": "myClusterName",
"scopes": [
"/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace"
],
"rules": [
{
"record": "job_type:billing_jobs_duration_seconds:99p5m",
"expression": "histogram_quantile(0.99, sum(rate(jobs_duration_seconds_bucket{service=\"billing-processing\"}[5m])) by (job_type))",
"labels": {
"team": "prod"
}
},
{
"alert": "Billing_Processing_Very_Slow",
"expression": "job_type:billing_jobs_duration_seconds:99p5m > 30",
"enabled": true,
"severity": 2,
"for": "PT5M",
"labels": {
"team": "prod"
},
"annotations": {
"annotationName1": "annotationValue1"
},
"resolveConfiguration": {
"autoResolved": true,
"timeToResolve": "PT10M"
},
"actions": [
{
"actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myactiongroup",
"actionProperties": {
"key11": "value11",
"key12": "value12"
}
},
{
"actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myotheractiongroup",
"actionProperties": {
"key21": "value21",
"key22": "value22"
}
}
]
}
]
}
}
},
"201": {
"headers": {},
"body": {
"id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/promResourceGroup/providers/providers/Microsoft.AlertsManagement/prometheusRuleGroups/myPrometheusRuleGroup",
"type": "Microsoft.AlertsManagement/prometheusRuleGroups",
"location": "East US",
"properties": {
"description": "This is the description of the following rule group",
"enabled": true,
"interval": "PT10M",
"clusterName": "myClusterName",
"scopes": [
"/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace"
],
"rules": [
{
"record": "job_type:billing_jobs_duration_seconds:99p5m",
"expression": "histogram_quantile(0.99, sum(rate(jobs_duration_seconds_bucket{service=\"billing-processing\"}[5m])) by (job_type))",
"labels": {
"team": "prod"
}
},
{
"alert": "Billing_Processing_Very_Slow",
"expression": "job_type:billing_jobs_duration_seconds:99p5m > 30",
"enabled": true,
"severity": 2,
"for": "PT5M",
"labels": {
"team": "prod"
},
"annotations": {
"annotationName1": "annotationValue1"
},
"resolveConfiguration": {
"autoResolved": true,
"timeToResolve": "PT10M"
},
"actions": [
{
"actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myactiongroup",
"actionProperties": {
"key11": "value11",
"key12": "value12"
}
},
{
"actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myotheractiongroup",
"actionProperties": {
"key21": "value21",
"key22": "value22"
}
}
]
}
]
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"parameters": {
"subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7",
"resourceGroupName": "promResourceGroup",
"ruleGroupName": "myPrometheusRuleGroup",
"api-version": "2023-03-01"
},
"responses": {
"200": {},
"204": {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"parameters": {
"subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7",
"resourceGroupName": "promResourceGroup",
"ruleGroupName": "myPrometheusRuleGroup",
"api-version": "2023-03-01"
},
"responses": {
"200": {
"headers": {},
"body": {
"id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/promResourceGroup/providers/providers/Microsoft.AlertsManagement/prometheusRuleGroups/myPrometheusRuleGroup",
"type": "Microsoft.AlertsManagement/prometheusRuleGroups",
"location": "East US",
"properties": {
"description": "This is the description of the following rule group",
"enabled": true,
"interval": "PT10M",
"clusterName": "myClusterName",
"scopes": [
"/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace"
],
"rules": [
{
"record": "job_type:billing_jobs_duration_seconds:99p5m",
"expression": "histogram_quantile(0.99, sum(rate(jobs_duration_seconds_bucket{service=\"billing-processing\"}[5m])) by (job_type))",
"labels": {
"team": "prod"
}
},
{
"alert": "Billing_Processing_Very_Slow",
"expression": "job_type:billing_jobs_duration_seconds:99p5m > 30",
"enabled": true,
"severity": 2,
"for": "PT5M",
"labels": {
"team": "prod"
},
"annotations": {
"annotationName1": "annotationValue1"
},
"resolveConfiguration": {
"autoResolved": true,
"timeToResolve": "PT10M"
},
"actions": [
{
"actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myactiongroup",
"actionProperties": {
"key11": "value11",
"key12": "value12"
}
},
{
"actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myotheractiongroup",
"actionProperties": {
"key21": "value21",
"key22": "value22"
}
}
]
}
]
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
{
"parameters": {
"subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7",
"resourceGroupName": "promResourceGroup",
"api-version": "2023-03-01"
},
"responses": {
"200": {
"headers": {},
"body": {
"value": [
{
"id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/promResourceGroup/providers/providers/Microsoft.AlertsManagement/prometheusRuleGroups/ruleGroupName1",
"type": "Microsoft.AlertsManagement/prometheusRuleGroups",
"location": "East US",
"properties": {
"description": "This is the description of the following rule group",
"enabled": true,
"interval": "PT10M",
"clusterName": "myClusterName",
"scopes": [
"/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace"
],
"rules": [
{
"record": "job_type:billing_jobs_duration_seconds:99p5m",
"expression": "histogram_quantile(0.99, sum(rate(jobs_duration_seconds_bucket{service=\"billing-processing\"}[5m])) by (job_type))",
"labels": {
"team": "prod"
}
},
{
"alert": "Billing_Processing_Very_Slow",
"expression": "job_type:billing_jobs_duration_seconds:99p5m > 30",
"enabled": true,
"severity": 2,
"for": "PT5M",
"labels": {
"team": "prod"
},
"annotations": {
"annotationName1": "annotationValue1"
},
"resolveConfiguration": {
"autoResolved": true,
"timeToResolve": "PT10M"
},
"actions": [
{
"actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myactiongroup",
"actionProperties": {
"key11": "value11",
"key12": "value12"
}
},
{
"actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myotheractiongroup",
"actionProperties": {
"key21": "value21",
"key22": "value22"
}
}
]
}
]
}
},
{
"id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/promResourceGroup/providers/providers/Microsoft.AlertsManagement/prometheusRuleGroups/ruleGroupName2",
"type": "Microsoft.AlertsManagement/prometheusRuleGroups",
"location": "East US",
"properties": {
"description": "This is the description of the following rule group",
"enabled": true,
"interval": "PT10M",
"clusterName": "myClusterName",
"scopes": [
"/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace"
],
"rules": [
{
"record": "job_type:billing_jobs_duration_seconds:99p5m",
"expression": "histogram_quantile(0.99, sum(rate(jobs_duration_seconds_bucket{service=\"billing-processing\"}[5m])) by (job_type))",
"labels": {
"team": "prod"
}
},
{
"alert": "Billing_Processing_Very_Slow",
"expression": "job_type:billing_jobs_duration_seconds:99p5m > 30",
"enabled": true,
"severity": 2,
"for": "PT5M",
"labels": {
"team": "prod"
},
"annotations": {
"annotationName1": "annotationValue1"
},
"resolveConfiguration": {
"autoResolved": true,
"timeToResolve": "PT10M"
},
"actions": [
{
"actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myactiongroup",
"actionProperties": {
"key11": "value11",
"key12": "value12"
}
},
{
"actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myotheractiongroup",
"actionProperties": {
"key21": "value21",
"key22": "value22"
}
}
]
}
]
}
}
]
}
}
}
}
Loading

0 comments on commit 5342f41

Please sign in to comment.