openpodcast / roadmap

πŸ—ΊπŸŽ™ Project Roadmap and Milestones for Open Podcast
0 stars 0 forks source link

slack notification of grafana alterts not working #104

Closed woolfg closed 1 year ago

woolfg commented 1 year ago

do we need a notification rule besides this "default slack notification"?

mre commented 1 year ago

No, it should work without a special notification rule. Does the test alert still work?

woolfg commented 1 year ago

working now, used the template:

{{ define "openpodcast.default.link" }}{{ .CommonLabels.instance }}{{ end }}

{{ define "alerts.message" -}}
{{ if .Alerts.Firing -}}
{{ len .Alerts.Firing }} firing alert(s)
{{ template "alerts.summarize_with_links" .Alerts.Firing }}
{{- end }}
{{- if .Alerts.Resolved -}}
{{ len .Alerts.Resolved }} resolved alert(s)
{{ template "alerts.summarize_with_links" .Alerts.Resolved }}
{{- end }}
{{- end }}

{{ define "alerts.summarize_with_links" -}}
{{ range . -}}
{{ range $k, $v := .Labels }}{{ $k }}={{ $v }} {{ end }}
{{ index .Annotations "summary" }}
{{ end }}
{{ end }}