Prometheus alerts in Azure Monitor
As part of Azure Monitor managed services for Prometheus, Prometheus alert rules allow you to define alert conditions, using queries written in Prometheus Query Language (Prom QL). The rule queries are applied on Prometheus metrics stored in Azure Monitor workspace. Whenever the alert query results in one or more time series meeting the condition, the alert counts as pending for these metric and label sets. A pending alert becomes active after a user-defined period of time during which all the consecutive query evaluations for the respective time series meet the alert condition. Once an alert becomes active, it's fired and would trigger your actions or notifications of choice, as defined in the Azure Action Groups configured in your alert rule.
Create Prometheus alert rules
Prometheus alert rules are created and managed as part of a Prometheus rule group. See Azure Monitor managed service for Prometheus rule groups for details.
View Prometheus alerts
You can view fired and resolved Prometheus alerts in the Azure portal together with all other alert types. Use the following steps to filter on only Prometheus alerts.
- From the Monitor menu in the Azure portal, select Alerts.
- If Monitoring Service isn't displayed as a filter option, then select Add Filter and add it.
- Set the filter Monitoring Service to Prometheus to see Prometheus alerts.
- Click the alert name to view the details of a specific fired/resolved alert.
If your rule group is configured with a specific cluster scope, you can also view alerts fired for this cluster, under this cluster alerts blade. From the cluster menu in the Azure portal, select Alerts. You can then filter for the Prometheus monitor service.
Explore Prometheus alerts in Grafana
- In the fired alerts details pane, you can click the View query in Grafana link.
- A browser tab is opened taking you to the Azure Managed Grafana instance connected to your Azure Monitor Workspace.
- Grafana is opened in Explore mode, presenting the chart for your alert rule expression query around the alert firing time. You can further explore the query in Grafana to identify the reason causing the alert to fire.
- If there is no Azure Managed Grafana connected to your Azure Monitor Workspace, a link to Grafana will not be available.
- In order to view the alert query in Explore mode, you must have either a Grafana Admin or Grafana Editor role permissions. If you don't have the needed permissions, you will get a respective Grafana error.