diff --git a/jsonnet/kube-prometheus/alerts/general.libsonnet b/jsonnet/kube-prometheus/alerts/general.libsonnet index 8802097e071f81fdb6cb83f842fc292937cbbdb7..4f9491562002ad2f71f0adf85007474854a9d2f6 100644 --- a/jsonnet/kube-prometheus/alerts/general.libsonnet +++ b/jsonnet/kube-prometheus/alerts/general.libsonnet @@ -9,7 +9,7 @@ annotations: { message: '{{ $value }}% of the {{ $labels.job }} targets are down.', }, - expr: '100 * (count(up == 0) BY (job) / count(up) BY (job)) > 10', + expr: '100 * (count(up == 0) BY (job, namespace, service) / count(up) BY (job, namespace, service)) > 10', 'for': '10m', labels: { severity: 'warning', diff --git a/manifests/prometheus-rules.yaml b/manifests/prometheus-rules.yaml index 65db451fd2ffed0d495cdf8044d967aee47ff197..b90c8efb6c067c210c1a8dc45520d3bb6344578b 100644 --- a/manifests/prometheus-rules.yaml +++ b/manifests/prometheus-rules.yaml @@ -1124,7 +1124,8 @@ spec: - alert: TargetDown annotations: message: '{{ $value }}% of the {{ $labels.job }} targets are down.' - expr: 100 * (count(up == 0) BY (job) / count(up) BY (job)) > 10 + expr: 100 * (count(up == 0) BY (job, namespace, service) / count(up) BY (job, + namespace, service)) > 10 for: 10m labels: severity: warning