-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmongodb-alerts.yaml
64 lines (64 loc) · 2.65 KB
/
mongodb-alerts.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
kind: PrometheusRule
apiVersion: monitoring.coreos.com/v1
metadata:
prometheus: dx
spec:
groups:
- name: mongodb-alert
interval: 10m
rules:
- expr: mongodb_uptime_ns < 60
alert: [P1]-MongoDB服务发生重启
for: 1m
labels:
severity: error
annotations:
description: 实例为 {{ $labels.instance }} 的MongoDB实例已重启,请检查数据库实例
level: P1
ruleGroupName: mongodb-alert
ruleName: [P1]-MongoDB服务发生重启
type: mongodb
- expr: mongodb_connections_current / mongodb_connections_available *100 > 95
alert: [P2]-MongoDB连接数使用率高
for: 5m
labels:
severity: warn
annotations:
description: 实例为 {{ $labels.instance }} MongoDB连接数使用率> 95%,实际使用率为{{ humanize $value }}%,请保持观察数据库和业务运行的稳定
level: P2
ruleGroupName: mongodb-alert
ruleName: [P2]-MongoDB连接数使用率高
type: mongodb
- expr: mongodb_net_out_bytes / 1024 / 1024 > 50
alert: [P3]-MongoDB 出站流量高
for: 5m
labels:
severity: info
annotations:
description: 实例为 {{ $labels.instance }} MongoDB实例,入站流量已高于50MB,实际为{{ humanize $value }},请保持观察数据库和业务运行的稳定
level: P3
ruleGroupName: mongodb-alert
ruleName: [P3]-MongoDB 出站流量高
type: mongodb
- expr: mongodb_connections_current / mongodb_connections_available *100 > 85
alert: [P3]-MongoDB连接数使用率高
for: 5m
labels:
severity: info
annotations:
description: 实例为 {{ $labels.instance }} MongoDB连接数使用率> 85%,实际使用率为{{ humanize $value }}%,请保持观察数据库和业务运行的稳定
level: P3
ruleGroupName: mongodb-alert
ruleName: [P3]-MongoDB连接数使用率高
type: mongodb
- expr: mongodb_net_in_bytes / 1024 / 1024 > 20
alert: [P3]-MongoDB 入站流量高
for: 5m
labels:
severity: info
annotations:
description: 实例为 {{ $labels.instance }} MongoDB实例,入站流量已高于20MB,实际为{{ humanize $value }},请保持观察数据库和业务运行的稳定
level: P3
ruleGroupName: mongodb-alert
ruleName: [P3]-MongoDB 入站流量高
type: mongodb