Prometheus queries to get CPU and Memory usage in kubernetes pods
问题 I need to get CPU and Memory usage in kubernetes pods with prometheus queries. Can someone plz help? 回答1: Do you use prometheus-operator to collect data from kubernetes? If yes, you can use something like this: sum(container_memory_usage_bytes) sum(container_cpu_usage_seconds_total) Just for example. 回答2: For CPU percentage avg((sum (rate (container_cpu_usage_seconds_total {container_name!="" ,pod="<Pod name>" } [5m])) by (namespace , pod, container ) / on (container , pod , namespace) ((kube