Docs: adds evaluation doc (#70757)

* Docs: adds evaluation doc

* Adds note on classic condition

* fixes link

* fixes link

* fixes link

* fixes data source

* link fix

* fixes rbac link

* adds aliases
This commit is contained in:
brendamuir
2023-06-28 10:38:59 +02:00
committed by GitHub
parent 7f55ba9c6e
commit 5159317ee7
14 changed files with 85 additions and 3 deletions

View File

@@ -97,7 +97,7 @@ The following tables list permissions associated with basic and fixed roles.
### Alerting roles
If alerting is [enabled]({{< relref "../../../../alerting/migrating-alerts/opt-out/" >}}), you can use predefined roles to manage user access to alert rules, alert instances, and alert notification settings and create custom roles to limit user access to alert rules in a folder.
If alerting is [enabled]({{< relref "../../../../alerting/set-up/migrating-alerts/opt-out/" >}}), you can use predefined roles to manage user access to alert rules, alert instances, and alert notification settings and create custom roles to limit user access to alert rules in a folder.
Access to Grafana alert rules is an intersection of many permissions:

View File

@@ -5,6 +5,7 @@ aliases:
- ../../contact-points/edit-contact-point/
- ../../contact-points/test-contact-point/
- ../create-contact-point/
- alerting/manage-notifications/manage-contact-points/
description: How to manage your contact points
keywords:
- grafana

View File

@@ -1,4 +1,6 @@
---
aliases:
- alerting/manage-notifications/manage-contact-points/configure-integrations/
description: Configure integrations
keywords:
- Grafana

View File

@@ -2,6 +2,7 @@
aliases:
- ../contact-points/notifiers/webhook-notifier/
- ../fundamentals/contact-points/webhook-notifier/
- alerting/manage-notifications/manage-contact-points/webhook-notifier/
description: Configure the webhook notifier for notifications
keywords:
- grafana

View File

@@ -13,7 +13,7 @@ keywords:
In Grafana, queries play a vital role in fetching and transforming data from supported data sources, which include databases like MySQL and PostgreSQL, time series databases like Prometheus, InfluxDB and Graphite, and services like Elasticsearch, AWS CloudWatch, Azure Monitor and Google Cloud Monitoring.
For more information on supported data sources, see [Data sources]({{< relref "../data-source-alerting.md" >}}).
For more information on supported data sources, see [Data sources]({{< relref "../../data-source-alerting.md" >}}).
The process of executing a query involves defining the data source, specifying the desired data to retrieve, and applying relevant filters or transformations. Query languages or syntaxes specific to the chosen data source are utilized for constructing these queries.
@@ -21,7 +21,7 @@ In Alerting, you define a query to get the data you want to measure and a condit
An alert rule consists of one or more queries and expressions that select the data you want to measure.
For more information on queries and expressions, see [Query and transform data]({{< relref "../../../panels-visualizations/query-transform-data" >}}).
For more information on queries and expressions, see [Query and transform data]({{< relref "../../../../panels-visualizations/query-transform-data" >}}).
## Data source queries
@@ -55,6 +55,10 @@ In Alerting, you can only use expressions for Grafana-managed alert rules. For e
You can also use classic condition, which creates an alert rule that triggers a single alert when its condition is met. As a result, Grafana sends only a single alert even when alert conditions are met for multiple series.
**Note:**
Classic conditions exist mainly for compatibility reasons and should be avoided if possible.
**Reduce**
Aggregates time series values in the selected time range into a single value.

View File

@@ -0,0 +1,64 @@
---
title: Alert rule evaluation
description: Introduction to alert rule evaluation
weight: 106
keywords:
- grafana
- alerting
- evaluation
---
# Alert rule evaluation
Use alert rule evaluation to determine how frequently an alert rule should be evaluated and how quickly it should change its state.
To do this, you need to make sure that your alert rule is in the right evaluation group and set a pending period time that works best for your use case.
## Evaluation group
Every alert rule is part of an evaluation group. Each evaluation group contains an evaluation interval that determines how frequently the alert rule is checked. Alert rules within the same group are evaluated one after the other, while alert rules in different groups can be evaluated simultaneously.
This feature is especially useful for Prometheus/Mimir rules when you want to ensure that recording rules are evaluated before any alert rules.
**Note:**
Evaluation groups and alerts grouping in notification policies are two separate things. Grouping in notification policies allows multiple alerts sharing the same labels to be sent in the same time message.
## Pending period
By setting a pending period, you can avoid unnecessary alerts for temporary problems.
In the pending period, you select the period in which an alert rule can be in breach of the condition until it fires.
**Example**
Imagine you have an alert rule evaluation interval set at every 30 seconds and the pending period to 90 seconds.
Evaluation will occur as follows:
[00:30] First evaluation - condition not met.
[01:00] Second evaluation - condition breached.
Pending counter starts. **Alert stars pending.**
[01:30] Third evaluation - condition breached. Pending counter = 30s. **Pending state.**
[02:00] Fourth evaluation - condition breached. Pending counter = 60s **Pending state.**
[02:30] Fifth evaluation - condition breached. Pending counter = 90s. **Alert starts firing**
If the alert rule has a condition that needs to be in breach for a certain amount of time before it takes action, then its state changes as follows:
- When the condition is first breached, the rule goes into a "pending" state.
- The rule stays in the "pending" state until the condition has been broken for the required amount of time - pending period.
- Once the required time has passed, the rule goes into a "firing" state.
- If the condition is no longer broken during the pending period, the rule goes back to its normal state.
**Note:**
If you want to skip the pending state, you can simply set the pending period to 0. This effectively skips the pending period and your alert rule will start firing as soon as the condition is breached.
When an alert rule fires, alert instances are produced, which are then sent to the Alertmanager.

View File

@@ -3,6 +3,7 @@ aliases:
- ../fundamentals/alertmanager/
- ../metrics/
- ../unified-alerting/fundamentals/alertmanager/
- alerting/manage-notifications/alertmanager/
description: Intro to the different Alertmanagers
title: Alertmanager
weight: 103

View File

@@ -1,6 +1,7 @@
---
aliases:
- ../notifications/
- alerting/manage-notifications/create-notification-policy/
description: Notification policies
keywords:
- grafana

View File

@@ -1,4 +1,6 @@
---
aliases:
- alerting/alerting-rules/declare-incident-from-alert/
description: Declare an incident from a firing alert
keywords:
- grafana

View File

@@ -1,6 +1,7 @@
---
aliases:
- meta-monitoring/
- alerting/meta-monitoring/
description: Meta monitoring
keywords:
- grafana

View File

@@ -3,6 +3,7 @@ aliases:
- difference-old-new/
- unified-alerting/
- unified-alerting/difference-old-new/
- alerting/migrating-alerts/
description: Upgrade Grafana alerts
title: Upgrade Alerting
weight: 150

View File

@@ -1,5 +1,7 @@
---
title: Legacy alerting deprecation
aliases:
- alerting/legacy-alerting-deprecation/
description: Legacy alerting deprecation notice
weight: 109
keywords:

View File

@@ -3,6 +3,7 @@ aliases:
- /docs/grafana-cloud/alerts/
- /docs/grafana-cloud/how-do-i/alerts/
- /docs/grafana-cloud/legacy-alerting/
- alerting/migrating-alerts/legacy-alerting/
description: Legacy alerting
title: Legacy alerting
weight: 110

View File

@@ -1,6 +1,7 @@
---
aliases:
- alerting-limitations/
- alerting/performance-limitations/
description: Performance considerations and limitations
keywords:
- grafana