From 483a1c115fb06fac4064ae288f8c513ea056e12d Mon Sep 17 00:00:00 2001 From: Matthias Loibl <mail@matthiasloibl.com> Date: Thu, 13 Sep 2018 14:59:50 +0200 Subject: [PATCH] contrib/kube-prometheus: Fix outdated alerts to use message annotation --- jsonnet/kube-prometheus/alerts/alertmanager.libsonnet | 9 +++------ jsonnet/kube-prometheus/alerts/general.libsonnet | 6 ++---- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/jsonnet/kube-prometheus/alerts/alertmanager.libsonnet b/jsonnet/kube-prometheus/alerts/alertmanager.libsonnet index 90e3f5c7..f3bbd0ea 100644 --- a/jsonnet/kube-prometheus/alerts/alertmanager.libsonnet +++ b/jsonnet/kube-prometheus/alerts/alertmanager.libsonnet @@ -7,8 +7,7 @@ { alert: 'AlertmanagerConfigInconsistent', annotations: { - description: 'The configuration of the instances of the Alertmanager cluster `{{$labels.service}}` are out of sync.', - summary: 'Configuration out of sync', + message: 'The configuration of the instances of the Alertmanager cluster `{{$labels.service}}` are out of sync.', }, expr: ||| count_values("config_hash", alertmanager_config_hash{%(alertmanagerSelector)s}) BY (service) / ON(service) GROUP_LEFT() label_replace(prometheus_operator_alertmanager_spec_replicas{%(prometheusOperatorSelector)s}, "service", "alertmanager-$1", "alertmanager", "(.*)") != 1 @@ -21,8 +20,7 @@ { alert: 'AlertmanagerDownOrMissing', annotations: { - description: 'An unexpected number of Alertmanagers were scraped or disappeared from discovery.', - summary: 'Alertmanager down or missing', + message: 'An unexpected number of Alertmanagers were scraped or disappeared from discovery.', }, expr: ||| label_replace(prometheus_operator_alertmanager_spec_replicas{%(prometheusOperatorSelector)s}, "job", "alertmanager-$1", "alertmanager", "(.*)") / ON(job) GROUP_RIGHT() sum(up{%(alertmanagerSelector)s}) BY (job) != 1 @@ -35,8 +33,7 @@ { alert: 'AlertmanagerFailedReload', annotations: { - description: "Reloading Alertmanager's configuration has failed for {{ $labels.namespace }}/{{ $labels.pod}}.", - summary: "Alertmanager's configuration reload failed", + message: "Reloading Alertmanager's configuration has failed for {{ $labels.namespace }}/{{ $labels.pod}}.", }, expr: ||| alertmanager_config_last_reload_successful{%(alertmanagerSelector)s} == 0 diff --git a/jsonnet/kube-prometheus/alerts/general.libsonnet b/jsonnet/kube-prometheus/alerts/general.libsonnet index ecdd9a21..6ac25703 100644 --- a/jsonnet/kube-prometheus/alerts/general.libsonnet +++ b/jsonnet/kube-prometheus/alerts/general.libsonnet @@ -7,8 +7,7 @@ { alert: 'TargetDown', annotations: { - description: '{{ $value }}% of the {{ $labels.job }} targets are down.', - summary: 'Targets are down', + message: '{{ $value }}% of the {{ $labels.job }} targets are down.', }, expr: '100 * (count(up == 0) BY (job) / count(up) BY (job)) > 10', 'for': '10m', @@ -19,8 +18,7 @@ { alert: 'DeadMansSwitch', annotations: { - description: 'This is a DeadMansSwitch meant to ensure that the entire alerting pipeline is functional.', - summary: 'Alerting DeadMansSwitch', + message: 'This is a DeadMansSwitch meant to ensure that the entire alerting pipeline is functional.', }, expr: 'vector(1)', labels: { -- GitLab