Hi guys, Currently I am using the following template to show only datasource errors from my grafana instance.
{{ range .Alerts.Firing }}
{{ if gt (len .Annotations) 0 }}
{{ .Annotations.Error }}
{{ end }}
{{ end }}
which gives the alerts as the following output
[plugin.downstreamError] failed to query data: Post "https://grafanaurl:3000/api/v1/query_range": dial tcp ip:3000: connect: connection refused
[plugin.downstreamError] failed to query data: Post "https://grafanaurl:3000/api/v1/query_range": dial tcp ip:3000: connect: connection refused
[plugin.downstreamError] failed to query data: Post "https://grafanaurl:3000/api/v1/query_range": dial tcp ip:3000: connect: connection refused
It’s basically showing error for each alert rule as I have currently three alert rules. Now I want to show only unique value of .Annotations.Error . that means from three alert rules if the errors are the same then only one error will be printed. So the above message will only be sent once. How can I achieve that guys? Thanks.