diff --git a/pica-metrologie/alertmanager/alertmanager.yml b/pica-metrologie/alertmanager/alertmanager.yml index fd5372c2bde07464659c87f2fbbaea2b84c3d470..7ae4c83b35f0e5bc660173edcd3889fa50b24ed5 100644 --- a/pica-metrologie/alertmanager/alertmanager.yml +++ b/pica-metrologie/alertmanager/alertmanager.yml @@ -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 diff --git a/pica-metrologie/alertmanager/templates.tpl b/pica-metrologie/alertmanager/templates.tpl index 2af54278a20f7e7313044763507647c5d5c2b7ea..38636a9c54af906644d8105131920d5ef2bceac1 100644 --- a/pica-metrologie/alertmanager/templates.tpl +++ b/pica-metrologie/alertmanager/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 }}