From 403aa3908ea599d3f608ea4e0ce97a2009dd56fa Mon Sep 17 00:00:00 2001 From: Callum Styan Date: Tue, 20 Apr 2021 16:00:05 -0700 Subject: [PATCH] Use new compaction interval metric in compaction failed alert. Signed-off-by: Callum Styan --- cortex-mixin/alerts/compactor.libsonnet | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cortex-mixin/alerts/compactor.libsonnet b/cortex-mixin/alerts/compactor.libsonnet index 7a858c56..20635208 100644 --- a/cortex-mixin/alerts/compactor.libsonnet +++ b/cortex-mixin/alerts/compactor.libsonnet @@ -65,7 +65,8 @@ // Alert if compactor fails. alert: 'CortexCompactorRunFailed', expr: ||| - increase(cortex_compactor_runs_failed_total[2h]) >= 2 + (time() - cortex_compactor_last_successful_run_timestamp_seconds) > + (cortex_compactor_compaction_interval_seconds * 2) |||, labels: { severity: 'critical',