-
Notifications
You must be signed in to change notification settings - Fork 710
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Query CPU usage per process in percent #494
Comments
Hey @scorpiock, |
Hello @carlpett I looked into CPU utilization on server and found number doesn't match at all. It is way below low. When I was comparing, one of the processes was taking around 15% of the CPU but the above sum query was showing around 1%. Is there any query you advise to test? |
The query looks correct, so that should be fine. Are you comparing with Task Manager, or some other tool? |
I compared with task manager and process explorer, both. |
This has been updated to use the
|
Thank you so much for your help. It works like charm. |
@carlpett Could anybody please edit the titel of this issue? Surly other people could google for this task. I will make a PR to add the query above to the process collector docs, since it looks like a success 😃 |
@Mario-Hofstaetter Nice detective work! I'm a bit surprised that the query needed to be that complicated, but your reasoning makes sense. |
Sorry to necro a closed question like this, but how do you do that query now that (I'm also a beginner at both Prometheus and Grafana currently, so i'm sorry if this is a stupid question) |
@zlepper You can simply replace |
And it goes indeed, i was an idiot, and had forgotten to enable to process collector. Thank you very much! :D |
Sorry to necro this question again. and sorry to tag you @Mario-Hofstaetter just wondering is something wrong with my metrics The CPU usage reached 22% but when I see the CPU load per process and sum up the percentage, it doesn't even reach the 22% I'm using the exact query as above |
@zakiharis Can you share your PromQL Queries (whats the query for the left hand side chart) Edit: Also can you copy & paste the Commandline Params of |
@Mario-Hofstaetter left side:
right side:
and below is the params:
|
Is I will check with one of my systems, but later in the evening (TZ GMT+1) |
Removing the Thank you again for checking |
just want to check around, are you manage to try on your system? |
@Mario-Hofstaetter @carlpett @zlepper
Even with [5m] duration I can get some sudden value higher than 1500%. Except these sudden values, the other values look good to me. |
@kyleli666
|
@Mario-Hofstaetter, Thanks a lot! After digging into the data source, I sometimes found the windows_process_cpu_time_total metric gets 0 or near 0, so when it's suddenly back, its rate is dramatically big. I'm trying to filter these 0 but seems not easy 🤦. Sometimes, this time counter just get smaller but not 0. |
Hello,
I am configuring Grafana to get CPU utilization by a process with
wmi_process_cpu_time_total
but it doesn't give the accurate utilization percentage.I tried many combinations with no luck. Wondering if anyone has a working query or some known issues?
Tried the following:
sum by (process) (rate(wmi_process_cpu_time_total{instance=~"$server.*", process !~"Idle"}[5m]))
avg by (process_id) (rate(wmi_process_cpu_time_total{instance=~"$server",process=!~"Idle"}[5m])) * 100
Servers are having multi-core CPUs. Am I doing anything wrong?
The text was updated successfully, but these errors were encountered: