Fix fixing-template for matrix-alertmanager-receiver to also consider the alertname annotation

My alerts seem to contain `annotations.alertname` in the payload, so the
default configuration (coming from the matrix-alertmanager-receiver README)
seems to be outdated or something.
This commit is contained in:
Slavi Pantaleev 2024-07-10 06:45:26 +03:00
parent 33d5b0d991
commit c044c815bc

View File

@ -205,7 +205,12 @@ matrix_alertmanager_receiver_config_templating_firing_template: |-
# Controls the `templating.resolved-template` configuration setting.
matrix_alertmanager_receiver_config_templating_resolved_template: |-
{% raw %}
<strong><font color="{{ .ComputedValues.color }}">{{ .Alert.Status | ToUpper }}</font></strong>{{ .Alert.Labels.name }}
<strong><font color="{{ .ComputedValues.color }}">{{ .Alert.Status | ToUpper }}</font></strong>
{{ if .Alert.Labels.name }}
{{ .Alert.Labels.name }}
{{ else if .Alert.Labels.alertname }}
{{ .Alert.Labels.alertname }}
{{ end }}
{% endraw %}
# Default matrix-alertmanager-receiver configuration template which covers the generic use case.