Hi,

you can just create a silence in the Alertmanager UI which matches label
alertname and (regexp) value .*.

This can also be done programatically via the HTTP api (or amtool, which
makes use of it).

In fact, this is how we tied our pre-existing maintainance mode logic to
Alertmanager.

Kind regards,
Christian


On 4/15/20 5:33 PM, Sandeep Rao Kokkirala wrote:
> Could please share the code to silence all alerts
> 
> On Wed, Apr 15, 2020, 9:19 PM Jakub Jakubik <[email protected]
> <mailto:[email protected]>> wrote:
> 
>     Why can't you just create a silence on all alerts in alertmanager?
> 
>     This is the very use case to not fire alerts when you know that they
>     should not fire for some reason during a defined time period
> 
>     On Wed, Apr 15, 2020 at 2:55 PM Brian Candler <[email protected]
>     <mailto:[email protected]>> wrote:
> 
>         - source_match:
>             alertname: MaintenanceMode
>           target_match_re:
>             severity: 'warning|critical'
> 
>         In your case, to mute everything you can probably just remove
>         the target_match section entirely, and then I expect it will
>         match all alerts (except for MaintenanceMode, as there's a
>         special case
>         <https://prometheus.io/docs/alerting/configuration/#inhibit_rule> 
> which
>         prevents an alert from inhibiting itself)
> 
>         -- 
>         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]
>         <mailto:[email protected]>.
>         To view this discussion on the web visit
>         
> https://groups.google.com/d/msgid/prometheus-users/11f1622d-2640-4358-8fa6-f3e047c70e11%40googlegroups.com
>         
> <https://groups.google.com/d/msgid/prometheus-users/11f1622d-2640-4358-8fa6-f3e047c70e11%40googlegroups.com?utm_medium=email&utm_source=footer>.
> 
> 
> 
>     -- 
> 
> 
>           Kuba Jakubik
> 
>     SRE Tech Lead
> 
>     Netguru - Building software for world changers
> 
>       [email protected] <mailto:[email protected]>
> 
>       netguru.com <https://netguru.com/>
> 
>       
>     facebook <https://www.facebook.com/netguru>               twitter
>     <https://twitter.com/netguru>             linkedin
>     <https://www.linkedin.com/company/netguru/>       
> 
>     -- 
>     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]
>     <mailto:[email protected]>.
>     To view this discussion on the web visit
>     
> https://groups.google.com/d/msgid/prometheus-users/CAD5xb_GBoJaQMPOUtUyWWHt%3DxWppnQyX5NgXL_pEAb710Gu%3DSw%40mail.gmail.com
>     
> <https://groups.google.com/d/msgid/prometheus-users/CAD5xb_GBoJaQMPOUtUyWWHt%3DxWppnQyX5NgXL_pEAb710Gu%3DSw%40mail.gmail.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]
> <mailto:[email protected]>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/prometheus-users/CAC0-X2GnQ6KVnr3WNrhaJD4RdafcSEk_DX577KAEUcMyxW9Cqw%40mail.gmail.com
> <https://groups.google.com/d/msgid/prometheus-users/CAC0-X2GnQ6KVnr3WNrhaJD4RdafcSEk_DX577KAEUcMyxW9Cqw%40mail.gmail.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/8783f3c9-575c-328f-0f6e-cc3e2e7d7734%40hoffmann-christian.info.

Reply via email to