LuMa
LuMa

Reputation: 1763

Prometheus query returns invalid value

I'm looking into Prometheus and wrote a query to get the per core performance of the CPU on a Windows machine in percent using the metrics provided by the wmi_exporter. But the graph has some negative values in it and I wonder why. Can someone take a look at the following query and tell me what I did wrong:

100 - (avg by (core) (irate(wmi_cpu_time_total{job="myjob", instance="myinstance", mode="idle"}[5m])) * 100)

Interestingly, the query does only produce these negative values on one of the two instances. Below is an image showing the issue:

enter image description here

Upvotes: 2

Views: 962

Answers (1)

brian-brazil
brian-brazil

Reputation: 34112

It's probably due to a race condition, you can see similar-ish things on Linux sometimes too. If the time spent in a mode is incremented and seen in the wrong second, this is what happens.

Upvotes: 4

Related Questions