forked from grafana/jsonnet-libs
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathalerts.libsonnet
67 lines (67 loc) · 2.28 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
{
prometheusAlerts+: {
groups+: [
{
name: 'memcached',
rules: [
{
alert: 'MemcachedDown',
expr: |||
memcached_up == 0
|||,
'for': '15m',
labels: {
severity: 'critical',
},
annotations: {
description: 'Memcached instance {{ $labels.job }} / {{ $labels.instance }} is down for more than 15 minutes.',
summary: 'Memcached instance is down.',
},
},
{
alert: 'MemcachedConnectionLimitApproaching',
expr: |||
(memcached_current_connections / memcached_max_connections * 100) > 80
|||,
'for': '15m',
labels: {
severity: 'warning',
},
annotations: {
description: 'Memcached instance {{ $labels.job }} / {{ $labels.instance }} connection usage is at {{ printf "%0.0f" $value }}% for at least 15 minutes.',
summary: 'Memcached max connection limit is approaching.',
},
},
{
alert: 'MemcachedConnectionLimitApproaching',
expr: |||
(memcached_current_connections / memcached_max_connections * 100) > 95
|||,
'for': '15m',
labels: {
severity: 'critical',
},
annotations: {
description: 'Memcached instance {{ $labels.job }} / {{ $labels.instance }} connection usage is at {{ printf "%0.0f" $value }}% for at least 15 minutes.',
summary: 'Memcached connections at critical level.',
},
},
{
alert: 'MemcachedOutOfMemoryErrors',
expr: |||
sum without (slab) (rate(memcached_slab_items_outofmemory_total[5m])) > 0
|||,
'for': '15m',
labels: {
severity: 'warning',
},
annotations: {
description: 'Memcached instance {{ $labels.job }} / {{ $labels.instance }} has OutOfMemory errors for at least 15 minutes, current rate is {{ printf "%0.0f" $value }}',
summary: 'Memcached has OutOfMemory errors.',
},
},
],
},
],
},
}