-
Notifications
You must be signed in to change notification settings - Fork 6
/
prometheus_rules_config_map.yaml
71 lines (69 loc) · 2.61 KB
/
prometheus_rules_config_map.yaml
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
68
69
70
71
apiVersion: v1
kind: ConfigMap
metadata:
creationTimestamp: null
name: prometheus-rules
namespace: monitoring
data:
cpu-usage.rules: |
ALERT NodeCPUUsage
IF (100 - (avg by (instance) (irate(node_cpu{name="node-exporter",mode="idle"}[5m])) * 100)) > 5
FOR 2m
LABELS {
severity="page"
}
ANNOTATIONS {
SUMMARY = "机器{{$labels.instance}}: High CPU usage detected",
DESCRIPTION = "机器事件{{$labels.instance}}: CPU usage is above 75% (current value is: {{ $value }})"
}
instance-availability.rules: |
ALERT InstanceDown
IF up == 0
FOR 1m
LABELS { severity = "page" }
ANNOTATIONS {
summary = "机器Instance {{ $labels.instance }} down了",
description = "实例事件{{ $labels.instance }} of job {{ $labels.job }} has been down for more than 1 minute.",
}
low-disk-space.rules: |
ALERT NodeLowRootDisk
IF ((node_filesystem_size{mountpoint="/etc/hosts"} - node_filesystem_free{mountpoint="/etc/hosts"} ) / node_filesystem_size{mountpoint="/etc/hosts"} * 100) > 5
FOR 2m
LABELS {
severity="page"
}
ANNOTATIONS {
SUMMARY = "实例{{$labels.instance}}: Low root disk space",
DESCRIPTION = "实例事件{{$labels.instance}}: Root disk usage is above 75% (current value is: {{ $value }})"
}
ALERT NodeLowDataDisk
IF ((node_filesystem_size{mountpoint="/data-disk"} - node_filesystem_free{mountpoint="/data-disk"} ) / node_filesystem_size{mountpoint="/data-disk"} * 100) > 5
FOR 2m
LABELS {
severity="page"
}
ANNOTATIONS {
SUMMARY = "实例{{$labels.instance}}: Low data disk space",
DESCRIPTION = "实例事件{{$labels.instance}}: Data disk usage is above 75% (current value is: {{ $value }})"
}
mem-usage.rules: |
ALERT NodeSwapUsage
IF (((node_memory_SwapTotal-node_memory_SwapFree)/node_memory_SwapTotal)*100) > 5
FOR 2m
LABELS {
severity="page"
}
ANNOTATIONS {
SUMMARY = "实例{{$labels.instance}}: Swap usage detected",
DESCRIPTION = "实例事件{{$labels.instance}}: Swap usage usage is above 75% (current value is: {{ $value }})"
}
ALERT NodeMemoryUsage
IF (((node_memory_MemTotal-node_memory_MemFree-node_memory_Cached)/(node_memory_MemTotal)*100)) > 5
FOR 2m
LABELS {
severity="page"
}
ANNOTATIONS {
SUMMARY = "实例{{$labels.instance}}: High memory usage detected",
DESCRIPTION = "实例事件{{$labels.instance}}: Memory usage is above 75% (current value is: {{ $value }})"
}