Search code examples
prometheusprometheus-node-exporterprometheus-alertmanager

How to make a query to check memory available in Prometheus


I'm trying to make a query using PromQL to check memory available (RAM).

Is the query below correct to check memory available without cache and buffer? I worte the query regerring to the link

# Node Exporter : Memory used >= 75% (Without Cache, Buffer)
(node_memory_MemTotal_bytes - node_memory_MemFree_bytes)/ node_memory_MemTotal_bytes * 100 <= 25

I used the query below before, but the result didn't look like the answer I was looking for

node_memory_MemAvailable_bytes/ node_memory_MemTotal_bytes * 100 <= 25

Solution

  • The second one is correct. I use this:

    100 - 100 * (node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes) >= 75