Verified Commit c61b41c3 authored by Quentin Duchemin's avatar Quentin Duchemin
Browse files

Slack buttons are not compatible anymore with Mattermost, use fields

parent f64d3e57
......@@ -46,29 +46,29 @@ inhibit_rules:
receivers:
- name: 'mattermost'
slack_configs:
- channel: '$MATTERMOST_CHANNEL'
icon_emoji: ":thaenkin:"
username: "AlertManager"
color: '{{ if eq .CommonLabels.severity "warning" -}}warning{{- else if eq .CommonLabels.severity "critical" -}}danger{{- end -}}'
title: "### {{ .CommonLabels.alertname }}"
text: "Summary : {{ .CommonAnnotations.summary }}"
fields:
- title: "Description"
value: "{{ .CommonAnnotations.description }}"
- title: "Criticity"
value: "{{ .CommonLabels.severity }}"
actions:
- type: button
text: ':chart_with_upwards_trend: See dashboard'
url: '{{ (index .Alerts 0).Annotations.dashboard }}'
style: primary
- type: button
text: ':no_bell: Silence'
url: '{{ template "__alert_silence_link" . }}'
style: danger
- type: button
text: ':grey_question: Documentation'
url: "https://wiki.picasoft.net/doku.php?id=technique:adminsys:monitoring:metrologie:stack-picasoft"
- channel: '$MATTERMOST_CHANNEL'
icon_emoji: ":thaenkin:"
username: "AlertManager"
color: '{{ if eq .CommonLabels.severity "warning" -}}warning{{- else if eq .CommonLabels.severity "critical" -}}danger{{- end -}}'
title: "{{ .CommonLabels.alertname }}"
text: "**{{ .CommonLabels.severity }}** : {{ .CommonAnnotations.summary }}"
fields:
- title: "Description"
value: "{{ .CommonAnnotations.description }}"
# Would be better with buttons but Slack new buttons are not
# yet compatible with Mattermost interactive messages model
- title: ":chart_with_upwards_trend: See the data"
value: "[Open Grafana]({{ (index .Alerts 0).Annotations.dashboard }})"
short: true
- title: ':no_bell: Silence'
value: '[Silence the alert]({{ template "__alert_silence_link" . }})'
short: true
- title: ':question: Documentation'
value: "[Show documentation](https://wiki.picasoft.net/doku.php?id=technique:adminsys:monitoring:metrologie:stack-picasoft)"
short: true
- title: ':fire: See all alerts'
value: "[AlertManager WebUI](https://alertmanager.picasoft.net)"
short: true
templates:
- templates.tpl
- /config/templates.tpl
......@@ -2,8 +2,8 @@
{{ .ExternalURL }}/#/silences/new?filter=%7B
{{- range .CommonLabels.SortedPairs -}}
{{- if ne .Name "alertname" -}}
{{- .Name }}%3D"{{- .Value -}}"%2C%20
{{- .Name }}%3D'{{- .Value -}}'%2C%20
{{- end -}}
{{- end -}}
alertname%3D"{{ .CommonLabels.alertname }}"%7D
alertname%3D'{{ .CommonLabels.alertname }}'%7D
{{- end }}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment