I'm quite new to Prometheus, so this is possibly a silly question - but here goes.
When I request node_memory_Active_bytes and node_memory_MemTotal_bytes I get:
node_memory_Active_bytes{instance="10.1.4.9:9100",job="node-exporter"} 3257815040
(..and..)
node_memory_MemTotal_bytes{instance="10.1.4.9:9100",job="node-exporter"} 16509550592
However, on the box, if I run free -b, I get the following:
$ free -b
total used free shared buff/cache available
Mem: 16509550592 2264915968 6787731456 59121664 7456903168 14140530688
Swap: 0 0 0
I'm struggling to maps prometheus's view of memory with the actual machine's view. I'm sure I must be doing something wrong, but I have no idea what. The total's match, but the free
Equivalent queries for free -b command:
node_memory_MemTotal_bytesnode_memory_MemTotal_bytes - node_memory_MemFree_bytes - node_memory_Buffers_bytes - node_memory_Cached_bytes - node_memory_SReclaimable_bytesnode_memory_Shmem_bytesnode_memory_MemFree_bytesnode_memory_Buffers_bytes + node_memory_Cached_bytes + node_memory_SReclaimable_bytesnode_memory_MemAvailable_bytesI think you're confusing "active" memory with "used" memory, aren't you? They're different things.
See more info about this here.
To get "used" memory with Prometheus Node Exporter calculate:
node_memory_MemTotal_bytes - node_memory_MemAvailable_bytes
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With