Skip to content

Commit

Permalink
Fix fixing-template for matrix-alertmanager-receiver to also consider…
Browse files Browse the repository at this point in the history
… 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.
  • Loading branch information
spantaleev committed Jul 10, 2024
1 parent 33d5b0d commit c044c81
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion roles/custom/matrix-alertmanager-receiver/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit c044c81

Please sign in to comment.