From 839b9e5b5300f2a44c50714ede9b1423e875d6bb Mon Sep 17 00:00:00 2001 From: Will Bollock Date: Wed, 31 Jan 2024 09:02:49 -0500 Subject: [PATCH] fix: PrometheusNotIngestingSamples label matching This alert will never return anything as the left side of the query has the labels `[component, environment, instance, job, type]` while the right side has `[component, environment, instance, job]`. The `type` label was added to `prometheus_tsdb_head_samples_appended_total` in this PR but the mixin wasn't updated for the new label: https://github.com/prometheus/prometheus/pull/11395 This was found with [pint](https://github.com/cloudflare/pint) PromQL linting Signed-off-by: Will Bollock --- documentation/prometheus-mixin/alerts.libsonnet | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/prometheus-mixin/alerts.libsonnet b/documentation/prometheus-mixin/alerts.libsonnet index 3efb0f27d1..508d89c244 100644 --- a/documentation/prometheus-mixin/alerts.libsonnet +++ b/documentation/prometheus-mixin/alerts.libsonnet @@ -122,7 +122,7 @@ alert: 'PrometheusNotIngestingSamples', expr: ||| ( - rate(prometheus_tsdb_head_samples_appended_total{%(prometheusSelector)s}[5m]) <= 0 + sum without(type) (rate(prometheus_tsdb_head_samples_appended_total{%(prometheusSelector)s}[5m])) <= 0 and ( sum without(scrape_job) (prometheus_target_metadata_cache_entries{%(prometheusSelector)s}) > 0