Fix recording rule for missing mount
caused "vector contains metrics with
the same labelset after applying rule labels"
on Prometheus upgrade
Change-Id: I68dcd59792e9b07ee45255162b9d2a962edbf5b9
Related-PROD: PROD-37070
diff --git a/glusterfs/meta/prometheus.yml b/glusterfs/meta/prometheus.yml
index bfee436..82e425e 100644
--- a/glusterfs/meta/prometheus.yml
+++ b/glusterfs/meta/prometheus.yml
@@ -78,7 +78,7 @@
{%- raw %}
GlusterfsMountMissing:
if: >-
- delta(glusterfs_mount_scrapes:rate5m{fstype=~"(fuse.)?glusterfs"}[5m]) < 0 or glusterfs_mount_scrapes:rate5m{fstype=~"(fuse.)?glusterfs"} == 0
+ delta(glusterfs_mount_scrapes:rate5m[5m]) < 0 or glusterfs_mount_scrapes:rate5m == 0
labels:
severity: major
service: glusterfs
@@ -88,7 +88,7 @@
recording:
glusterfs_mount_scrapes:rate5m:
query: >-
- count_over_time(disk_total{fstype=~"(fuse.)?glusterfs"}[5m]) or 0*(glusterfs_mount_scrapes:rate5m offset 1m)
+ min by(host, path, device)(count_over_time(disk_total{fstype=~"(fuse.)?glusterfs"}[5m])) or 0*min by(host, path, device)(glusterfs_mount_scrapes:rate5m offset 1m)
{%- endraw %}
{%- endif %}
{%- endif %}