mirror of
https://github.com/outbackdingo/Biohazard.git
synced 2026-03-21 22:39:53 +00:00
feat(alertmanager): Discord notification template
This commit is contained in:
@@ -41,24 +41,18 @@ receivers:
|
||||
webhook_url_file: "/secrets/discord"
|
||||
# yoinked below from onedr0p, blame him if something doesn't work
|
||||
title: >-
|
||||
{{ .CommonLabels.alertname }}
|
||||
[{{ .Status | toUpper }}{{ if eq .Status "firing" }}:{{ .Alerts.Firing | len }}{{ end }}]
|
||||
{{ .CommonLabels.alertname }} {{- if ne .CommonLabels.severity "" }}({{ .CommonLabels.severity}}){{- end }} ({{ .GroupLabels.cluster }})
|
||||
message: |-
|
||||
{{- $root := . }}
|
||||
{{- $rm := stringSlice "instance" "kubernetes_node" "endpoint" "prometheus" "service" "cluster" "container" "job" }}
|
||||
{{- $rm := stringSlice "instance" "kubernetes_node" "endpoint" "prometheus" "service" "cluster" "container" "job" "severity" }}
|
||||
{{- $common := ( ( .CommonLabels.Remove $root.GroupLabels.Names ).Remove $rm ) }}
|
||||
{{- if gt (len .GroupLabels.SortedPairs) 0 }}
|
||||
## Group Labels
|
||||
{{- range .GroupLabels.SortedPairs }}
|
||||
> {{ .Name }}: `{{ .Value }}`
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if gt (len $common.SortedPairs) 0 }}
|
||||
## Common Labels
|
||||
{{- end }}
|
||||
> Namespace: `{{ .CommonLabels.namespace.Value }}`
|
||||
{{- range $common.SortedPairs }}
|
||||
> {{ .Name }}: `{{ .Value }}`
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
## Alerts
|
||||
{{- range .Alerts }}
|
||||
{{- if ne .Annotations.description "" }}
|
||||
|
||||
Reference in New Issue
Block a user