Use the webhook functionality: write your own webhook receiver which 
performs whatever logic you like and then sends an email.

Personally though, I wouldn't do this.  I would create separate receivers 
in alertmanager for each email address, and then use alert routing rules 
(which can be controlled by labels) to select the correct receiver.  If the 
list of receivers is long or frequently changing, then I'd automate the 
generation of the alertmanager config from some external source-of-truth 
database.

On Thursday, 18 August 2022 at 12:07:55 UTC+1 [email protected] wrote:

> Hi,
>
> we are monitoring a bunch of hosts with Prometheus, forwarding the alerts 
> to the alertmanager and from there to one Email receiver.
>
> We are currently evaluating the possibility to forward the Emails, 
> generated by the AlertManager, to different Email addresses, depending on 
> the host impacted by the alert. We don't want however to keep the mapping 
> "host <-> Email address" hardcoded in the alertmanager config. This 
> information can be retrieved via a REST call.
>
> I am wondering if there is a possibility for the alertmanager to make 
> external http calls,  before triggering an alert, and use the returned 
> information (Email address) as a destination of the Emails. Another option 
> would be to include the information retrieved in the message sent to a 
> webhook receiver.
>
> Does someone know if such a use case can be implemented using 
> Prometheus/Alertmanager? Any ideas are welcome.
>
> Regards
> Farouk
>

-- 
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/b19ab958-d5f0-41cb-b91c-30b093fc8bcdn%40googlegroups.com.

Reply via email to