Can't send Alertmanager alerts on Mattermost with button in it

78 Views Asked by At

Problem

I'm trying to send an alerts from Alertmanager to Mattermost with button in the message but it didn't work. I'm using the

Context

I'm deploying Alertmanager with the kube-prometheus-stack HELM chart on Kubernetes.

values.yaml:

## Configuration for alertmanager
## ref: https://prometheus.io/docs/alerting/alertmanager/
##
alertmanager:
  ## Alertmanager configuration directives
  ## ref: https://prometheus.io/docs/alerting/configuration/#configuration-file
  ##      https://prometheus.io/webtools/alerting/routing-tree-editor/
  ##
  config:
    route:
      receiver: "<RECEIVER_NAME>"
      routes:
      - receiver: "<RECEIVER_NAME>"
        match:
          severity = "critical"
    receivers:
      - name: "<RECEIVER_NAME>"
        slack_configs:
            # Whether to notify about resolved alerts.
          - send_resolved: true
            icon_url: https://avatars3.githubusercontent.com/u/3380462
            color: '{{ template "slack.color" . }}'
            title: '{{ template "slack.title" . }}'
            text: '{{ template "slack.text" . }}'
            #  Didn't work at the moment
            actions:
              - type: button
                text: 'Query :mag:'
                url: '{{ (index .Alerts 0).GeneratorURL }}'
              - type: button
                text: 'Dashboard :chart_with_upwards_trend:'
                url: '{{ (index .Alerts 0).Annotations.dashboard_url }}'
              - type: button
                text: 'Silence :no_bell:'
                url: '{{ template "__alert_silence_link" . }}'
            # The Slack webhook URL. Either api_url or api_url_file should be set.
            # Defaults to global settings if none are set here.
            api_url: <MATTERMOST_WEBHOOK_URL>
            # The HTTP client's configuration.
            http_config:
              proxy_url: '<HTTP_PROXY>'

I'm using a HTTP_PROXY to be able to join Mattermost.

Version

  • Kubernetes: 1.28
  • Kube-prometheus-stack: 55.11.0 (HELM chart)
  • Mattermost: 9.1.1

Behaviour

Notification are sended to Mattermost without the button notification.

What I tried ?

I tried to had a name field on each button but it doesn't work

Tell me if you need more information.

0

There are 0 best solutions below