diff --git a/jsonnet/kube-prometheus/alerts/general.libsonnet b/jsonnet/kube-prometheus/alerts/general.libsonnet index 4f9491562002ad2f71f0adf85007474854a9d2f6..79eba7d99c7b45a662a950ba2aa296db20669454 100644 --- a/jsonnet/kube-prometheus/alerts/general.libsonnet +++ b/jsonnet/kube-prometheus/alerts/general.libsonnet @@ -7,7 +7,7 @@ { alert: 'TargetDown', annotations: { - message: '{{ $value }}% of the {{ $labels.job }} targets are down.', + message: '{{ printf "%.4g" $value }}% of the {{ $labels.job }} targets are down.', }, expr: '100 * (count(up == 0) BY (job, namespace, service) / count(up) BY (job, namespace, service)) > 10', 'for': '10m', diff --git a/manifests/prometheus-rules.yaml b/manifests/prometheus-rules.yaml index afcd6b0943f11f479b0342c7b7e68b4cfb224f6a..f6413d4c8d5afa553b4278077db1ea215c866f98 100644 --- a/manifests/prometheus-rules.yaml +++ b/manifests/prometheus-rules.yaml @@ -1123,7 +1123,8 @@ spec: rules: - alert: TargetDown annotations: - message: '{{ $value }}% of the {{ $labels.job }} targets are down.' + message: '{{ printf "%.4g" $value }}% of the {{ $labels.job }} targets are + down.' expr: 100 * (count(up == 0) BY (job, namespace, service) / count(up) BY (job, namespace, service)) > 10 for: 10m