Skip to content

Commit

Permalink
jsonnet: Drop unnecessary kube-state-metrics alerts
Browse files Browse the repository at this point in the history
We don't configure sharding for kube-state-metrics, so there's no
reason to ship the critical alerts for them, or maintain runbooks for
them, etc. This drops the two critical alerts related to sharding.
  • Loading branch information
bison authored and openshift-cherrypick-robot committed Oct 15, 2021
1 parent f1c2496 commit 47e239f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 24 deletions.
24 changes: 0 additions & 24 deletions assets/kube-state-metrics/prometheus-rule.yaml
Expand Up @@ -42,27 +42,3 @@ spec:
for: 15m
labels:
severity: warning
- alert: KubeStateMetricsShardingMismatch
annotations:
description: kube-state-metrics pods are running with different --total-shards
configuration, some Kubernetes objects may be exposed multiple times or
not exposed at all.
summary: kube-state-metrics sharding is misconfigured.
expr: |
stdvar (kube_state_metrics_total_shards{job="kube-state-metrics"}) != 0
for: 15m
labels:
severity: critical
- alert: KubeStateMetricsShardsMissing
annotations:
description: kube-state-metrics shards are missing, some Kubernetes objects
are not being exposed.
summary: kube-state-metrics shards are missing.
expr: |
2^max(kube_state_metrics_total_shards{job="kube-state-metrics"}) - 1
-
sum( 2 ^ max by (shard_ordinal) (kube_state_metrics_shard_ordinal{job="kube-state-metrics"}) )
!= 0
for: 15m
labels:
severity: critical
8 changes: 8 additions & 0 deletions jsonnet/utils/sanitize-rules.libsonnet
Expand Up @@ -26,6 +26,14 @@ local excludedRules = [
{ alert: 'TargetDown' },
],
},
{
name: 'kube-state-metrics',
rules: [
// We do not configure sharding for kube-state-metrics.
{ alert: 'KubeStateMetricsShardingMismatch' },
{ alert: 'KubeStateMetricsShardsMissing' },
],
},
{
name: 'kubernetes-system',
rules: [
Expand Down

0 comments on commit 47e239f

Please sign in to comment.