I'm trying to create a prometheus rule that will detect when CPU usage is 
above 95%
only on hostnames matching a string (eg: "^as(.*)" which are my application 
servers.

The problem is that my "instance" fields are IP address:port (eg: 
10.123.5.5:9182).

So this query returns the instances and what looks like % cpu utilization:
  ( 100 - (avg by (instance) 
(irate(windows_cpu_time_total{mode="idle"}[5m])) * 100) > 95)

And this query gets me the hostnames I'm looking for:
  windows_cs_hostname{hostname=~".*as.*"}

So how do I combine them so that I get the CPU utilization value for ONLY 
hostnames 
starting with "as" (here again, the instance fields are the same 
ipaddress:port pairs.

Regards,
Alan

-- 
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/d4bee8aa-753c-436d-acdb-e789fb7726b7n%40googlegroups.com.

Reply via email to