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 <wbollock@linode.com>
This commit is contained in:
Will Bollock 2024-01-31 09:02:49 -05:00
parent 34875ae8c7
commit 839b9e5b53
No known key found for this signature in database

View file

@ -122,7 +122,7 @@
alert: 'PrometheusNotIngestingSamples', alert: 'PrometheusNotIngestingSamples',
expr: ||| 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 and
( (
sum without(scrape_job) (prometheus_target_metadata_cache_entries{%(prometheusSelector)s}) > 0 sum without(scrape_job) (prometheus_target_metadata_cache_entries{%(prometheusSelector)s}) > 0