Ideally I have to find out the CPU usage of pods on each node in percentage. But I have tried to find out the CPU usage of each node. I have written the query but it gives me more than 100 % (it can be 150% - 200%) even though the case with multiple cpus is included (I took avg). Could you please help me to understand what is wrong in the query below.
(1 - avg(irate(node_cpu_seconds_total{mode="idle"}[1m])) by (instance)) * 100 / scalar(sum(machine_cpu_cores))
By reading multiple books and solutions I have found also the query that works only with several nodes (container_spec_cpu_quota isn't available for certain instances on AWS ECS)
avg(rate(container_cpu_usage_seconds_total{name!~".*prometheus.*", image!="", instance=""}[1m])) by (pod) / scalar(sum(container_spec_cpu_quota{name!~".*prometheus.*", image!="", instance=""} / container_spec_cpu_period{name!~".*prometheus.*", image!="", instance=""}))