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

Commit 410f9fe

Browse files
authored
Merge pull request #294 from grafana/fix-compactor-alert
Fix CortexCompactorHasNotSuccessfullyRunCompaction to avoid false positives
2 parents 1fb3caa + 90f451e commit 410f9fe

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* [FEATURE] Added "Cortex / Rollout progress" dashboard. #289 #290
66
* [ENHANCEMENT] Added `newCompactorStatefulSet()` function to create a custom statefulset for the compactor. #287
77
* [ENHANCEMENT] Added option to configure compactor job name used in dashboards and alerts. #287
8+
* [ENHANCEMENT] Added `CortexCompactorHasNotSuccessfullyRunCompaction` alert. #292 #294
89
* [BUGFIX] Fixed `CortexCompactorRunFailed` false positives. #288
910

1011
## 1.8.0 / 2021-03-25

cortex-mixin/alerts/compactor.libsonnet

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,33 @@
1818
},
1919
},
2020
{
21-
// Alert if the compactor has not successfully run compaction in the last 6h.
21+
// Alert if the compactor has not successfully run compaction in the last 24h.
2222
alert: 'CortexCompactorHasNotSuccessfullyRunCompaction',
2323
'for': '1h',
2424
expr: |||
25-
time() - cortex_compactor_last_successful_run_timestamp_seconds > 60 * 60 * 6
25+
(time() - cortex_compactor_last_successful_run_timestamp_seconds > 60 * 60 * 24)
26+
and
27+
(cortex_compactor_last_successful_run_timestamp_seconds > 0)
28+
|||,
29+
labels: {
30+
severity: 'critical',
31+
},
32+
annotations: {
33+
message: 'Cortex Compactor {{ $labels.namespace }}/{{ $labels.instance }} has not run compaction in the last 24 hours.',
34+
},
35+
},
36+
{
37+
// Alert if the compactor has not successfully run compaction in the last 24h since startup.
38+
alert: 'CortexCompactorHasNotSuccessfullyRunCompaction',
39+
'for': '24h',
40+
expr: |||
41+
cortex_compactor_last_successful_run_timestamp_seconds == 0
2642
|||,
2743
labels: {
2844
severity: 'critical',
2945
},
3046
annotations: {
31-
message: 'Cortex Compactor {{ $labels.namespace }}/{{ $labels.instance }} has not run compaction in the last 6 hours.',
47+
message: 'Cortex Compactor {{ $labels.namespace }}/{{ $labels.instance }} has not run compaction in the last 24 hours.',
3248
},
3349
},
3450
{

0 commit comments

Comments
 (0)