How to Monitor Kubernetes Pod Memory Usage With Grafana

Just like CPU usage, memory usage is one of the key metrics equally referred to by Dev teams to monitor and optimize the application. 

The following query can be used to get the pod memory usage on the namespace you select.

sum(container_memory_working_set_bytes{container!="", namespace=~"^$namespace$"}) by (pod)

  • container_memory_working_set_bytes → gives the actual memory being used (excluding cache that can be reclaimed)
  • container!="" → filters out empty or system containers
  • namespace=~"^$namespace$" → allows you to dynamically select a namespace in Grafana
  • sum(...) by (pod) → groups memory usage by pod so you can easily see which pods are consuming the most memory






  • #grafana #prometheus

    0 Comments