Skip to content

Commit 711146a

Browse files
committed
jsonnet: adjust thanos-sidecar alerts
Decrease severity of all the Thanos sidecar alerts to warning and increase their duration to 1h. Signed-off-by: Damien Grisonnet <[email protected]>
1 parent d36a61e commit 711146a

File tree

2 files changed

+32
-5
lines changed

2 files changed

+32
-5
lines changed

assets/prometheus-k8s/prometheus-rule.yaml

+6-5
Original file line numberDiff line numberDiff line change
@@ -248,25 +248,26 @@ spec:
248248
summary: Thanos Sidecar cannot connect to Prometheus
249249
expr: |
250250
sum by (job, instance) (thanos_sidecar_prometheus_up{job=~"prometheus-(k8s|user-workload)-thanos-sidecar"} == 0)
251-
for: 5m
251+
for: 1h
252252
labels:
253-
severity: critical
253+
severity: warning
254254
- alert: ThanosSidecarBucketOperationsFailed
255255
annotations:
256256
description: Thanos Sidecar {{$labels.job}} {{$labels.instance}} bucket operations
257257
are failing
258258
summary: Thanos Sidecar bucket operations are failing
259259
expr: |
260260
rate(thanos_objstore_bucket_operation_failures_total{job=~"prometheus-(k8s|user-workload)-thanos-sidecar"}[5m]) > 0
261-
for: 5m
261+
for: 1h
262262
labels:
263-
severity: critical
263+
severity: warning
264264
- alert: ThanosSidecarUnhealthy
265265
annotations:
266266
description: Thanos Sidecar {{$labels.job}} {{$labels.pod}} is unhealthy for
267267
more than {{ $value }} seconds.
268268
summary: Thanos Sidecar is unhealthy.
269269
expr: |
270270
time() - max(timestamp(thanos_sidecar_last_heartbeat_success_time_seconds{job=~"prometheus-(k8s|user-workload)-thanos-sidecar"})) by (job,pod) >= 240
271+
for: 1h
271272
labels:
272-
severity: critical
273+
severity: warning

jsonnet/patch-rules.libsonnet

+26
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,32 @@ local patchedRules = [
7474
},
7575
],
7676
},
77+
{
78+
name: 'thanos-sidecar',
79+
rules: [
80+
{
81+
alert: 'ThanosSidecarPrometheusDown',
82+
'for': '1h',
83+
labels: {
84+
severity: 'warning',
85+
},
86+
},
87+
{
88+
alert: 'ThanosSidecarBucketOperationsFailed',
89+
'for': '1h',
90+
labels: {
91+
severity: 'warning',
92+
},
93+
},
94+
{
95+
alert: 'ThanosSidecarUnhealthy',
96+
'for': '1h',
97+
labels: {
98+
severity: 'warning',
99+
},
100+
},
101+
],
102+
},
77103
];
78104

79105
local patchOrExcludeRule(rule, ruleSet, operation) =

0 commit comments

Comments
 (0)