Using the wmi_exporter or the scollector_exporter with Prometheus I am finding it difficult to get accurate CPU usage. Here is the metrics I am using and the query I am using for scollector:
os_cpu with returns: 1.54432653e+07
I do a query with rate:
rate(os_cpu{exported_instance="myHost"}[30s])
Here is the graph I have come up with from this query in Grafana
os_cpu returns a overall CPU usage i.e. all cores, and comparing this with Taskmanager in Windows it does not add up as that shows 100% max. It cannot be possible to get 300% CPU usage.
What can I do with my query to get a more accurate measurement?
For now you might have found the answer, but anyway... This seems to be useful:
100 - (avg by (instance) (irate(windows_cpu_time_total{mode="idle", instance=~"$server"}[1m])) * 100)
from grafana dashboards library: https://grafana.com/grafana/dashboards/12566

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With