That's a wonderful find,  but still it is very much difficult to do a 
proper routing when you need to put f.x. watch schedule  for 3 people to 
alert manager. Slightly more complex if not a binary choice...  

On Wednesday, June 30, 2021 at 4:02:21 AM UTC+2 [email protected] wrote:

> Glad you managed to resolve your issue xkilian! 
>
> Just for some context, the mute_time_intervals mechanism is entirely 
> separate to routes and route matching. All it does is 'silence' the route 
> from sending out alerts in the specified periods.
>
> The pattern you've discovered of using multiple receivers with the 
> continue option is, I believe, the simplest way to achieve what you wanted. 
>
> Cheers,
> Ben
>
> On Wednesday, June 30, 2021 at 5:42:01 AM UTC+10 xkilian wrote:
>
>> Ok, I will answer myself.
>>
>> The way to do this is with continue, continue will permit firing to more 
>> than one receiver. I had mistakenly thought that continue would simply 
>> continue without firing at first match. Alertmanager is deceptively 
>> powerful. The only missing piece is a piece of UI to manage the list of 
>> pager numbers for on-call rotation that can now be defined in the 
>> alertmanager (offhoursgroup).
>>
>> # Select receiver based on time of day
>>     - match:
>>           severity: 5
>>       receiver: daygroup
>>       mute_time_interval: offhours 
>>       continue
>>     - match:
>>           severity: 5
>>       receiver: offhoursgroup    
>>       mute_time_interval: workhours 
>>
>> Then I just need to manage/automate who is in the offhoursgroup based on 
>> the rotation schedule. 
>>
>> This would work for my purposes.
>> Le mardi 29 juin 2021 à 14:14:42 UTC-4, xkilian a écrit :
>>
>>>
>>> Can a route use a mute_time_interval as a route matcher criteria?
>>>
>>>   routes:
>>>
>>>   # Select receiver based on time of day
>>>     - match:
>>>           severity: 5
>>>       receiver: daygroup 
>>>       routes:
>>>           - match:
>>>               mute_time_interval: offhours 
>>>               receiver: offhoursgroup
>>>
>>>
>>> (Not sure the indentation is perfect)
>>>
>>> Thank you,
>>>
>>> xkilian
>>>
>>

-- 
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/8309b41e-401e-4fb0-bd8b-a9bd096c254an%40googlegroups.com.

Reply via email to