Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Picasoft
Technique
Dockerfiles
Commits
c61b41c3
Verified
Commit
c61b41c3
authored
Aug 29, 2021
by
Quentin Duchemin
Browse files
Slack buttons are not compatible anymore with Mattermost, use fields
parent
f64d3e57
Changes
2
Hide whitespace changes
Inline
Side-by-side
pica-metrologie/alertmanager/alertmanager.yml
View file @
c61b41c3
...
...
@@ -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
-
t
ype
:
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
-
t
itle
:
'
:fire:
See
all
alerts'
value
:
"
[AlertManager
WebUI](https://alertmanager.picasoft.net)"
short
:
true
templates
:
-
templates.tpl
-
/config/
templates.tpl
pica-metrologie/alertmanager/templates.tpl
View file @
c61b41c3
...
...
@@ -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 }}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment