There we have it: https://github.com/prometheus/alertmanager/blob/1f3796c5cc58bdcf6fedfb427580c7bfab1f88ba/silence/silence.go#L464 So at least one defined matcher must fail for empty string, which explains failure for alertname=~".*" matcher.
However, it doesn't explain why matchers fail (not on validation stage though) for ".+" or ".+[ae].+" regexp. I found out that Silence's regexp is actually wrapped: https://github.com/prometheus/alertmanager/blob/1f3796c5cc58bdcf6fedfb427580c7bfab1f88ba/pkg/labels/matcher.go#L67 So by setting alertname=~".+", matcher will get "^(?:.+)$" which should work as well. It works more than less, but some alerts are still being sent to receivers, not all but some and sometimes, which doesn't show anything special in debug logs. On Tuesday, May 4, 2021 at 1:52:59 PM UTC+2 Michal Kobus wrote: > I wrote a script to create silence per alertname, this way I could silence > all alerts. It seems there's an issue with regex matcher. > > On Tuesday, May 4, 2021 at 12:20:26 PM UTC+2 Michal Kobus wrote: > >> Experiencing the same problem. Alertmanager official Docker image version >> v0.21.0 >> >> Creating Silence matching all alerts (alertname=~".*"). After silence is >> saved I see all affected alerts below (about 50 matched). Configured dummy >> HTTP-webhook counter and set it as receiver in Alertmanager. I observe >> alerts still being sent to the receiver (both firing and resolved). >> >> On Friday, March 26, 2021 at 2:38:30 PM UTC+1 dc3o wrote: >> >>> What I'm noticing is that only for some alerts and for specific >>> label combinations - it keeps re-sending alerts. >>> >>> On Fri, Mar 26, 2021 at 1:03 PM dc3o <[email protected]> wrote: >>> >>>> I'm setting a silence condition using job =~ ".*" or job=~".+". On >>>> alertmanager I'm seeing equl number of alerts as I do see on alertmanager >>>> silencing tab. Yet for some of the alerts that are appearing as silenced >>>> - >>>> I still do receive slack or pd notifications. I'm expecting these not to >>>> appear at all according to AM dashboard. Any idea? >>>> >>>> -- >>>> 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/77bab951-1de7-46e6-a75c-a57d00eb1163n%40googlegroups.com >>>> >>>> <https://groups.google.com/d/msgid/prometheus-users/77bab951-1de7-46e6-a75c-a57d00eb1163n%40googlegroups.com?utm_medium=email&utm_source=footer> >>>> . >>>> >>> -- 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/61c9dab7-8534-4a32-a47b-b0face4d7652n%40googlegroups.com.

