Aksahy Awate
Aksahy Awate

Reputation: 25

Why Alertmanager failed to send alerts to slack

I have created alerts, that fires and can be seen in Alertmanager. So previously I was able to get notifications to the Slack channel. I don't know what caused the issue, now unable to get notifications. I have gone through this Prometheus alert manager doesnt send alert k8s, but didn't find a way. Any help would be appreciated.

alertmanager.yaml

global:
  slack_api_url: 'https://hooks.slack.com/services/some-dummy'
route:
  group_by: [Alertname]
  # Send all notifications to me.
  receiver: 'slack notifications'
receivers:
  - name: 'slack notifications'
    slack_configs:
      - channel: '#alerts'
        text: "{{ .Annotations.summary }}\n{{ .Annotations.description }}\n{{ end }}"

Prometheus UI enter image description here

Upvotes: 0

Views: 1451

Answers (2)

yan
yan

Reputation: 1541

receivers:
  - name: 'default-receiver'
    slack_configs:
    - channel: 'alerts'
    - title: "{{ range .Alerts }}{{ .Annotations.summary }}\n{{ end }}"
    - text: "{{ range .Alerts }}{{ .Annotations.description }}\n{{ end }}"

Upvotes: 0

Jens Baitinger
Jens Baitinger

Reputation: 527

remove the {{ end }}, there mighte have been a {{ range .Alerts }} in the begining, but withot that, the {{ end }} does not make sense.

Upvotes: 0

Related Questions