I want to calculate the processor usage by all modules in a cluster of quaternets. I found two metrics in prometheus that may be useful:
container_cpu_usage_seconds_total: Cumulative cpu time consumed per cpu in seconds.
process_cpu_seconds_total: Total user and system CPU time spent in seconds.
Cpu Usage of all pods = increment per second of sum(container_cpu_usage_seconds_total{id="/"})/increment per second of sum(process_cpu_seconds_total)
However, I found that every second increment is container_cpu_usage{id="/"}larger than the increment sum(process_cpu_seconds_total). Thus, the use can be more than 1 ...
source
share