mixin: Fix cpu usage graph

Signed-off-by: Johannes Ziemke <github@5pi.de>
This commit is contained in:
Johannes Ziemke 2024-09-03 10:31:54 +02:00
parent b9d0932179
commit ebfbe0f56e

View file

@ -66,17 +66,12 @@ local table = grafana70.panel.table;
datasource='$datasource',
span=6,
format='percentunit',
max=1,
min=0,
stack=true,
)
.addTarget(prometheus.target(
|||
(
(1 - sum without (mode) (rate(node_cpu_seconds_total{%(nodeExporterSelector)s, mode=~"idle|iowait|steal", instance="$instance", %(clusterLabel)s="$cluster"}[$__rate_interval])))
/ ignoring(cpu) group_left
count without (cpu, mode) (node_cpu_seconds_total{%(nodeExporterSelector)s, mode="idle", instance="$instance", %(clusterLabel)s="$cluster"})
)
(1 - sum without (mode) (rate(node_cpu_seconds_total{%(nodeExporterSelector)s, mode=~"idle|iowait|steal", instance="$instance", %(clusterLabel)s="$cluster"}[$__rate_interval])))
||| % config,
legendFormat='{{cpu}}',
intervalFactor=5,