Thank you Brian,

>> It might be possible to frig something in the alert template, e.g. 
leaving the message blank or adding a label depending on the number of 
alerts in the group. 

I've thought about it. Send e-mail for the first three alerts and send 
alert to Zabbix if the 4th alert come

Dne pátek 5. ledna 2024 v 16:37:42 UTC+1 uživatel Brian Candler napsal:

> Alertmanager does do grouping (see group_by:), and if you set group_wait: 
> 3m in the relevant routing rule, it will hold off forwarding an alert  to 
> allow for other alerts in the same group. However, it doesn't have a 
> threshold (e.g. deliver the alert group only if 3 or more alerts are 
> active).
>
> It might be possible to frig something in the alert template, e.g. leaving 
> the message blank or adding a label depending on the number of alerts in 
> the group.
>
> Otherwise you'd have to filter at the receiver side, or write your own 
> webhook which filters and forwards the alert.  As far as I can see, 
> Alertmanager doesn't have Zabbix integration, so you presumably are already 
> using some sort of third-party webhook: that would be an appropriate place 
> to do the filtering.
>
> See:
>
> https://prometheus.io/docs/alerting/latest/alertmanager/#grouping
>
> https://prometheus.io/docs/alerting/latest/configuration/#route-related-settings
> https://prometheus.io/docs/alerting/latest/notifications/
> https://prometheus.io/docs/alerting/latest/notification_examples/
>
> On Friday 5 January 2024 at 14:32:41 UTC Dmitriy Doroshenko wrote:
>
>> Hi,
>>
>> I have a script which send the following alerts to Alertmanager
>> [{"labels":{"alertname":"MyAlert","correlation_id":"abc"}}]
>>
>> Is it possible to configure Alertmanager to send notification to Zabbix 
>> after receiving 3 alerts grouped by correlation_id within 3 minutes?
>>
>

-- 
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/51e71fa1-25b2-4978-b71f-6231ed989654n%40googlegroups.com.

Reply via email to