0

为什么我使用 node_exporter 来获取 cpu 利用率是负数?我的查询信息是“round((1 - avg(irate(node_cpu_seconds_total{mode="idle"}[5m])))*100,0.01)”

4

1 回答 1

0

我在执行你的表达时没有得到负数。

但我想如果你想要系统的CPU 使用率,那么我会使用这个查询。我是 PromQL 的初学者,我相信有一种更有效的方法,但这对我有用:

(1-rate(node_cpu_seconds_total{job="node_exporter",mode="idle"}[1m]))*100

表示(两个 CPU 均为 1%):

{cpu="0",instance="localhost:9100",job="node_exporter",mode="idle"} 1.056344430236733 {cpu="1",instance="localhost:9100",job="node_exporter",mode ="空闲"} 1.6381520334300625

于 2020-01-24T08:09:49.090 回答