-
Notifications
You must be signed in to change notification settings - Fork 163
/
alerts.libsonnet
51 lines (51 loc) · 1.24 KB
/
alerts.libsonnet
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{
prometheusAlerts+:: {
groups+: [{
name: 'consul',
rules: [
{
alert: 'ConsulUp',
expr: |||
consul_up != 1
|||,
'for': '1m',
labels: {
severity: 'critical',
},
annotations: {
summary: 'Consul is not up.',
description: "Consul '{{ $labels.job }}' is not up.",
},
},
{
alert: 'ConsulMaster',
expr: |||
consul_raft_leader != 1
|||,
'for': '1m',
labels: {
severity: 'critical',
},
annotations: {
summary: 'Consul has no master.',
description: "Consul '{{ $labels.job }}' has no master.",
},
},
{
alert: 'ConsulPeers',
expr: |||
consul_raft_peers != %(consul_replicas)s
||| % $._config,
'for': '10m',
labels: {
severity: 'critical',
},
annotations: {
summary: 'Consul does not have peers.' % $._config,
description: "Consul '{{ $labels.job }}' does not have %(consul_replicas)s peers." % $._config,
},
},
],
}],
},
}