Skip to content

Commit

Permalink
fix(alerts): add instance label to KubeAggregatedAPIErrors (#991)
Browse files Browse the repository at this point in the history
* fix(alerts): use sum by instance max for 'KubeAggregatedAPIErrors'

Signed-off-by: Sebastian Gaiser <[email protected]>

* Update alerts/kube_apiserver.libsonnet

Co-authored-by: Stephen Lang <[email protected]>

* Update alerts/kube_apiserver.libsonnet

* Update alerts/kube_apiserver.libsonnet

* fix(alerts): use sum by instance max for 'KubeAggregatedAPIErrors' - adjust description

Signed-off-by: Sebastian Gaiser <[email protected]>

* fix(build): remove extra parenthsis

Signed-off-by: Stephen Lang <[email protected]>

---------

Signed-off-by: Sebastian Gaiser <[email protected]>
Signed-off-by: Stephen Lang <[email protected]>
Co-authored-by: Stephen Lang <[email protected]>
Co-authored-by: Stephen Lang <[email protected]>
  • Loading branch information
3 people authored Dec 10, 2024
1 parent a3fbf21 commit d6ab1a7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions alerts/kube_apiserver.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,16 @@ local utils = import '../lib/utils.libsonnet';
{
alert: 'KubeAggregatedAPIErrors',
expr: |||
sum by(name, namespace, %(clusterLabel)s)(increase(aggregator_unavailable_apiservice_total{%(kubeApiserverSelector)s}[10m])) > 4
sum by(%(clusterLabel)s, instance, name, reason)(increase(aggregator_unavailable_apiservice_total{%(kubeApiserverSelector)s}[1m])) > 0
||| % $._config,
'for': '10m',
labels: {
severity: 'warning',
},
annotations: {
description: 'Kubernetes aggregated API {{ $labels.name }}/{{ $labels.namespace }} has reported errors. It has appeared unavailable {{ $value | humanize }} times averaged over the past 10m.',
description: 'Kubernetes aggregated API {{ $labels.instance }}/{{ $labels.name }} has reported {{ $labels.reason }} errors%s.' % [
utils.ifShowMultiCluster($._config, ' on cluster {{ $labels.%(clusterLabel)s }}' % $._config),
],
summary: 'Kubernetes aggregated API has reported errors.',
},
},
Expand Down

0 comments on commit d6ab1a7

Please sign in to comment.