summaryrefslogtreecommitdiffstats
path: root/krebs/2configs/shack/prometheus/templates/shack.tmpl
blob: 9295f019fad100840963adfe53f96b1512fcae9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{{ define "telegram.default" }}
{{range .Alerts -}}
{{ $severity := index .Labels "severity" }}
{{ $desc := "No Description" }}
{{ if eq .Status "firing" }}
  {{ $desc = index .Annotations "description" }}
  {{- if eq $severity "critical" -}}
    <i><u><b>[CRITICAL]</b></u></i>
  {{- else if eq $severity "warning" -}}
    <u><b>[WARNING]</b></u>
  {{- else -}}
    <b>[{{ $severity }}]</b>
  {{- end -}}
{{ else -}}
  {{ $desc = "The issue has been resolved" }}
  <del>[RESOLVED]</del>
{{- end }} {{ index .Labels "alertname"}}: {{ index .Annotations "summary"}}

{{ $desc }}

Alert Links:
* <a href="{{ index .Annotations "url"}}">Grafana</a>
* <a href="{{ .GeneratorURL }}">Source</a>
{{end -}}
{{end}}