On 08/01/2021 22:32, kiran wrote:
@Stuart Clark <mailto:stuart.cl...@jahingo.com>

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.


--
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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/7038b076-a71a-1f84-21d3-9917c1c78f00%40Jahingo.com.

Reply via email to