相关疑难解决方法(0)

如何用普罗米修斯计算kubernetes中容器的cpu使用情况作为监控?

我想计算kubernetes集群中所有pod的cpu使用情况.我在prometheus中发现了两个指标可能很有用:

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)
Run Code Online (Sandbox Code Playgroud)

但是,我发现每秒的增量都container_cpu_usage{id="/"}大于增量sum(process_cpu_seconds_total).因此使用量可能大于1 ...

kubernetes prometheus

19
推荐指数
4
解决办法
3万
查看次数

标签 统计

kubernetes ×1

prometheus ×1