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.
On Sunday, 17 July 2022 at 05:24:04 UTC+1 [email protected] wrote:
> 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
>
--
You received this message because you are subscribed to the Google Groups
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/prometheus-users/fda543e8-0a90-40f1-bdd3-e30a61489a15n%40googlegroups.com.