All hosts from which I collect node_exporter metrics each have an 
additional node_role metric (added via textfile collector) which identifies 
all the Chef roles a given host has.  As an example, say we have 3 hosts 
with the following textfile collector metrics:

*server1:*
node_role{role="web_server_app1"}

*server2:*
node_role{role="redis_server"}

*server3:*
node_role{role="db_server"}

*server4:*
node_role{role="web_server_app2"}



I'm attempting to write a PromQL query which will return the current disk 
usage % for hosts that do not have a specific role "web_server" assigned to 
them.  I've attempted the following PromQL query although it's invalid as 
we end up with many results on the right hand side, which doesn't match the 
many-to-one nature of the group left:

100 - (

   (node_filesystem_free_bytes{mountpoint=“”/data} * on (hostname) 
group_left(role) node_role{role!~“web_server.*”} )

   /

   (node_filesystem_size_bytes{mountpoint=“”/data} * on (hostname) 
group_left(role) node_role{role!~“web_server”} )

   *

   100

)

How could I modify this query so that it correctly return the disk usage 
percentage of server2 and server3?


I appreciate your help.

-- 
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/457aed58-2670-4d09-bb55-c063626c57a5o%40googlegroups.com.

Reply via email to