I was looking for a way to escalate the alert after it was firing for a 
period of time.  Looks like defining the alert twice with different for and 
label will do the trick.
Thanks for you assistance Julius.  

On Friday, January 22, 2021 at 1:16:17 PM UTC-5 [email protected] wrote:

> If your goal is to send an alert notification only after it has been 
> firing for some time, the usual way of doing that in Prometheus would be to 
> use the "for" duration field in the alerting rule to define how long the 
> alert has to be active before it transitions from "pending" into "firing" 
> state (at which point it gets sent to AM and routed there).
>
> If you do want to route it before that duration already, but to a 
> different subtree / notifier in your AM routes, you could define the 
> alerting rule twice in Prometheus with differentiating labels and different 
> "for" durations.
>
> On Thu, Jan 21, 2021 at 5:58 PM steve waldron <[email protected]> wrote:
>
>> Is it possible to add a label with a dynamic value? for example - the 
>> amount of time an alert has been firing?  if so, any examples of PROMQL 
>> queries to accomplish this?
>>
>> I'm trying to determine if routes can be created using a label defined by 
>> length of time an alert has been firing.
>>
>> Thanks ,
>> Steve 
>>
>> -- 
>> 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/7678533f-7140-4bf6-8fa7-37081ab37ae4n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/prometheus-users/7678533f-7140-4bf6-8fa7-37081ab37ae4n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>
>
> -- 
> Julius Volz
> PromLabs - promlabs.com
>

-- 
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/408df294-21c2-4fff-b9e3-3281312fe100n%40googlegroups.com.

Reply via email to