Get cpu/memory usage by service/process on Windows Instance

17 views
Skip to first unread message

I Wayan Adi Saputra

unread,
Jul 17, 2022, 12:24:04 AM7/17/22
to Prometheus Users
Please guide me, how to get usage data of services/process group by services/process from windows instance, I"m on the latest windows_exporter, been trying with windows_process_cpu_time_total, but the result is not showing.

this is the code:
100 * sum by(instance, process, process_id) (rate(windows_process_cpu_time_total{instance="192.168.0.219:9182", process!="Idle"}[5m]))
 / on(instance) group_left sum by(instance) (rate(windows_cpu_time_total{instance="192.168.0.219:9182"}[5m]))

Please help.

Thanks

Brian Candler

unread,
Jul 17, 2022, 12:47:41 AM7/17/22
to Prometheus Users
Your overall expression will be empty if either:
- the numerator or denominator returns zero results
- the numerator and denominator don't have matching instance labels

Hence I suggest you start by breaking that expression into two parts and testing them separately in the promQL browser, that is:


sum by(instance, process, process_id) (rate(windows_process_cpu_time_total{instance="192.168.0.219:9182", process!="Idle"}[5m]))

sum by(instance) (rate(windows_cpu_time_total{instance="192.168.0.219:9182"}[5m]))

Then if you find one which returns no results, then break it down into smaller parts.  If I just look at the two metrics

windows_process_cpu_time_total
windows_cpu_time_total

on my system I find that the metric "windows_process_cpu_time_total" does not exist at all.
Reply all
Reply to author
Forward
0 new messages