Alerting: unified alerting docs state and health (#34945)

* alerting rule lading page

* add alert state and health doc

* update

*  Conflicts:
	docs/sources/alerting/unified-alerting/alerting-rules/rule-list.md
This commit is contained in:
David Parrott 2021-06-03 09:59:45 -07:00 committed by GitHub
parent d50b7c526b
commit 17d98cfe43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 45 additions and 7 deletions

View File

@ -11,7 +11,7 @@ Alerts allow you to know about problems in your systems moments after they occur
Alerts have four main components:
- Alerting rule - One or more conditions, the frequency of evaluation, and the (optional) duration that a condition must be met before notifying.
- Alerting rule - One or more query and/or expression, a condition, the frequency of evaluation, and the (optional) duration that a condition must be met before creating an alert.
- Contact point - A channel for sending notifications when the conditions of an alerting rule are met.
- Notification policy - A set of matching and grouping criteria used to determine where, and how frequently, to send notifications.
- Silences - Date and matching criteria used to silence notifications.
@ -22,7 +22,7 @@ You can perform the following tasks for alerts:
- [Create a Grafana managed alert rule]({{< relref "./create-grafana-managed-rule.md" >}})
- [Create a Cortex or Loki managed alert rule]({{< relref "./create-cortex-loki-managed-rule.md" >}})
- [View existing alert rules and their current state]({{< relref "./view-alerts.md" >}})
- [View existing alert rules and their current state]({{< relref "./rule-list.md" >}})
- [Test alert rules and troubleshoot]({{< relref "./troubleshoot-alerts.md" >}})
- [Add or edit an alert contact point]({{< relref "./contact-points.md" >}})
- [Add or edit notification policies]({{< relref "./notification-policies.md" >}})
@ -56,4 +56,4 @@ Metric Name | Type | Description
`alerting.rule_group_rules` | gauge | The number of rules
- [View alert rules and their current state]({{< relref "./rule-list.md" >}})
- [View alert rules and their current state]({{< relref "./rule-list.md" >}})

View File

@ -0,0 +1,12 @@
+++
title = "Alerting Rules"
aliases = ["/docs/grafana/latest/alerting/rules/"]
+++
# Alerting Rules
One or more queries and/or expressions, a condition, the frequency of evaluation, and the (optional) duration that a condition must be met before creating an alert. Alerting rules are how you express the criteria for creating an alert. Queries and expressions select and can operate on the data you wish to alert on. A condition sets the threshold that an alert must meet or exceed to create an alert. The interval specifies how frequently the rule should be evaluated. The duration, when configured, sets a period that a condition must be met or exceeded before an alert is created. Alerting rules also can contain settings for what to do when your query does not return any data, or there is an error attempting to execute the query.
- [View existing alert rules and their current state]({{< relref "./rule-list.md" >}})
- [Create Cortex or Loki managed alert rule]({{< relref "./create-cortex-loki-managed-rule.md" >}})
- [Create Grafana managed alert rule]({{< relref "./create-grafana-managed-rule.md" >}})
- [State and Health of alerting rules]({{< relref "./state-and-health.md" >}})

View File

@ -31,7 +31,7 @@ This section describes the fields you fill out to create an alert.
### Query
Add one or more [queries]({{< relref "../../panels/queries.md" >}}) or [expressions]({{< relref "../../panels/expressions.md" >}}). You can use classic condition expression to create a rule that will trigger a single alert if it's threshold is met, or use reduce and math expressions to create a multi dimensional alert rule that can trigger multiple alerts, one per matching series in the query result.
Add one or more [queries]({{< relref "../../../panels/queries.md" >}}) or [expressions]({{< relref "../../../panels/expressions.md" >}}). You can use classic condition expression to create a rule that will trigger a single alert if it's threshold is met, or use reduce and math expressions to create a multi dimensional alert rule that can trigger multiple alerts, one per matching series in the query result.
#### Rule with classic condition
@ -61,7 +61,7 @@ You can use reduce and math expressions to create a rule that will create an ale
2. Add a `reduce` expression for each query to aggregate values in the selected time range into a single value. With some data sources this is not needed for [rules using numeric data]({{< relref "./grafana-managed-numeric-rule.md" >}}).
3. Add a `math` expressions with the condition for the rule. Not needed in case a query or a reduce expression already returns 0 if rule should not be firing, or > 0 if it should be firing. Some examples: `$B > 70` if it should fire in case value of B query/expression is more than 70. `$B < $C * 100` in case it should fire if value of B is less than value of C multiplied by 100. If queries being compared have multiple series in their results, series from different queries are matched if they have the same labels or one is a subset of the other.
See or [expressions documentation]({{< relref "../../panels/expressions.md" >}}) for in depth explanation of `math` and `reduce` expressions.
See or [expressions documentation]({{< relref "../../../panels/expressions.md" >}}) for in depth explanation of `math` and `reduce` expressions.
![Query section multi dimensional](/img/docs/alerting/unified/rule-edit-multi-8-0.png 'Query section multi dimensional screenshot')
@ -105,4 +105,4 @@ Labels are key value pairs that categorize or identify an alert. Labels are use
## Preview alerts
To evaluate the rule and see what alerts it would produce, click **Preview alerts**. It will display a list of alerts with state and value for each one.
To evaluate the rule and see what alerts it would produce, click **Preview alerts**. It will display a list of alerts with state and value for each one.

View File

@ -0,0 +1,27 @@
+++
title = "State and Health of alerting rules"
description = "State and Health of alerting rules"
keywords = ["grafana", "alerting", "guide", "state"]
+++
The concepts of state and health for alerting rules help you understand, at a glance, several key status indicators about your alerts. Alert state, alerting rule state, and alerting rule health are related, but they each convey subtly different information.
## Alerting rule state
Indicates whether any of the timeseries resulting from evaluation of the alerting rule are in an alerting state. Alerting rule state only requires a single alerting instance to be in a pending or firing state for the alerting rule state to not be normal.
- Normal: none of the timeseries returned are in an alerting state.
- Pending: at least one of the timeseries returned are in a pending state.
- Firing: at least one of the timeseries returned are in an alerting state.
## Alert state
Alert state is an indication of the output of the alerting evaluation engine.
- Normal: the condition for the alerting rule has evaluated to **false** for every timeseries returned by the evaluation engine.
- Alerting: the condition for the alerting rule has evaluated to **true** for at least one timeseries returned by the evaluation engine and the duration, if set, **has** been met or exceeded.
- Pending: the condition for the alerting rule has evaluated to **true** for at least one timeseries returned by the evaluation engine and the duration, if set, **has not** been met or exceeded.
- NoData: the alerting rule has not returned a timeseries, all values for the timeseries are null, or all values for the timeseries are zero.
- Error: There was an error encountered when attempting to evaluate the alerting rule.
## Alerting rule health
Indicates the status of alerting rule evaluation.
- Ok: the rule is being evaluated, data is being returned, and no errors have been encountered.
- Error: an error was encountered when evaluating the alerting rule.
- NoData: at least one of the timeseries returned during evaluation is in a NoData state.

View File

@ -1 +0,0 @@
package unified_alerting