Hi,

On 2/25/20 10:42 AM, Karthike Ezhilarasan wrote:
> I've recently configured prometheus and alertmanager with a slack
> webhook, everything works fine but the notifications I get in slack uses
> the same text for firing and resolved making it look a bit odd.
> 
>     [FIRING:1] warning@my_server high_storage_load
>     warning@my_server: Host storage usage is 81%.
> 
>  
> 
>     [RESOLVED] high_storage_load@my_server
>     Resolved@my_server: Host storage usage is 81%.
> 
> 
> I would like to know if there is a simple way to use 2 different text
> fields one for firing messages and one for resolved messages.

Yes, you can use Alertmanager's notification templating feature to
format such messages differently, e.g. based on the Status field (firing
vs. resolved). You can add/change the static text or you could even
reference a different alert-specific annotation.

I suggest starting based on the built-in defaults:

https://prometheus.io/docs/alerting/configuration/#slack_config
https://github.com/prometheus/alertmanager/blob/master/template/default.tmpl
https://prometheus.io/docs/alerting/notification_examples/
https://prometheus.io/docs/alerting/notifications/

Kind regards,
Christian

-- 
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/b5951e14-334c-504e-8a8d-f2945bf0a6cf%40hoffmann-christian.info.

Reply via email to