Hi Team,
I am new to Prometheus
I have written PromQL to calculate cpu and memory usage when it is more than 80%
CPU Usage Expression
sum(rate(container_cpu_usage_seconds_total{container~=“”}[5m])) by (pod) / sum(kube_pod_container_resource_limits{resource=“cpu”}) by (pod) * 100 > 80
Output am getting for few pods as follow
pod1 0.0775
pod2 0.599
But when i check from pod bash terminal using top command i see 6.2%~8.2%us
Memory Usage Expression
sum(container_memory_working_set_bytes{container!=“”}) by (pod)/sum(container_spec_memory_limit_bytes{container!=“”}) by (pod) * 100 > 80
In grafana i see output 23.4
but in pod bash terminal when i calculate % of memory usage using top command it is more than 50%.
Please help me here how can i get all the pod name which is consuming more than 80% of memory and more than 80% of CPU
Regards,
Akash