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.

  1. From the Monitor menu in the Azure portal, select Alerts.
  2. If Monitoring Service isn't displayed as a filter option, then select Add Filter and add it.
  3. Set the filter Monitoring Service to Prometheus to see Prometheus alerts. Screenshot of a list of alerts in Azure Monitor with a filter for Prometheus alerts.
  4. Click the alert name to view the details of a specific fired/resolved alert. Screenshot of detail for a Prometheus alert in Azure Monitor.

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

  1. In the fired alerts details pane, you can click the View query in Grafana link.
  2. A browser tab is opened taking you to the Azure Managed Grafana instance connected to your Azure Monitor Workspace.
  3. 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.

Note

  1. If there is no Azure Managed Grafana connected to your Azure Monitor Workspace, a link to Grafana will not be available.
  2. 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.

Next steps