I am running postgres, postgres-exporter, prometheus, grafana and cadvisor all as docker containers. I need to find the percentage of memory used by postgres. My requirement is to send an alert when when postgres used more than 85% of memory.
I used below query, but I am not sure this gives exact memory usage.
sum(process_resident_memory_bytes) / sum(machine_memory_bytes) \* 100
Can someone please help me on this? Thanks in advance.