Hello,

I'm having some trouble writing a query for an alerting rule that we only 
want to run at certain times of the day. This is what I original had, which 
works, but not in the way we now need:

> count(up{job="calculator"} == 0) and count(hour(vector(time())) >= 1 and 
hour(vector(time())) < 13)

Now our problem is that we need the instance label from the up metric to 
persist to the alert so we can include it in the pager duty incident, 
otherwise our engineers don't know what instance is down without checking 
prometheus first. This is where I'm having problems, using count strips all 
those labels and just basically gives a true or false of if the alert is 
firing.

Any suggestions?

-- 
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 prometheus-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/ea198656-1b5d-4eac-b8b1-c6e962b91fa4n%40googlegroups.com.

Reply via email to