Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Commit eab1177

Browse files
committed
Replace ruler alerts, and add playbooks.
1 parent 3528572 commit eab1177

File tree

2 files changed

+44
-7
lines changed

2 files changed

+44
-7
lines changed

cortex-mixin/alerts/alerts.libsonnet

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -527,20 +527,40 @@
527527
name: 'ruler_alerts',
528528
rules: [
529529
{
530-
alert: 'CortexRulerFailedEvaluations',
530+
alert: 'CortexRulerTooManyFailedPushes',
531531
expr: |||
532-
sum by (%s, instance, rule_group) (rate(cortex_prometheus_rule_evaluation_failures_total[1m]))
532+
100 * (
533+
sum by (%s, instance) (rate(cortex_ruler_write_requests_failed_total[1m]))
533534
/
534-
sum by (%s, instance, rule_group) (rate(cortex_prometheus_rule_evaluations_total[1m]))
535-
> 0.01
535+
sum by (%s, instance) (rate(cortex_ruler_write_requests_total[1m]))
536+
) > 1
537+
||| % [$._config.alert_aggregation_labels, $._config.alert_aggregation_labels],
538+
'for': '5m',
539+
labels: {
540+
severity: 'critical',
541+
},
542+
annotations: {
543+
message: |||
544+
Cortex Ruler {{ $labels.instance }} is experiencing {{ printf "%.2f" $value }}% write errors.
545+
|||,
546+
},
547+
},
548+
{
549+
alert: 'CortexRulerTooManyFailedQueries',
550+
expr: |||
551+
100 * (
552+
sum by (%s, instance) (rate(cortex_ruler_queries_failed_total[1m]))
553+
/
554+
sum by (%s, instance) (rate(cortex_ruler_queries_total[1m]))
555+
) > 1
536556
||| % [$._config.alert_aggregation_labels, $._config.alert_aggregation_labels],
537557
'for': '5m',
538558
labels: {
539559
severity: 'warning',
540560
},
541561
annotations: {
542562
message: |||
543-
Cortex Ruler {{ $labels.instance }} is experiencing {{ printf "%.2f" $value }}% errors for the rule group {{ $labels.rule_group }}.
563+
Cortex Ruler {{ $labels.instance }} is experiencing {{ printf "%.2f" $value }}% write errors.
544564
|||,
545565
},
546566
},

cortex-mixin/docs/playbooks.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,26 @@ More information:
144144

145145
This alert occurs when a ruler is unable to validate whether or not it should claim ownership over the evaluation of a rule group. The most likely cause is that one of the rule ring entries is unhealthy. If this is the case proceed to the ring admin http page and forget the unhealth ruler. The other possible cause would be an error returned the ring client. If this is the case look into debugging the ring based on the in-use backend implementation.
146146

147-
### CortexRulerFailedEvaluations
147+
### CortexRulerTooManyFailedPushes
148148

149-
_TODO: this playbook has not been written yet._
149+
This alert fires when rulers cannot push new samples (result of rule evaluation) to ingesters.
150+
151+
In general, pushing samples can fail due to problems with Cortex operations (eg. too many ingesters have crashed, and ruler cannot write samples to them), or due to problems with resulting data (eg. user hitting limit for number of series, out of order samples, etc.).
152+
This alert fires only for first kind of problems, and not for problems caused by limits or invalid rules.
153+
154+
How to **fix**:
155+
- Investigate the ruler logs to find out the reason why ruler cannot write samples.
156+
157+
### CortexRulerTooManyFailedQueries
158+
159+
This alert fires when rulers fail to evaluate rule queries.
160+
161+
Each rule evaluation may fail due to many reasons, eg. due to invalid PromQL expression, or query hits limits on number of chunks. These are "user errors", and this alert ignores them.
162+
163+
There is a category of errors that is more important: errors due to failure to read data from store-gateways or ingesters. These errors would result in 500 when run from querier. This alert fires if there is too many of such failures.
164+
165+
How to **fix**:
166+
- Investigate the ruler logs to find out the reason why ruler cannot evaluate queries. Note that rule logs rule evaluation errors even for "user errors", but those are not causing the alert to fire. Focus on problems with ingesters or store-gateways.
150167

151168
### CortexRulerMissedEvaluations
152169

0 commit comments

Comments
 (0)