mixin: Add fallback for MemAvailable (#2130)

Add a fallback to Buffers+Cached+MemFree+Slab for older Linux kernels
where the MemAvailable metric is not available for memory utilization.

Signed-off-by: Ben Kochie <superq@gmail.com>
This commit is contained in:
Ben Kochie 2021-09-28 10:22:06 +02:00 committed by GitHub
parent 0aec407666
commit aeef1edd62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -42,6 +42,16 @@
expr: |||
1 - (
node_memory_MemAvailable_bytes{%(nodeExporterSelector)s}
or
(
node_memory_Buffers_bytes{%(nodeExporterSelector)s}
+
node_memory_Cached_bytes{%(nodeExporterSelector)s}
+
node_memory_MemFree_bytes{%(nodeExporterSelector)s}
+
node_memory_Slab_bytes{%(nodeExporterSelector)s}
)
/
node_memory_MemTotal_bytes{%(nodeExporterSelector)s}
)