feat(alertmanager): improve telegram tmpl

This commit is contained in:
nyyu 2022-04-22 21:59:32 +02:00
parent 1ac93ba11b
commit 304547fe2f

View File

@ -4,8 +4,8 @@
<b>Labels:</b>{{ range $key, $value := .Labels }}{{ if ne $key "alertname" }}
- {{ $key }}: {{ $value }}{{ end }}{{ end }}
<b>Annotations:</b>{{ range $key, $value := .Annotations }}
- {{ $key }}: {{ reReplaceAll "(?s)LABELS = (.*)" "" $value }}{{ end }}
<b>Start:</b> {{ .StartsAt }}{{ if eq .Status "resolved"}}
<b>Ended:</b> {{ .EndsAt }}{{ end }}
- {{ $key }}: {{ reReplaceAll "(?s)(\\s+)LABELS = (.*)" "" $value }}{{ end }}
<b>Start:</b> {{ .StartsAt.Local.Format "02/01/2006 15:04:05 MST" }}{{ if eq .Status "resolved"}}
<b>Ended:</b> {{ .EndsAt.Local.Format "02/01/2006 15:04:05 MST" }}{{ end }}
{{ end }}
{{ end }}