Hi!

Trying to wrap my brain around the group_left / group_right in PromQL.

I have the following metrics (removed some labels)

potato{short_hostname="qasite1-compute001",site="qasite1",hardware="hardwaretype1"}
1
potato{short_hostname="qasite1-compute001",site="qasite1",hardware="hardwaretype2"}
1
carrot{short_hostname="qasite1-compute001",site="qasite1",
type="running_carrots"} 0
carrot{short_hostname="qasite1-compute001",site="qasite1",
type="running_carrots"} 5

The goal is to "merge" these two metrics to allow some cross queries where

   - our common label is short_hostname
   - for all short_hostname values, I want to check the value of the
   "hardware" label and get the value of the "carrot" metric only if the label
   "hardware" in "potato" is equal to "hardwaretype1"
   - Furthermore, I want to also validate that the resulting metric value
   of "carrot" is equal to 0 (not a label in this case)

It seems that there is no easy to merge the two queries and create a single
result that could be further sorted in Grafana/other stuff?

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/CAOAKi8xg9uM%2BeR_LpTWjEJ3wK%3Dh6JtpRzJjb%2BqhJ7LU426eM0w%40mail.gmail.com.

Reply via email to