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
62353b44
Verified
Commit
62353b44
authored
Aug 29, 2021
by
Quentin Duchemin
Browse files
Further improve Mattermost alert appearance
parent
dbe4e755
Changes
4
Hide whitespace changes
Inline
Side-by-side
pica-metrologie/alertmanager/Dockerfile
View file @
62353b44
...
...
@@ -3,6 +3,8 @@ ARG VERSION=v0.22.2
FROM
prom/alertmanager:${VERSION}
COPY
./entrypoint.sh /entrypoint.sh
COPY
./templates.tpl /config/templates.tpl
# Initial image uses user nobody which cannot chmod nor sed
USER
root
RUN
chmod
+x /entrypoint.sh
...
...
pica-metrologie/alertmanager/alertmanager.yml
View file @
62353b44
...
...
@@ -33,9 +33,9 @@ route:
# already critical.
inhibit_rules
:
-
source_matchers
:
-
severity="critical"
-
severity="critical"
target_matchers
:
-
severity="warning"
-
severity="warning"
# Apply inhibition if the alertname is the same.
# CAUTION:
# If all label names listed in `equal` are missing
...
...
@@ -46,4 +46,29 @@ inhibit_rules:
receivers
:
-
name
:
'
mattermost'
slack_configs
:
-
channel
:
'
$MATTERMOST_CHANNEL'
-
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"
templates
:
-
templates.tpl
pica-metrologie/alertmanager/templates.tpl
0 → 100644
View file @
62353b44
{
{
define
"__alert_silence_link"
-
}
}
{{ .ExternalURL }}/#/silences/new?filter=%7B
{{- range .CommonLabels.SortedPairs -}}
{{- if ne .Name "alertname" -}}
{{- .Name }}%3D"{{- .Value -}}"%2C%20
{{- end -}}
{{- end -}}
alertname%3D"{{ .CommonLabels.alertname }}"%7D
{{- end }}
pica-metrologie/vmalert-rules.yml
View file @
62353b44
...
...
@@ -220,7 +220,8 @@ groups:
labels
:
severity
:
critical
annotations
:
summary
:
"
{{
$labels.instance
}}
is
down"
summary
:
"
Service
down"
description
:
"
{{
$labels.instance
}}
is
down
for
more
than
2
minutes"
-
alert
:
PostfixRejection
# As a test, alert when there is any rejection. If too much alert we will raise the threshold
expr
:
rate(postfix_smtpd_messages_rejected_total[5m]) >
0
...
...
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