#PromQL - use different metrics in same query

1 messages · Page 1 of 1 (latest)

west nymph
#

Hi all, I need some help to create a query regarding snapmirror lag time and the status of the snapmirror. Currently we use the query "snapmirror_lag_time{} / 3600 > 32" to alert if a lag time is higher then 32h and this works fine. But we want to ignore lag times from a snapmirror when the relationsship status is quiesced. I tried the query with the and operator but this does not work right. My assumption is to use something with group_left or group_right

young bone
#

How about something like below?

(snapmirror_lag_time{} / 3600 > 32)
and on(datacenter,cluster,relationship_id) (snapmirror_labels{relationship_status!="quiesced"})
west nymph
#

wow that was fast and also works 🙂 I am correct in the assumption the with and on (datacenter,cluster,relationship_id) we are using unique identifier to relate the metrics?

young bone
#

Yes

west nymph
#

thank you for the information, this will create new possibility's for us 🙂

west nymph
#

Hi @young bone another probably stupid question regarding a prom query. What would be the easiest way for example to extend the result of the query node_failed_power{} with the location of node_labels{} metric?