0

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

Evaldas Buinauskas
  • 13,739
  • 11
  • 55
  • 107
Aksahy Awate
  • 15
  • 1
  • 5

2 Answers2

0

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

Jens Baitinger
  • 449
  • 2
  • 8
0
receivers:
  - name: 'default-receiver'
    slack_configs:
    - channel: 'alerts'
    - title: "{{ range .Alerts }}{{ .Annotations.summary }}\n{{ end }}"
    - text: "{{ range .Alerts }}{{ .Annotations.description }}\n{{ end }}"
yan
  • 1,382
  • 14
  • 11