Skip to content

Commit

Permalink
mixin: Alert on receive not uploading recent data (#2612)
Browse files Browse the repository at this point in the history
Signed-off-by: Frederic Branczyk <[email protected]>
  • Loading branch information
brancz authored May 15, 2020
1 parent 7349a08 commit ecf7824
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
8 changes: 8 additions & 0 deletions examples/alerts/alerts.md
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,14 @@ rules:
for: 5m
labels:
severity: warning
- alert: ThanosReceiveNoUpload
annotations:
message: Thanos Receive {{$labels.job}} has not uploaded latest data to object
storage.
expr: increase(thanos_shipper_uploads_total{job=~"thanos-receive.*"}[2h]) == 0
for: 30m
labels:
severity: warning
```
## Replicate
Expand Down
8 changes: 8 additions & 0 deletions examples/alerts/alerts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,14 @@ groups:
for: 5m
labels:
severity: warning
- alert: ThanosReceiveNoUpload
annotations:
message: Thanos Receive {{$labels.job}} has not uploaded latest data to object
storage.
expr: increase(thanos_shipper_uploads_total{job=~"thanos-receive.*"}[2h]) == 0
for: 30m
labels:
severity: warning
- name: thanos-sidecar.rules
rules:
- alert: ThanosSidecarPrometheusDown
Expand Down
11 changes: 11 additions & 0 deletions mixin/thanos/alerts/receive.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,17 @@
severity: 'warning',
},
},
{
alert: 'ThanosReceiveNoUpload',
annotations: {
message: 'Thanos Receive {{$labels.job}} has not uploaded latest data to object storage.',
},
expr: 'increase(thanos_shipper_uploads_total{%(selector)s}[2h]) == 0' % thanos.receive,
'for': '30m',
labels: {
severity: 'warning',
},
},
],
},
],
Expand Down

0 comments on commit ecf7824

Please sign in to comment.