mirror of
https://github.com/spantaleev/matrix-docker-ansible-deploy.git
synced 2025-10-16 09:19:43 +02:00
Upgrade matrix-alertmanager-receiver (2025.9.10 -> 2025.9.17) and switch from computed-values
to in-template logic
Ref: - https://github.com/metio/matrix-alertmanager-receiver/releases/tag/2025.9.17 - https://github.com/metio/matrix-alertmanager-receiver/pull/94
This commit is contained in:
@@ -11,7 +11,7 @@
|
|||||||
matrix_alertmanager_receiver_enabled: true
|
matrix_alertmanager_receiver_enabled: true
|
||||||
|
|
||||||
# renovate: datasource=docker depName=docker.io/metio/matrix-alertmanager-receiver
|
# renovate: datasource=docker depName=docker.io/metio/matrix-alertmanager-receiver
|
||||||
matrix_alertmanager_receiver_version: 2025.9.10
|
matrix_alertmanager_receiver_version: 2025.9.17
|
||||||
|
|
||||||
matrix_alertmanager_receiver_scheme: https
|
matrix_alertmanager_receiver_scheme: https
|
||||||
|
|
||||||
@@ -159,30 +159,20 @@ matrix_alertmanager_receiver_config_templating_external_url_mapping: {}
|
|||||||
# "http://prometheus:8081": https://another.prometheus.example.com
|
# "http://prometheus:8081": https://another.prometheus.example.com
|
||||||
matrix_alertmanager_receiver_config_templating_generator_url_mapping: {}
|
matrix_alertmanager_receiver_config_templating_generator_url_mapping: {}
|
||||||
|
|
||||||
# Controls the `templating.computed-values` configuration setting.
|
|
||||||
matrix_alertmanager_receiver_config_templating_computed_values: "{{ matrix_alertmanager_receiver_config_templating_computed_values_default + matrix_alertmanager_receiver_config_templating_computed_values_auto + matrix_alertmanager_receiver_config_templating_computed_values_custom }}"
|
|
||||||
matrix_alertmanager_receiver_config_templating_computed_values_default:
|
|
||||||
- values: # always set 'color' to 'yellow'
|
|
||||||
color: yellow
|
|
||||||
- values: # set 'color' to 'orange' when alert label 'severity' is 'warning'
|
|
||||||
color: orange
|
|
||||||
when-matching-labels:
|
|
||||||
severity: warning
|
|
||||||
- values: # set 'color' to 'red' when alert label 'severity' is 'critical'
|
|
||||||
color: red
|
|
||||||
when-matching-labels:
|
|
||||||
severity: critical
|
|
||||||
- values: # set 'color' to 'green' when alert status is 'resolved'
|
|
||||||
color: green
|
|
||||||
when-matching-status: resolved
|
|
||||||
matrix_alertmanager_receiver_config_templating_computed_values_auto: []
|
|
||||||
matrix_alertmanager_receiver_config_templating_computed_values_custom: []
|
|
||||||
|
|
||||||
# Controls the `templating.firing-template` configuration setting.
|
# Controls the `templating.firing-template` configuration setting.
|
||||||
matrix_alertmanager_receiver_config_templating_firing_template: |-
|
matrix_alertmanager_receiver_config_templating_firing_template: |-
|
||||||
{% raw %}
|
{% raw %}
|
||||||
|
{{ $color := "yellow" }}
|
||||||
|
{{ if eq .Alert.Labels.severity "warning" }}
|
||||||
|
{{ $color = "orange" }}
|
||||||
|
{{ else if eq .Alert.Labels.severity "critical" }}
|
||||||
|
{{ $color = "red" }}
|
||||||
|
{{ end }}
|
||||||
|
{{ if eq .Alert.status "resolved" }}
|
||||||
|
{{ $color = "green" }}
|
||||||
|
{{ end }}
|
||||||
<p>
|
<p>
|
||||||
<strong><font color="{{ .ComputedValues.color }}">{{ .Alert.Status | ToUpper }}</font></strong>
|
<strong><font color="{{ $color }}">{{ .Alert.Status | ToUpper }}</font></strong>
|
||||||
{{ if .Alert.Labels.name }}
|
{{ if .Alert.Labels.name }}
|
||||||
{{ .Alert.Labels.name }}
|
{{ .Alert.Labels.name }}
|
||||||
{{ else if .Alert.Labels.alertname }}
|
{{ else if .Alert.Labels.alertname }}
|
||||||
@@ -211,7 +201,7 @@ matrix_alertmanager_receiver_config_templating_firing_template: |-
|
|||||||
# Controls the `templating.resolved-template` configuration setting.
|
# Controls the `templating.resolved-template` configuration setting.
|
||||||
matrix_alertmanager_receiver_config_templating_resolved_template: |-
|
matrix_alertmanager_receiver_config_templating_resolved_template: |-
|
||||||
{% raw %}
|
{% raw %}
|
||||||
<strong><font color="{{ .ComputedValues.color }}">{{ .Alert.Status | ToUpper }}</font></strong>
|
<strong><font color="green">{{ .Alert.Status | ToUpper }}</font></strong>
|
||||||
{{ if .Alert.Labels.name }}
|
{{ if .Alert.Labels.name }}
|
||||||
{{ .Alert.Labels.name }}
|
{{ .Alert.Labels.name }}
|
||||||
{{ else if .Alert.Labels.alertname }}
|
{{ else if .Alert.Labels.alertname }}
|
||||||
|
@@ -24,3 +24,6 @@
|
|||||||
when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0"
|
when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0"
|
||||||
with_items:
|
with_items:
|
||||||
- {'old': 'matrix_alertmanager_receiver_container_image_name_prefix', 'new': 'matrix_alertmanager_receiver_container_image_registry_prefix'}
|
- {'old': 'matrix_alertmanager_receiver_container_image_name_prefix', 'new': 'matrix_alertmanager_receiver_container_image_registry_prefix'}
|
||||||
|
- {'old': 'matrix_alertmanager_receiver_config_templating_computed_values', 'new': '<superseded by logic in the firing or resolved template; see https://github.com/metio/matrix-alertmanager-receiver/pull/94'}
|
||||||
|
- {'old': 'matrix_alertmanager_receiver_config_templating_computed_values_auto', 'new': '<superseded by logic in the firing or resolved template; see https://github.com/metio/matrix-alertmanager-receiver/pull/94'}
|
||||||
|
- {'old': 'matrix_alertmanager_receiver_config_templating_computed_values_custom', 'new': '<superseded by logic in the firing or resolved template; see https://github.com/metio/matrix-alertmanager-receiver/pull/94'}
|
||||||
|
@@ -26,10 +26,6 @@ templating:
|
|||||||
# value is the mapped value which will be available as '.GeneratorURL' in templates
|
# value is the mapped value which will be available as '.GeneratorURL' in templates
|
||||||
generator-url-mapping: {{ matrix_alertmanager_receiver_config_templating_generator_url_mapping | to_json }}
|
generator-url-mapping: {{ matrix_alertmanager_receiver_config_templating_generator_url_mapping | to_json }}
|
||||||
|
|
||||||
# computation of arbitrary values based on matching alert annotations, labels, or status
|
|
||||||
# values will be evaluated top to bottom, last entry wins
|
|
||||||
computed-values: {{ matrix_alertmanager_receiver_config_templating_computed_values | to_json }}
|
|
||||||
|
|
||||||
# template for alerts in status 'firing'
|
# template for alerts in status 'firing'
|
||||||
firing-template: {{ matrix_alertmanager_receiver_config_templating_firing_template | to_json }}
|
firing-template: {{ matrix_alertmanager_receiver_config_templating_firing_template | to_json }}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user