Since the labels are the same, this is straightforward:

expr: ipmi_temperature_celsius and (ipmi_temperature_state == 2)

The $value of the alert is now ipmi_temperature_celsius - but the value 
will only be passed through if there is a matching RHS timeseries (with any 
value, but in this case it's filtered so that the RHS timeseries is 
filtered out unless the value is 2).  

PromQL expressions with comparison operators are like filters.  For example:

expr: ipmi_temperature_celsius > 40

is not a true/false, but rather it passes through timeseries where the 
value is > 40, and excludes timeseries where the value is <= 40.

See:
https://prometheus.io/docs/prometheus/latest/querying/operators/#comparison-binary-operators
https://prometheus.io/docs/prometheus/latest/querying/operators/#logical-set-binary-operators


-- 
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/9989aa8d-ab59-461d-a6fb-2bfe23d6b876o%40googlegroups.com.

Reply via email to