|
| 1 | +{ |
| 2 | + "parameters": { |
| 3 | + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", |
| 4 | + "resourceGroupName": "promResourceGroup", |
| 5 | + "ruleGroupName": "myPrometheusRuleGroup", |
| 6 | + "api-version": "2023-03-01", |
| 7 | + "parameters": { |
| 8 | + "location": "East US", |
| 9 | + "properties": { |
| 10 | + "description": "This is the description of the following rule group", |
| 11 | + "enabled": true, |
| 12 | + "interval": "PT10M", |
| 13 | + "clusterName": "myClusterName", |
| 14 | + "scopes": [ |
| 15 | + "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace" |
| 16 | + ], |
| 17 | + "rules": [ |
| 18 | + { |
| 19 | + "record": "job_type:billing_jobs_duration_seconds:99p5m", |
| 20 | + "expression": "histogram_quantile(0.99, sum(rate(jobs_duration_seconds_bucket{service=\"billing-processing\"}[5m])) by (job_type))", |
| 21 | + "labels": { |
| 22 | + "team": "prod" |
| 23 | + } |
| 24 | + }, |
| 25 | + { |
| 26 | + "alert": "Billing_Processing_Very_Slow", |
| 27 | + "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30", |
| 28 | + "enabled": true, |
| 29 | + "severity": 2, |
| 30 | + "for": "PT5M", |
| 31 | + "labels": { |
| 32 | + "team": "prod" |
| 33 | + }, |
| 34 | + "annotations": { |
| 35 | + "annotationName1": "annotationValue1" |
| 36 | + }, |
| 37 | + "resolveConfiguration": { |
| 38 | + "autoResolved": true, |
| 39 | + "timeToResolve": "PT10M" |
| 40 | + }, |
| 41 | + "actions": [ |
| 42 | + { |
| 43 | + "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myactiongroup", |
| 44 | + "actionProperties": { |
| 45 | + "key11": "value11", |
| 46 | + "key12": "value12" |
| 47 | + } |
| 48 | + }, |
| 49 | + { |
| 50 | + "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myotheractiongroup", |
| 51 | + "actionProperties": { |
| 52 | + "key21": "value21", |
| 53 | + "key22": "value22" |
| 54 | + } |
| 55 | + } |
| 56 | + ] |
| 57 | + } |
| 58 | + ] |
| 59 | + } |
| 60 | + } |
| 61 | + }, |
| 62 | + "responses": { |
| 63 | + "200": { |
| 64 | + "headers": {}, |
| 65 | + "body": { |
| 66 | + "id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/promResourceGroup/providers/providers/Microsoft.AlertsManagement/prometheusRuleGroups/myPrometheusRuleGroup", |
| 67 | + "type": "Microsoft.AlertsManagement/prometheusRuleGroups", |
| 68 | + "location": "East US", |
| 69 | + "properties": { |
| 70 | + "description": "This is the description of the following rule group", |
| 71 | + "enabled": true, |
| 72 | + "interval": "PT10M", |
| 73 | + "clusterName": "myClusterName", |
| 74 | + "scopes": [ |
| 75 | + "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace" |
| 76 | + ], |
| 77 | + "rules": [ |
| 78 | + { |
| 79 | + "record": "job_type:billing_jobs_duration_seconds:99p5m", |
| 80 | + "expression": "histogram_quantile(0.99, sum(rate(jobs_duration_seconds_bucket{service=\"billing-processing\"}[5m])) by (job_type))", |
| 81 | + "labels": { |
| 82 | + "team": "prod" |
| 83 | + } |
| 84 | + }, |
| 85 | + { |
| 86 | + "alert": "Billing_Processing_Very_Slow", |
| 87 | + "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30", |
| 88 | + "enabled": true, |
| 89 | + "severity": 2, |
| 90 | + "for": "PT5M", |
| 91 | + "labels": { |
| 92 | + "team": "prod" |
| 93 | + }, |
| 94 | + "annotations": { |
| 95 | + "annotationName1": "annotationValue1" |
| 96 | + }, |
| 97 | + "resolveConfiguration": { |
| 98 | + "autoResolved": true, |
| 99 | + "timeToResolve": "PT10M" |
| 100 | + }, |
| 101 | + "actions": [ |
| 102 | + { |
| 103 | + "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myactiongroup", |
| 104 | + "actionProperties": { |
| 105 | + "key11": "value11", |
| 106 | + "key12": "value12" |
| 107 | + } |
| 108 | + }, |
| 109 | + { |
| 110 | + "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myotheractiongroup", |
| 111 | + "actionProperties": { |
| 112 | + "key21": "value21", |
| 113 | + "key22": "value22" |
| 114 | + } |
| 115 | + } |
| 116 | + ] |
| 117 | + } |
| 118 | + ] |
| 119 | + } |
| 120 | + } |
| 121 | + }, |
| 122 | + "201": { |
| 123 | + "headers": {}, |
| 124 | + "body": { |
| 125 | + "id": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/promResourceGroup/providers/providers/Microsoft.AlertsManagement/prometheusRuleGroups/myPrometheusRuleGroup", |
| 126 | + "type": "Microsoft.AlertsManagement/prometheusRuleGroups", |
| 127 | + "location": "East US", |
| 128 | + "properties": { |
| 129 | + "description": "This is the description of the following rule group", |
| 130 | + "enabled": true, |
| 131 | + "interval": "PT10M", |
| 132 | + "clusterName": "myClusterName", |
| 133 | + "scopes": [ |
| 134 | + "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace" |
| 135 | + ], |
| 136 | + "rules": [ |
| 137 | + { |
| 138 | + "record": "job_type:billing_jobs_duration_seconds:99p5m", |
| 139 | + "expression": "histogram_quantile(0.99, sum(rate(jobs_duration_seconds_bucket{service=\"billing-processing\"}[5m])) by (job_type))", |
| 140 | + "labels": { |
| 141 | + "team": "prod" |
| 142 | + } |
| 143 | + }, |
| 144 | + { |
| 145 | + "alert": "Billing_Processing_Very_Slow", |
| 146 | + "expression": "job_type:billing_jobs_duration_seconds:99p5m > 30", |
| 147 | + "enabled": true, |
| 148 | + "severity": 2, |
| 149 | + "for": "PT5M", |
| 150 | + "labels": { |
| 151 | + "team": "prod" |
| 152 | + }, |
| 153 | + "annotations": { |
| 154 | + "annotationName1": "annotationValue1" |
| 155 | + }, |
| 156 | + "resolveConfiguration": { |
| 157 | + "autoResolved": true, |
| 158 | + "timeToResolve": "PT10M" |
| 159 | + }, |
| 160 | + "actions": [ |
| 161 | + { |
| 162 | + "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myactiongroup", |
| 163 | + "actionProperties": { |
| 164 | + "key11": "value11", |
| 165 | + "key12": "value12" |
| 166 | + } |
| 167 | + }, |
| 168 | + { |
| 169 | + "actionGroupId": "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myotheractiongroup", |
| 170 | + "actionProperties": { |
| 171 | + "key21": "value21", |
| 172 | + "key22": "value22" |
| 173 | + } |
| 174 | + } |
| 175 | + ] |
| 176 | + } |
| 177 | + ] |
| 178 | + } |
| 179 | + } |
| 180 | + } |
| 181 | + } |
| 182 | +} |
0 commit comments