-
Notifications
You must be signed in to change notification settings - Fork 15
/
state.libsonnet
75 lines (75 loc) · 2.71 KB
/
state.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
68
69
70
71
72
73
74
75
{
prometheusAlerts+:: {
groups+: [
{
name: 'cluster-state-alert.rules',
rules: [
{
alert: 'CephClusterErrorState',
expr: |||
ceph_health_status{%(cephExporterSelector)s} > 1
||| % $._config,
'for': $._config.clusterStateAlertTime,
labels: {
severity: 'critical',
},
annotations: {
message: 'Storage cluster is in error state',
description: 'Storage cluster is in error state for more than %s.' % $._config.clusterStateAlertTime,
storage_type: $._config.storageType,
severity_level: 'error',
},
},
{
alert: 'CephClusterWarningState',
expr: |||
ceph_health_status{%(cephExporterSelector)s} == 1
||| % $._config,
'for': $._config.clusterWarningStateAlertTime,
labels: {
severity: 'warning',
},
annotations: {
message: 'Storage cluster is in degraded state',
description: 'Storage cluster is in warning state for more than %s.' % $._config.clusterStateAlertTime,
storage_type: $._config.storageType,
severity_level: 'warning',
},
},
{
alert: 'CephOSDVersionMismatch',
expr: |||
count(count(ceph_osd_metadata{%(cephExporterSelector)s}) by (ceph_version, namespace)) by (ceph_version, namespace) > 1
||| % $._config,
'for': $._config.clusterVersionAlertTime,
labels: {
severity: 'warning',
},
annotations: {
message: 'There are multiple versions of storage services running.',
description: 'There are {{ $value }} different versions of Ceph OSD components running.',
storage_type: $._config.storageType,
severity_level: 'warning',
},
},
{
alert: 'CephMonVersionMismatch',
expr: |||
count(count(ceph_mon_metadata{%(cephExporterSelector)s, ceph_version != ""}) by (ceph_version)) > 1
||| % $._config,
'for': $._config.clusterVersionAlertTime,
labels: {
severity: 'warning',
},
annotations: {
message: 'There are multiple versions of storage services running.',
description: 'There are {{ $value }} different versions of Ceph Mon components running.',
storage_type: $._config.storageType,
severity_level: 'warning',
},
},
],
},
],
},
}