promql 新手,我正在尝试绘制一段时间内的 cpu 使用情况图,我发现以下示例获得了静态使用百分比,但我如何将其转换为 grafana 的速率?
100 * (1 - sum(collectd_cpu_total{type="idle"}) by (exported_instance) / sum(collectd_cpu_total) by (exported_instance))
最佳答案
既然你已经在使用Prometheus,为什么不使用Prometheus的node_exporter呢? https://www.robustperception.io/understanding-machine-cpu-usage
100 - (avg by (instance) (irate(node_cpu_seconds_total{job="node",mode="idle"}[5m])) * 100)
关于grafana - 如何使用 Prometheus 和collectd 导出器绘制grafana 中的CPU 使用情况图?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51623034/