feat(grafana): added alerts configuration provisioning
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
apiVersion: 1
|
||||
|
||||
templates:
|
||||
- orgId: 1
|
||||
name: Telegram
|
||||
template: |
|
||||
{{ define "telegram.default.message" }} {{ if gt (len .Alerts.Firing) 0 }}
|
||||
π₯π¨ *FIRE IN THE HOLE!* π¨π₯
|
||||
We've got *{{ len .Alerts.Firing }} firing alert(s)* that need your immediate attention!
|
||||
{{ range .Alerts.Firing }}
|
||||
---
|
||||
*Alert:* `{{ .Labels.alertname }}`
|
||||
{{ if .Labels.instance }}*Instance:* `{{ .Labels.instance }}`{{ end }}
|
||||
*Status:* π΄ *FIRING* since {{ .StartsAt.Format "2006-01-02 15:04:05 MST" }}
|
||||
|
||||
{{ if .Annotations.summary }}*Summary:* {{ .Annotations.summary }}{{ end }}
|
||||
{{ if .Annotations.description }}*Description:* {{ .Annotations.description }}{{ end }}
|
||||
*Labels:*
|
||||
{{ range .Labels.SortedPairs }} β’ `{{ .Name }}` = `{{ .Value }}`
|
||||
{{ end }}
|
||||
{{ if gt (len .Annotations) 0 }}*Annotations:*
|
||||
{{ range .Annotations.SortedPairs }} β’ `{{ .Name }}` = `{{ .Value }}`
|
||||
{{ end }}{{ end }}
|
||||
|
||||
{{ if .DashboardURL }}π [View Dashboard]({{ .DashboardURL }})
|
||||
{{ end }}{{ if .PanelURL }}π [View Panel]({{ .PanelURL }})
|
||||
{{ end }}{{ if .GeneratorURL }}π [Alert Source]({{ .GeneratorURL }})
|
||||
{{ end }}{{ if .SilenceURL }}π€« [Silence Alert]({{ .SilenceURL }})
|
||||
{{ end }}--- {{ end }} {{ end }}
|
||||
{{ if gt (len .Alerts.Resolved) 0 }}
|
||||
β
π’ *ALL CLEAR!* π’β
|
||||
Great news! *{{ len .Alerts.Resolved }} alert(s)* have been resolved.
|
||||
{{ range .Alerts.Resolved }}
|
||||
---
|
||||
*Alert:* `{{ .Labels.alertname }}`
|
||||
{{ if .Labels.instance }}*Instance:* `{{ .Labels.instance }}`{{ end }}
|
||||
*Status:* β
*RESOLVED* at {{ .EndsAt.Format "2006-01-02 15:04:05 MST" }} (was active since {{ .StartsAt.Format "2006-01-02 15:04:05 MST" }})
|
||||
|
||||
{{ if .Annotations.summary }}*Summary:* {{ .Annotations.summary }}{{ end }}
|
||||
{{ if .Annotations.description }}*Description:* {{ .Annotations.description }}{{ end }}
|
||||
*Labels:*
|
||||
{{ range .Labels.SortedPairs }} β’ `{{ .Name }}` = `{{ .Value }}`
|
||||
{{ end }}
|
||||
{{ if gt (len .Annotations) 0 }}*Annotations:*
|
||||
{{ range .Annotations.SortedPairs }} β’ `{{ .Name }}` = `{{ .Value }}`
|
||||
{{ end }}{{ end }}
|
||||
|
||||
{{ if .DashboardURL }}π [View Dashboard]({{ .DashboardURL }})
|
||||
{{ end }}{{ if .PanelURL }}π [View Panel]({{ .PanelURL }})
|
||||
{{ end }}{{ if .GeneratorURL }}π [Alert Source]({{ .GeneratorURL }}) {{ end }} {{ end }} {{ end }}
|
||||
{{ if or (gt (len .Alerts.Firing) 0) (gt (len .Alerts.Resolved) 0) }}
|
||||
π *Grafana Alertmanager:* [View All Alerts]({{ template "__alertmanagerURL" . }}) π
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
Reference in New Issue
Block a user