Skip to content

Commit

Permalink
mixin/thanos: add DNS alerts for Thanos Ruler (#2027)
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Pasquier <[email protected]>
  • Loading branch information
simonpasquier authored and bwplotka committed Jan 25, 2020
1 parent 860460c commit d6bee65
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 0 deletions.
28 changes: 28 additions & 0 deletions examples/alerts/alerts.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,34 @@ rules:
for: 5m
labels:
severity: warning
- alert: ThanosRulerQueryHighDNSFailures
annotations:
message: Thanos Ruler {{$labels.job}} have {{ $value | humanize }}% of failing
DNS queries for query endpoints.
expr: |
(
sum by (job) (rate(thanos_ruler_query_apis_dns_failures_total{job=~"thanos-ruler.*"}[5m]))
/
sum by (job) (rate(thanos_ruler_query_apis_dns_lookups_total{job=~"thanos-ruler.*"}[5m]))
* 100 > 1
)
for: 15m
labels:
severity: warning
- alert: ThanosRulerAlertmanagerHighDNSFailures
annotations:
message: Thanos Ruler {{$labels.job}} have {{ $value | humanize }}% of failing
DNS queries for Alertmanager endpoints.
expr: |
(
sum by (job) (rate(thanos_ruler_alertmanagers_dns_failures_total{job=~"thanos-ruler.*"}[5m]))
/
sum by (job) (rate(thanos_ruler_alertmanagers_dns_lookups_total{job=~"thanos-ruler.*"}[5m]))
* 100 > 1
)
for: 15m
labels:
severity: warning
```
## Store Gateway
Expand Down
28 changes: 28 additions & 0 deletions examples/alerts/alerts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,34 @@ groups:
for: 5m
labels:
severity: warning
- alert: ThanosRulerQueryHighDNSFailures
annotations:
message: Thanos Ruler {{$labels.job}} have {{ $value | humanize }}% of failing
DNS queries for query endpoints.
expr: |
(
sum by (job) (rate(thanos_ruler_query_apis_dns_failures_total{job=~"thanos-ruler.*"}[5m]))
/
sum by (job) (rate(thanos_ruler_query_apis_dns_lookups_total{job=~"thanos-ruler.*"}[5m]))
* 100 > 1
)
for: 15m
labels:
severity: warning
- alert: ThanosRulerAlertmanagerHighDNSFailures
annotations:
message: Thanos Ruler {{$labels.job}} have {{ $value | humanize }}% of failing
DNS queries for Alertmanager endpoints.
expr: |
(
sum by (job) (rate(thanos_ruler_alertmanagers_dns_failures_total{job=~"thanos-ruler.*"}[5m]))
/
sum by (job) (rate(thanos_ruler_alertmanagers_dns_lookups_total{job=~"thanos-ruler.*"}[5m]))
* 100 > 1
)
for: 15m
labels:
severity: warning
- name: thanos-component-absent.rules
rules:
- alert: ThanosCompactorIsDown
Expand Down
36 changes: 36 additions & 0 deletions mixin/thanos/alerts/ruler.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,42 @@
severity: 'warning',
},
},
{
alert: 'ThanosRulerQueryHighDNSFailures',
annotations: {
message: 'Thanos Ruler {{$labels.job}} have {{ $value | humanize }}% of failing DNS queries for query endpoints.',
},
expr: |||
(
sum by (job) (rate(thanos_ruler_query_apis_dns_failures_total{%(selector)s}[5m]))
/
sum by (job) (rate(thanos_ruler_query_apis_dns_lookups_total{%(selector)s}[5m]))
* 100 > 1
)
||| % thanos.ruler,
'for': '15m',
labels: {
severity: 'warning',
},
},
{
alert: 'ThanosRulerAlertmanagerHighDNSFailures',
annotations: {
message: 'Thanos Ruler {{$labels.job}} have {{ $value | humanize }}% of failing DNS queries for Alertmanager endpoints.',
},
expr: |||
(
sum by (job) (rate(thanos_ruler_alertmanagers_dns_failures_total{%(selector)s}[5m]))
/
sum by (job) (rate(thanos_ruler_alertmanagers_dns_lookups_total{%(selector)s}[5m]))
* 100 > 1
)
||| % thanos.ruler,
'for': '15m',
labels: {
severity: 'warning',
},
},
],
},
],
Expand Down

0 comments on commit d6bee65

Please sign in to comment.