grafana-dashboards icon indicating copy to clipboard operation
grafana-dashboards copied to clipboard

CPU metric computation

Open cwseys opened this issue 3 years ago • 2 comments

Hi, Thanks for all your hard work! It's nice not to have to create all those panels from scratch! I have a question about the CPU usage PromQL. I've noticed that on multi-cpu systems the CPU panels if the Y-axis is set to autoscale the CPU usage sums to N*100 where N is the number of CPUs. Depending on a axis scaling to make the graph come out to 100% caused me to question the whole formula, so I hunted around the web and found this blog post: https://movio.co/blog/prometheus-lighting-the-way/ with a different formula that comes out to 100(%) even when autoscaled. So for example for 'user' time, instead of: sum by (instance)(irate(node_cpu_seconds_total{mode="user",instance="$node",job="$job"}[5m])) * 100 this: avg(irate(node_cpu_seconds_total{mode='user',instance="$node",job="$job"}[5m])) * 100

Thanks again! C.

cwseys avatar Apr 23 '21 17:04 cwseys

Having made these changes in the dashboard the figures make much more sense, thanks for the tip.

deathchurch avatar Jul 16 '21 07:07 deathchurch

The graph has been updated a lot since this issue was open. Does still suffer the same problem?

Please, could you provide some detailed examples?.

Thanks,

rfmoz avatar Sep 01 '23 09:09 rfmoz