Alerting docs: clarify data source-managed rules for Prometheus (#98378)

* Clarify DS managed rules support only the creation of Mimir and Loki rules

* additional copy changes

* Extend `Manage alerts via Alerting UI` description

* fix capital letter

* further details for `Manage alerts via Alerting UI`
pull/98958/head
Pepe Cano 4 months ago committed by GitHub
parent 0b5b21548b
commit 7771768363
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 15
      docs/sources/alerting/alerting-rules/create-data-source-managed-rule.md
  2. 24
      docs/sources/alerting/fundamentals/alert-rules/_index.md
  3. 7
      docs/sources/datasources/prometheus/configure-prometheus-data-source.md
  4. 10
      docs/sources/shared/alerts/note-prometheus-ds-rules.md

@ -20,6 +20,11 @@ labels:
title: Configure data source-managed alert rules title: Configure data source-managed alert rules
weight: 200 weight: 200
refs: refs:
shared-configure-prometheus-data-source-alerting:
- pattern: /docs/grafana/
destination: /docs/grafana/<GRAFANA_VERSION>/datasources/prometheus/configure-prometheus-data-source/#alerting
- pattern: /docs/grafana-cloud/
destination: /docs/grafana-cloud/connect-externally-hosted/data-sources/prometheus/configure-prometheus-data-source/#alerting
configure-grafana-managed-rules: configure-grafana-managed-rules:
- pattern: /docs/grafana/ - pattern: /docs/grafana/
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/create-grafana-managed-rule/ destination: /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/create-grafana-managed-rule/
@ -74,17 +79,19 @@ refs:
# Configure data source-managed alert rules # Configure data source-managed alert rules
Data source-managed alert rules can only query Prometheus-based data sources, such as Prometheus, Grafana Mimir, or Grafana Loki. They are one of the two [alert rule types](ref:alert-rules) supported in Grafana. Data source-managed alert rules can only be created using Grafana Mimir or Grafana Loki data sources.
Data source-managed alert rules are stored within the data source. In a distributed architecture, they can scale horizontally to provide high-availability. The rules are stored within the data source. In a distributed architecture, they can scale horizontally to provide high-availability. For more details, refer to [alert rule types](ref:alert-rules).
We recommend using [Grafana-managed alert rules](ref:configure-grafana-managed-rules) whenever possible and opting for data source-managed alert rules when scaling your alerting setup is necessary. We recommend using [Grafana-managed alert rules](ref:configure-grafana-managed-rules) whenever possible and opting for data source-managed alert rules when scaling your alerting setup is necessary.
{{< docs/shared lookup="alerts/note-prometheus-ds-rules.md" source="grafana" version="<GRAFANA_VERSION>" >}}
To create or edit data source-managed alert rules, follow these instructions. To create or edit data source-managed alert rules, follow these instructions.
## Before you begin ## Before you begin
Verify that you have write permission to the Prometheus, Mimir, or Loki data source. Otherwise, you cannot create or update data source-managed alert rules. Verify that you have write permission to the Mimir or Loki data source. Otherwise, you cannot create or update data source-managed alert rules.
### Enable the Ruler API ### Enable the Ruler API
@ -96,7 +103,7 @@ For more information, refer to the [Mimir Ruler API](/docs/mimir/latest/referenc
### Permissions ### Permissions
Alert rules for Prometheus, Mimir, or Loki instances can be edited or deleted by users with **Editor** or **Admin** roles. Alert rules for Mimir or Loki instances can be edited or deleted by users with **Editor** or **Admin** roles.
If you do not want to manage alert rules for a particular data source, go to its settings and clear the **Manage alerts via Alerting UI** checkbox. If you do not want to manage alert rules for a particular data source, go to its settings and clear the **Manage alerts via Alerting UI** checkbox.

@ -18,6 +18,11 @@ labels:
title: Alert rules title: Alert rules
weight: 100 weight: 100
refs: refs:
shared-configure-prometheus-data-source-alerting:
- pattern: /docs/grafana/
destination: /docs/grafana/<GRAFANA_VERSION>/datasources/prometheus/configure-prometheus-data-source/#alerting
- pattern: /docs/grafana-cloud/
destination: /docs/grafana-cloud/connect-externally-hosted/data-sources/prometheus/configure-prometheus-data-source/#alerting
queries-and-conditions: queries-and-conditions:
- pattern: /docs/grafana/ - pattern: /docs/grafana/
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rules/queries-conditions/ destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rules/queries-conditions/
@ -72,8 +77,9 @@ Grafana-managed alert rules are the most flexible alert rule type. They allow yo
{{< figure src="/media/docs/alerting/grafana-managed-alerting-architecture.png" max-width="750px" caption="How Grafana-managed alerting works by default" >}} {{< figure src="/media/docs/alerting/grafana-managed-alerting-architecture.png" max-width="750px" caption="How Grafana-managed alerting works by default" >}}
1. Alert rules are created within Grafana and query one or more data sources. 1. Alert rules are created and stored within Grafana.
1. Alert rules are evaluated by the Alert Rule Evaluation Engine from within Grafana. 1. Alert rules can query one or more supported data sources.
1. Alert rules are evaluated by the Alert Rule Evaluation Engine within Grafana.
1. Firing and resolved alert instances are forwarded to [handle their notifications](ref:notifications). 1. Firing and resolved alert instances are forwarded to [handle their notifications](ref:notifications).
### Supported data sources ### Supported data sources
@ -84,17 +90,17 @@ Find the public data sources supporting Alerting in the [Grafana Plugins directo
## Data source-managed alert rules ## Data source-managed alert rules
Data source-managed alert rules can only query Prometheus-based data sources, such as Prometheus, Grafana Mimir, or Grafana Loki. Data source-managed alert rules can only be created using Grafana Mimir or Grafana Loki data sources. Both data source backends can provide high availability and fault tolerance, enabling you to scale your alerting setup.
Alert rules are stored within the data source. In this distributed architecture, the separation of components can provide high-availability and fault tolerance, enabling the scaling of your alerting setup.
{{< figure src="/media/docs/alerting/mimir-managed-alerting-architecture-v2.png" max-width="750px" caption="Mimir-managed alerting architecture" >}} {{< figure src="/media/docs/alerting/mimir-managed-alerting-architecture-v2.png" max-width="750px" caption="Mimir-managed alerting architecture" >}}
1. Alert rules are created and stored within the data source itself. 1. Alert rules are stored within the Mimir or Loki data source.
1. Alert rules can only query Prometheus-based data. 1. Alert rules can query only their specific data source.
1. Alert rules are evaluated by the Alert Rule Evaluation Engine. 1. Alert rules are evaluated by the Alert Rule Evaluation Engine within the data source.
1. Firing and resolved alert instances are forwarded to [handle their notifications](ref:notifications). 1. Firing and resolved alert instances are forwarded to [handle their notifications](ref:notifications).
{{< docs/shared lookup="alerts/note-prometheus-ds-rules.md" source="grafana" version="<GRAFANA_VERSION>" >}}
## Comparison between alert rule types ## Comparison between alert rule types
We recommend using Grafana-managed alert rules whenever possible, and opting for data source-managed alert rules when you need to scale your alerting setup. We recommend using Grafana-managed alert rules whenever possible, and opting for data source-managed alert rules when you need to scale your alerting setup.
@ -103,7 +109,7 @@ The table below compares Grafana-managed and data source-managed alert rules.
| <div style="width:200px">Feature</div> | <div style="width:200px">Grafana-managed alert rule</div> | <div style="width:200px">Data source-managed alert rule | | <div style="width:200px">Feature</div> | <div style="width:200px">Grafana-managed alert rule</div> | <div style="width:200px">Data source-managed alert rule |
| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| Create alert rules<wbr /> that query [data sources supporting Alerting](#supported-data-sources) | Yes | No. Only query Prometheus-based data sources. | | Create alert rules<wbr /> that query [data sources supporting Alerting](#supported-data-sources) | Yes | Only supports creating rules for Mimir and Loki. |
| Mix and match data sources | Yes | No | | Mix and match data sources | Yes | No |
| Add [expressions](ref:expression-queries) to transform<wbr /> your data and set [alert conditions](ref:alert-condition) | Yes | No | | Add [expressions](ref:expression-queries) to transform<wbr /> your data and set [alert conditions](ref:alert-condition) | Yes | No |
| Use [images in alert notifications](ref:notification-images) | Yes | No | | Use [images in alert notifications](ref:notification-images) | Yes | No |

@ -31,6 +31,11 @@ refs:
destination: /docs/grafana/<GRAFANA_VERSION>/panels-visualizations/configure-data-links/#value-variables destination: /docs/grafana/<GRAFANA_VERSION>/panels-visualizations/configure-data-links/#value-variables
- pattern: /docs/grafana-cloud/ - pattern: /docs/grafana-cloud/
destination: /docs/grafana/<GRAFANA_VERSION>/panels-visualizations/configure-data-links/#value-variables destination: /docs/grafana/<GRAFANA_VERSION>/panels-visualizations/configure-data-links/#value-variables
alerting-alert-rules:
- pattern: /docs/grafana/
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rules/
- pattern: /docs/grafana-cloud/
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rules/
--- ---
# Configure Prometheus # Configure Prometheus
@ -115,7 +120,7 @@ Following are additional configuration options.
### Alerting ### Alerting
- **Manage alerts via Alerting UI** - Toggle to enable `Alertmanager` integration for this data source. - **Manage alerts via Alerting UI** - Toggle to enable [data source-managed rules in Grafana Alerting](ref:alerting-alert-rules) for this data source. For `Mimir`, it enables managing data source-managed rules and alerts. For `Prometheus`, it only supports viewing existing rules and alerts, which are displayed as data source-managed.
{{% admonition type="note" %}} {{% admonition type="note" %}}

@ -0,0 +1,10 @@
---
labels:
products:
- oss
title: 'Note Prometheus data source-managed rules'
---
> Rules from a Prometheus data source appear in the **Data source-managed** section of the **Alert rules** page when [Manage alerts via Alerting UI](ref:shared-configure-prometheus-data-source-alerting) is enabled.
>
> However, Grafana can only create and edit data source-managed rules for Mimir and Loki, not for a Prometheus instance.
Loading…
Cancel
Save