Skip to content

Commit

Permalink
Reintroduce thanos_objstore_bucket_operation_failures_total alert
Browse files Browse the repository at this point in the history
Metric was removed on PR 2002 by mistake

Signed-off-by: dmaiocchi <dmaiocchi@suse.com>
  • Loading branch information
MalloZup committed Dec 17, 2020
1 parent 4abb51a commit d00e8d2
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 1 deletion.
11 changes: 11 additions & 0 deletions examples/alerts/alerts.md
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,17 @@ rules:
for: 5m
labels:
severity: critical
- alert: ThanosSidecarBucketOperationsFailed
annotations:
description: Thanos Sidecar {{$labels.job}} {{$labels.pod}} bucket operations
are failing
runbook_url: https://github.com/thanos-io/thanos/tree/master/mixin/runbook.md#alert-name-thanossidecarbucketoperationsfailed
summary: Thanos Sidecar bucket operations are failing
expr: |
rate(thanos_objstore_bucket_operation_failures_total{job=~"thanos-sidecar.*"}[5m]) > 0
for: 5m
labels:
severity: critical
- alert: ThanosSidecarUnhealthy
annotations:
description: Thanos Sidecar {{$labels.job}} {{$labels.pod}} is unhealthy for {{
Expand Down
11 changes: 11 additions & 0 deletions examples/alerts/alerts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,17 @@ groups:
for: 5m
labels:
severity: critical
- alert: ThanosSidecarBucketOperationsFailed
annotations:
description: Thanos Sidecar {{$labels.job}} {{$labels.pod}} bucket operations
are failing
runbook_url: https://github.com/thanos-io/thanos/tree/master/mixin/runbook.md#alert-name-thanossidecarbucketoperationsfailed
summary: Thanos Sidecar bucket operations are failing
expr: |
rate(thanos_objstore_bucket_operation_failures_total{job=~"thanos-sidecar.*"}[5m]) > 0
for: 5m
labels:
severity: critical
- alert: ThanosSidecarUnhealthy
annotations:
description: Thanos Sidecar {{$labels.job}} {{$labels.pod}} is unhealthy for
Expand Down
14 changes: 14 additions & 0 deletions mixin/alerts/sidecar.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,20 @@
severity: 'critical',
},
},
{
alert: 'ThanosSidecarBucketOperationsFailed',
annotations: {
description: 'Thanos Sidecar {{$labels.job}} {{$labels.pod}} bucket operations are failing',
summary: 'Thanos Sidecar bucket operations are failing',
},
expr: |||
rate(thanos_objstore_bucket_operation_failures_total{%(selector)s}[5m]) > 0
||| % thanos.sidecar,
'for': '5m',
labels: {
severity: 'critical',
},
},
{
alert: 'ThanosSidecarUnhealthy',
annotations: {
Expand Down
2 changes: 1 addition & 1 deletion pkg/rules/rules_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func testRulesAgainstExamples(t *testing.T, dir string, server rulespb.RulesServ
{
Name: "thanos-sidecar",
File: filepath.Join(dir, "alerts.yaml"),
Rules: []*rulespb.Rule{someAlert, someAlert},
Rules: []*rulespb.Rule{someAlert, someAlert, someAlert},
Interval: 60,
PartialResponseStrategy: storepb.PartialResponseStrategy_ABORT,
},
Expand Down

0 comments on commit d00e8d2

Please sign in to comment.