Prometheus Rule Groups - Get
Retrieve a Prometheus rule group definition.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AlertsManagement/prometheusRuleGroups/{ruleGroupName}?api-version=2023-03-01
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
resource
|
path | True |
string |
The name of the resource group. The name is case insensitive. |
rule
|
path | True |
string |
The name of the rule group. Regex pattern: |
subscription
|
path | True |
string |
The ID of the target subscription. |
api-version
|
query | True |
string |
The API version to use for this operation. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
Successful request for a list of Prometheus rule groups |
|
Other Status Codes |
Error response describing why the operation failed. |
Examples
Get a PrometheusRuleGroup
Sample request
GET https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/promResourceGroup/providers/Microsoft.AlertsManagement/prometheusRuleGroups/myPrometheusRuleGroup?api-version=2023-03-01
Sample response
{
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/promResourceGroup/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/ffffffff-ffff-ffff-ffff-ffffffffffff/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/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myactiongroup",
"actionProperties": {
"key11": "value11",
"key12": "value12"
}
},
{
"actionGroupId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/myrg/providers/microsoft.insights/actiongroups/myotheractiongroup",
"actionProperties": {
"key21": "value21",
"key22": "value22"
}
}
]
}
]
}
}
Definitions
Name | Description |
---|---|
created |
The type of identity that created the resource. |
Error |
The resource management error additional info. |
Error |
The error detail. |
Error |
Error response |
Prometheus |
An Azure Prometheus alerting or recording rule. |
Prometheus |
An alert action. Only relevant for alerts. |
Prometheus |
The Prometheus rule group resource. |
Prometheus |
Specifies the Prometheus alert rule configuration. |
system |
Metadata pertaining to creation and last modification of the resource. |
createdByType
The type of identity that created the resource.
Name | Type | Description |
---|---|---|
Application |
string |
|
Key |
string |
|
ManagedIdentity |
string |
|
User |
string |
ErrorAdditionalInfo
The resource management error additional info.
Name | Type | Description |
---|---|---|
info |
object |
The additional info. |
type |
string |
The additional info type. |
ErrorDetail
The error detail.
Name | Type | Description |
---|---|---|
additionalInfo |
The error additional info. |
|
code |
string |
The error code. |
details |
The error details. |
|
message |
string |
The error message. |
target |
string |
The error target. |
ErrorResponse
Error response
Name | Type | Description |
---|---|---|
error |
The error object. |
PrometheusRule
An Azure Prometheus alerting or recording rule.
Name | Type | Description |
---|---|---|
actions |
Actions that are performed when the alert rule becomes active, and when an alert condition is resolved. |
|
alert |
string |
Alert rule name. |
annotations |
object |
The annotations clause specifies a set of informational labels that can be used to store longer additional information such as alert descriptions or runbook links. The annotation values can be templated. |
enabled |
boolean |
Enable/disable rule. |
expression |
string |
The PromQL expression to evaluate. https://prometheus.io/docs/prometheus/latest/querying/basics/. Evaluated periodically as given by 'interval', and the result recorded as a new set of time series with the metric name as given by 'record'. |
for |
string |
The amount of time alert must be active before firing. |
labels |
object |
Labels to add or overwrite before storing the result. |
record |
string |
Recorded metrics name. |
resolveConfiguration |
Defines the configuration for resolving fired alerts. Only relevant for alerts. |
|
severity |
integer |
The severity of the alerts fired by the rule. Must be between 0 and 4. |
PrometheusRuleGroupAction
An alert action. Only relevant for alerts.
Name | Type | Description |
---|---|---|
actionGroupId |
string |
The resource id of the action group to use. |
actionProperties |
object |
The properties of an action group object. |
PrometheusRuleGroupResource
The Prometheus rule group resource.
Name | Type | Description |
---|---|---|
id |
string |
Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} |
location |
string |
The geo-location where the resource lives |
name |
string |
The name of the resource |
properties.clusterName |
string |
Apply rule to data from a specific cluster. |
properties.description |
string |
Rule group description. |
properties.enabled |
boolean |
Enable/disable rule group. |
properties.interval |
string |
The interval in which to run the Prometheus rule group represented in ISO 8601 duration format. Should be between 1 and 15 minutes |
properties.rules |
Defines the rules in the Prometheus rule group. |
|
properties.scopes |
string[] |
Target Azure Monitor workspaces resource ids. This api-version is currently limited to creating with one scope. This may change in future. |
systemData |
Azure Resource Manager metadata containing createdBy and modifiedBy information. |
|
tags |
object |
Resource tags. |
type |
string |
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" |
PrometheusRuleResolveConfiguration
Specifies the Prometheus alert rule configuration.
Name | Type | Description |
---|---|---|
autoResolved |
boolean |
Enable alert auto-resolution. |
timeToResolve |
string |
Alert auto-resolution timeout. |
systemData
Metadata pertaining to creation and last modification of the resource.
Name | Type | Description |
---|---|---|
createdAt |
string |
The timestamp of resource creation (UTC). |
createdBy |
string |
The identity that created the resource. |
createdByType |
The type of identity that created the resource. |
|
lastModifiedAt |
string |
The timestamp of resource last modification (UTC) |
lastModifiedBy |
string |
The identity that last modified the resource. |
lastModifiedByType |
The type of identity that last modified the resource. |