- name: slack_client
slack_configs:
- api_url: {{ .GroupLabels.slack_url }}
channel: '{{ .GroupLabels.slack_channel }}'
send_resolved: true
title: "{{ range .Alerts }}{{ .Annotations.summary }}\n{{ end }}"
text: "{{ range .Alerts }}{{ .Annotations.description }}\n{{ end }}"
Have you tried wrapping that in quotes?
Am 08.01.2021 um 23:32 schrieb kiran <kira...@gmail.com>:
--
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 prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/CAOnWYZVWZ7A6B3c6FxFfiqrEAQNoJyWess9ZbG1cYRy9JQgQVA%40mail.gmail.com.
@Stuart Clark
Here is what I tried. I am also attaching the version(with slack variables) which is not working.Any help resolving this is appreciated.
TEST#1 Using {{ .GroupLabels.slack_url }} for api_url without any quotes:
- name: slack_client
slack_configs:
- api_url: {{ .GroupLabels.slack_url }}
channel: '{{ .GroupLabels.slack_channel }}'
send_resolved: true
title: "{{ range .Alerts }}{{ .Annotations.summary }}\n{{ end }}"
text: "{{ range .Alerts }}{{ .Annotations.description }}\n{{ end }}"
Looking at the documentation again
(https://prometheus.io/docs/alerting/latest/configuration/#slack_config)
The api_url is defined as <secret> rather than
<tmpl_secret>, so you can't use templating in that field -
only fixed strings are allowed.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.