Skip to content

Commit

Permalink
Merge pull request #93 from aruniiird/add-namespace-to-ceph-queries
Browse files Browse the repository at this point in the history
Add namespace to ceph queries
  • Loading branch information
umangachapagain committed Feb 2, 2022
2 parents aafd91b + 03484c5 commit 2464af2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions alerts/absent_alerts.libsonnet
Expand Up @@ -23,7 +23,7 @@
{
alert: 'CephMgrIsMissingReplicas',
expr: |||
sum(up{%(cephExporterSelector)s}) < %(cephMgrCount)d
sum(up{%(cephExporterSelector)s}) by (namespace) < %(cephMgrCount)d
||| % $._config,
'for': $._config.mgrMissingReplicasAlertTime,
labels: {
Expand All @@ -44,7 +44,7 @@
{
alert: 'CephMdsMissingReplicas',
expr: |||
sum(ceph_mds_metadata{%(cephExporterSelector)s} == 1) < %(cephMdsCount)d
sum(ceph_mds_metadata{%(cephExporterSelector)s} == 1) by (namespace) < %(cephMdsCount)d
||| % $._config,
'for': $._config.mdsMissingReplicasAlertTime,
labels: {
Expand Down
2 changes: 1 addition & 1 deletion alerts/monquorum.libsonnet
Expand Up @@ -7,7 +7,7 @@
{
alert: 'CephMonQuorumAtRisk',
expr: |||
count(ceph_mon_quorum_status{%s} == 1) <= (floor(count(ceph_mon_metadata{%s}) / 2) + 1)
count(ceph_mon_quorum_status{%s} == 1) by (namespace) <= (floor(count(ceph_mon_metadata{%s}) by (namespace) / 2) + 1)
||| % [$._config.cephExporterSelector, $._config.cephExporterSelector],
'for': $._config.monQuorumAlertTime,
labels: {
Expand Down
2 changes: 1 addition & 1 deletion alerts/state.libsonnet
Expand Up @@ -39,7 +39,7 @@
{
alert: 'CephOSDVersionMismatch',
expr: |||
count(count(ceph_osd_metadata{%(cephExporterSelector)s}) by (ceph_version)) > 1
count(count(ceph_osd_metadata{%(cephExporterSelector)s}) by (ceph_version, namespace)) by (ceph_version, namespace) > 1
||| % $._config,
'for': $._config.clusterVersionAlertTime,
labels: {
Expand Down
8 changes: 4 additions & 4 deletions extras/manifests/prometheus-ceph-rules.yaml
Expand Up @@ -53,7 +53,7 @@ spec:
severity_level: warning
storage_type: ceph
expr: |
sum(up{job="rook-ceph-mgr"}) < 1
sum(up{job="rook-ceph-mgr"}) by (namespace) < 1
for: 5m
labels:
severity: warning
Expand All @@ -66,7 +66,7 @@ spec:
severity_level: warning
storage_type: ceph
expr: |
sum(ceph_mds_metadata{job="rook-ceph-mgr"} == 1) < 2
sum(ceph_mds_metadata{job="rook-ceph-mgr"} == 1) by (namespace) < 2
for: 5m
labels:
severity: warning
Expand All @@ -79,7 +79,7 @@ spec:
severity_level: error
storage_type: ceph
expr: |
count(ceph_mon_quorum_status{job="rook-ceph-mgr"} == 1) <= (floor(count(ceph_mon_metadata{job="rook-ceph-mgr"}) / 2) + 1)
count(ceph_mon_quorum_status{job="rook-ceph-mgr"} == 1) by (namespace) <= (floor(count(ceph_mon_metadata{job="rook-ceph-mgr"}) by (namespace) / 2) + 1)
for: 15m
labels:
severity: critical
Expand Down Expand Up @@ -252,7 +252,7 @@ spec:
severity_level: warning
storage_type: ceph
expr: |
count(count(ceph_osd_metadata{job="rook-ceph-mgr"}) by (ceph_version)) > 1
count(count(ceph_osd_metadata{job="rook-ceph-mgr"}) by (ceph_version, namespace)) by (ceph_version, namespace) > 1
for: 10m
labels:
severity: warning
Expand Down

0 comments on commit 2464af2

Please sign in to comment.