Prometheus query for Windows top 10 CPU process

  • What Grafana version and what operating system are you using? Linux os , version is 8.1.8

  • What are you trying to achieve?
    I would like build prometheus query for top 10 cpu process . I have host with multi core ( some of them have 8, 4, 23 etc) . I would like build prometheus query for top 10 cpu process . I have host with multi core ( some of them have 8, 4, 23 etc) . but somehow for host who’s having 8 or 23 core, grafana dashboard for percent goes to more than 100 %

  • How are you trying to achieve it?
    Above is way I’m using to achieve

  • What happened?
    Grafana dashboard for percentage goes beyond 100% .

  • What did you expect to happen?

I would like dashboard should not go above 100% irrespective of core.

  • Can you copy/paste the configuration(s) that you are having problems with?

. I’m using below query
" topk (10, (avg (irate(namedprocess_namegroup_cpu_seconds_total{instance=”<>"}[1m]) ) by (groupname) * 100) " It giving partially correct output but as mentioned above for multicore Y axis goes more than 100 %.

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.

No

  • Did you follow any online instructions? If so, what is the URL?
    Prometheus documentation.

Hey jitu8888, have you solved this? I’m facing the same problem (Grafana dashboards goes beyound 100%). Thank you!

Hi All - I needs to use same command in the windows metrics to get Top 10 Process details.

By any chance above issue resolved? Thanks for your quick response

Hi @sravanesr,

So this post is approx 8 months old, therefore not sure if the above users are still active to reply back.

I found this link which seems really a very detailed guide as how to monitor processes via Prometheus and Visualize them in Grafana.

Also on the official Prometheus page, there is an example at the bottom as how to get 3 top processes per user which you may use as a reference. But I think the 1st link is way more better :smiley:

Hi @usmanahmad/All - Thanks for the details,

Whatever links you had provided is for Linux servers,but i am looking for windows server.

Can you please provide me Query details on the Top 10 Processers of windows.

I am using 14451 Grafana template for windows and got following dashboard on Total Processes but i needs top 10 in below dashboards.

Following windows query i used

windows_os_processes{job=~“$job”,instance=~“$instance”}

Well just found out that there is a Dashboard available to get the top windows process

Try it out as it should give you what you looking for!!

Its giving generic details but not much useful:-(

Well I do not have expertise on Promethus queries for the moment. I hope that some other community member might know and try to help you.

I am surprised to found many Dashboard on Dashboards | Grafana Labs for Windows so I am sure this is doable.

Finally got output for the windows by changing query:-)

topk(10,irate(windows_process_cpu_time_total{instance=~“$instance”}[3m]))

1 Like