'How to work with alertmanager alerts one by one

In alertmanager config for slack examples i may typically see something like:

text: >-
     {{ range .Alerts -}}
     {{ .Annotations.text }}
     {{ end }}

but this glues all of notification in a single pule of junk, and not processing them one by one, so each message is a separate slack notification. How can I send as many slack messages, as there are Alerts?

also each message should go to its own channel, defined in alert's annotation, is something like this possible?:

slack_configs:
  - channel: '{{takeMeOneAlert}}{.Annotations.slackChannel}}{{end}}'

range just glues strings from different alerts into 1 big pile of crap, and i want them to be processed separately



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source