Debian Codegraph @

contrib/redis-mixin/alerts/redis.libsonnet

raw
1 {
2 prometheusAlerts+:: {
3 groups+: [
4 {
5 name: 'redis',
6 rules: [
7 {
8 alert: 'RedisDown',
9 expr: 'redis_up{%(redisExporterSelector)s} == 0' % $._config,
10 'for': '5m',
11 labels: {
12 severity: 'critical',
13 },
14 annotations: {
15 summary: 'Redis down (instance {{ $labels.instance }})',
16 description: 'Redis instance is down\n VALUE = {{ $value }}\n LABELS: {{ $labels }}',
17 },
18 },
19 {
20 alert: 'RedisOutOfMemory',
21 expr: 'redis_memory_used_bytes{%(redisExporterSelector)s} / redis_total_system_memory_bytes{%(redisExporterSelector)s} * 100 > 90' % $._config,
22 'for': '5m',
23 labels: {
24 severity: 'warning',
25 },
26 annotations: {
27 summary: 'Redis out of memory (instance {{ $labels.instance }})',
28 description: 'Redis is running out of memory (> 90%)\n VALUE = {{ $value }}\n LABELS: {{ $labels }}',
29 },
30 },
31 {
32 alert: 'RedisTooManyConnections',
33 expr: 'redis_connected_clients{%(redisExporterSelector)s} > %(redisConnectionsThreshold)s' % $._config,
34 'for': '5m',
35 labels: {
36 severity: 'warning',
37 },
38 annotations: {
39 summary: 'Redis too many connections (instance {{ $labels.instance }})',
40 description: 'Redis instance has too many connections\n VALUE = {{ $value }}\n LABELS: {{ $labels }}',
41 },
42 },
43 {
44 alert: 'RedisClusterSlotFail',
45 expr: 'redis_cluster_slots_fail{%(redisExporterSelector)s} > 0' % $._config,
46 'for': '5m',
47 labels: {
48 severity: 'warning',
49 },
50 annotations: {
51 summary: 'Number of hash slots mapping to a node in FAIL state (instance {{ $labels.instance }})',
52 description: 'Redis cluster has slots fail\n VALUE = {{ $value }}\n LABELS: {{ $labels }}',
53 },
54 },
55 {
56 alert: 'RedisClusterSlotPfail',
57 expr: 'redis_cluster_slots_pfail{%(redisExporterSelector)s} > 0' % $._config,
58 'for': '5m',
59 labels: {
60 severity: 'warning',
61 },
62 annotations: {
63 summary: 'Number of hash slots mapping to a node in PFAIL state (instance {{ $labels.instance }})',
64 description: 'Redis cluster has slots pfail\n VALUE = {{ $value }}\n LABELS: {{ $labels }}',
65 },
66 },
67 {
68 alert: 'RedisClusterStateNotOk',
69 expr: 'redis_cluster_state{%(redisExporterSelector)s} == 0' % $._config,
70 'for': '5m',
71 labels: {
72 severity: 'critical',
73 },
74 annotations: {
75 summary: 'Redis cluster state is not ok (instance {{ $labels.instance }})',
76 description: 'Redis cluster is not ok\n VALUE = {{ $value }}\n LABELS: {{ $labels }}',
77 },
78 },
79 ],
80 },
81 ],
82 },
83 }