Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add absent alerts #50

Merged
merged 5 commits into from
May 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions alerts/absent_alerts.libsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
prometheusAlerts+:: {
groups+: [
{
name: 'ceph-mgr-status',
rules: [
{
alert: 'CephMgrIsAbsent',
expr: |||
absent(up{%(cephExporterSelector)s} == 1)
||| % $._config,
'for': $._config.mgrIsAbsentAlertTime,
labels: {
severity: 'warning',
},
annotations: {
message: 'Storage metrics collector service not available anymore.',
description: 'Ceph Manager has disappeared from Prometheus target discovery.',
storage_type: $._config.storageType,
severity_level: 'warning',
},
},
{
alert: 'CephMgrIsMissingReplicas',
expr: |||
sum(up{%(cephExporterSelector)s}) < %(cephMgrCount)d
||| % $._config,
'for': $._config.mgrMissingReplicasAlertTime,
labels: {
severity: 'warning',
},
annotations: {
message: "Storage metrics collector service doesn't have required no of replicas.",
description: 'Ceph Manager is missing replicas.',
storage_type: $._config.storageType,
severity_level: 'warning',
},
},
],
},
],
},
}
1 change: 1 addition & 0 deletions alerts/alerts.libsonnet
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
(import 'absent_alerts.libsonnet') +
(import 'monquorum.libsonnet') +
(import 'node.libsonnet') +
(import 'osd.libsonnet') +
Expand Down
5 changes: 5 additions & 0 deletions config.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
// Selectors are inserted between {} in Prometheus queries.
cephExporterSelector: 'job="rook-ceph-mgr"',

// Expected number of Ceph Managers which are reporting metrics
cephMgrCount: 1,

// Duration to raise various Alerts
cephNodeDownAlertTime: '30s',
clusterStateAlertTime: '10m',
Expand All @@ -15,6 +18,8 @@
osdDiskAlertTime: '1m',
osdDownAlertTime: '5m',
PGRepairAlertTime: '1h',
mgrMissingReplicasAlertTime: '5m',
mgrIsAbsentAlertTime: '5m',

// Constants
storageType: 'ceph',
Expand Down
48 changes: 48 additions & 0 deletions extras/manifests/prometheus-ceph-rules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,30 @@ spec:
- expr: |
(sum((max(label_replace(ceph_disk_occupation{job="rook-ceph-mgr"},"node","$1","exported_instance","(.*)")) by (node)) * on (node) group_right() (label_replace(max by(pod_ip,node) (kube_pod_info{pod=~"node-exporter.*"}), "instance", "$1:9100", "pod_ip", "(.*)")) * on (instance) group_right() (irate(node_disk_read_time_seconds_total[1m]) + irate(node_disk_write_time_seconds_total[1m]) / (irate(node_disk_reads_completed_total[1m]) + irate(node_disk_writes_completed_total[1m]))>0)))
record: cluster:ceph_disk_latency:join_ceph_node_disk_irate1m
- name: ceph-mgr-status
rules:
- alert: CephMgrIsAbsent
annotations:
description: Ceph Manager has disappeared from Prometheus target discovery.
message: Storage metrics collector service not available anymore.
severity_level: warning
storage_type: ceph
expr: |
absent(up{job="rook-ceph-mgr"} == 1)
for: 5m
labels:
severity: warning
- alert: CephMgrIsMissingReplicas
annotations:
description: Ceph Manager is missing replicas.
message: Storage metrics collector service doesn't have required no of replicas.
severity_level: warning
storage_type: ceph
expr: |
sum(up{job="rook-ceph-mgr"}) < 1
for: 5m
labels:
severity: warning
- name: quorum-alert.rules
rules:
- alert: CephMonQuorumAtRisk
Expand Down Expand Up @@ -115,6 +139,30 @@ spec:
for: 10m
labels:
severity: warning
- alert: CephOSDVersionMismatch
annotations:
description: There are {{ $value }} different versions of Ceph OSD components
running.
message: There are multiple versions of storage services running.
severity_level: warning
storage_type: ceph
expr: |
count(count(ceph_osd_metadata{job="rook-ceph-mgr"}) by (ceph_version)) > 1
for: 10m
labels:
severity: warning
- alert: CephMonVersionMismatch
annotations:
description: There are {{ $value }} different versions of Ceph Mon components
running.
message: There are multiple versions of storage services running.
severity_level: warning
storage_type: ceph
expr: |
count(count(ceph_mon_metadata{job="rook-ceph-mgr"}) by (ceph_version)) > 1
for: 10m
labels:
severity: warning
- name: cluster-utilization-alert.rules
rules:
- alert: CephClusterNearFull
Expand Down