Hello everyone, i ran into a problem after upgrading graphana from 8.3 to 11.2, namely the legacy alerting opt-out problem. Currently, I am trying to write a notification template that will return the format of old messages in Telegram and I have the following problem:
when sending screenshots of the dashboard, they are sent in separate messages, previously they were sent in one message. Maybe you need to fix some config, or fix my template?
Perhaps someone already has a ready-made notification template as in the old version - I will be grateful for your help
{{ define "custom.message" }}
{{ if gt (len .Alerts.Firing) 0 }}
**Firing**
{{ range .Alerts.Firing }}
[Alerting] {{ .Labels.alertname }}
{{ if .GeneratorURL }}URL: {{ .GeneratorURL }}{{ end }}
{{ if .Annotations.message }}Message: {{ .Annotations.message }}{{ end }}
{{ $hasMetrics := false }}{{ range $key, $value := .Labels }}{{ if and (ne $key "alertname") (ne $key "instance") (ne $key "grafana_folder") }}{{ $hasMetrics = true }}{{ end }}{{ end }}
{{ if $hasMetrics }}Metrics: {{ range $key, $value := .Labels }}{{ if and (ne $key "alertname") (ne $key "instance") (ne $key "grafana_folder") }}{{$key}}: {{$value}};{{ end }}{{ end }}{{ end }}
{{ if .Annotations.screenshot_url }}
![Screenshot]({{ .Annotations.screenshot_url }}) {{/* Додаємо скріншот, якщо є */}}
{{ end }}
{{ end }}
{{ end }}
{{ if gt (len .Alerts.Resolved) 0 }}
**Resolved**
{{ range .Alerts.Resolved }}
[OK] {{ .Labels.alertname }}
{{ if .GeneratorURL }}URL: {{ .GeneratorURL }}{{ end }}
{{ if .Annotations.message }}Message: {{ .Annotations.message }}{{ end }}
{{ $hasMetrics := false }}{{ range $key, $value := .Labels }}{{ if and (ne $key "alertname") (ne $key "instance") (ne $key "grafana_folder") }}{{ $hasMetrics = true }}{{ end }}{{ end }}
{{ if $hasMetrics }}Metrics: {{ range $key, $value := .Labels }}{{ if and (ne $key "alertname") (ne $key "instance") (ne $key "grafana_folder") }}{{$key}}: {{$value}};{{ end }}{{ end }}{{ end }}
{{ if .Annotations.screenshot_url }}
![Screenshot]({{ .Annotations.screenshot_url }})
{{ end }}
{{ end }}
{{ end }}
{{ end }}