Hi,
On 10/26/20 5:09 PM,
barnyb...@gmail.com wrote:
> I apologize for providing incomplete information. If the license expires
> for one instance, then its name is sent to the slack, if there are 2 or
> more of them, then it is sent without instance hostnames, but as in the
> screenshot above, just the number of instances.
[...]
It looks like you are mostly using the default slack config. I don't use
Slack myself, but according to the docs [1], the template
slack.default.title [2] kicks in, which will use a generic __subject
template [3]. That template uses CommonLabels, which may explain the
difference in behavior you are seeing regarding one/multiple alerts.
Long story short, I think you should configure a custom title template
for slack if you want to modify the existing message. Another option
would be to keep the existing title and add the details to the "text"
field, which may be more appropriate.
You can either work through the docs yourself (the notification template
syntax will help [4], along with the examples [5]) or try to find some
blog posts such as [6] where people document how they tuned their Slack
alerts for their needs.
Kind regards,
Christian
[1]
https://prometheus.io/docs/alerting/latest/configuration/#slack_config
[2]
https://github.com/prometheus/alertmanager/blob/master/template/default.tmpl#L15
[3]
https://github.com/prometheus/alertmanager/blob/master/template/default.tmpl#L4
[4]
https://prometheus.io/docs/alerting/latest/notifications/
[5]
https://prometheus.io/docs/alerting/latest/notification_examples/
[6]
https://harthoover.com/pretty-alertmanager-alerts-in-slack/