Get max memory used in last 24 hours in Prometheus

7/25/2017

I am using kubernetes and prometheus. I am using node js server. I want to get max memory used in last 24 hours.

-- Darshil
kubernetes
monitoring
node.js
prometheus

1 Answer

8/14/2017

I have used these queries for getting memory used:

Stored custom rule for summing the memory used by cluster:

cluster:memory_used:bytes = sum by (cluster) ( node_memory_MemTotal ) - sum by (cluster) ( node_memory_MemFree ) - sum by (cluster) ( node_memory_Buffers ) - sum by (cluster) ( node_memory_Cached )

Then, I have queried the prometheus HTTP API: /api/v1/query?query=cluster:max_memory_used:bytes

I can get timestamp of the `max_memory_used. So, for that particular data point, I can also get other metrics.

-- Darshil
Source: StackOverflow