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

Fix CortexCompactorHasNotSuccessfullyRunCompaction to avoid false positives #294

Merged
merged 1 commit into from
Apr 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* [FEATURE] Added "Cortex / Rollout progress" dashboard. #289 #290
* [ENHANCEMENT] Added `newCompactorStatefulSet()` function to create a custom statefulset for the compactor. #287
* [ENHANCEMENT] Added option to configure compactor job name used in dashboards and alerts. #287
* [ENHANCEMENT] Added `CortexCompactorHasNotSuccessfullyRunCompaction` alert. #292 #294
* [BUGFIX] Fixed `CortexCompactorRunFailed` false positives. #288

## 1.8.0 / 2021-03-25
Expand Down
22 changes: 19 additions & 3 deletions cortex-mixin/alerts/compactor.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,33 @@
},
},
{
// Alert if the compactor has not successfully run compaction in the last 6h.
// Alert if the compactor has not successfully run compaction in the last 24h.
alert: 'CortexCompactorHasNotSuccessfullyRunCompaction',
'for': '1h',
expr: |||
time() - cortex_compactor_last_successful_run_timestamp_seconds > 60 * 60 * 6
(time() - cortex_compactor_last_successful_run_timestamp_seconds > 60 * 60 * 24)
and
(cortex_compactor_last_successful_run_timestamp_seconds > 0)
|||,
labels: {
severity: 'critical',
},
annotations: {
message: 'Cortex Compactor {{ $labels.namespace }}/{{ $labels.instance }} has not run compaction in the last 24 hours.',
},
},
{
// Alert if the compactor has not successfully run compaction in the last 24h since startup.
alert: 'CortexCompactorHasNotSuccessfullyRunCompaction',
'for': '24h',
expr: |||
cortex_compactor_last_successful_run_timestamp_seconds == 0
|||,
labels: {
severity: 'critical',
},
annotations: {
message: 'Cortex Compactor {{ $labels.namespace }}/{{ $labels.instance }} has not run compaction in the last 6 hours.',
message: 'Cortex Compactor {{ $labels.namespace }}/{{ $labels.instance }} has not run compaction in the last 24 hours.',
},
},
{
Expand Down