Skip to content

Commit

Permalink
Changed alerts queries to support multicluster mode
Browse files Browse the repository at this point in the history
Needed changes are made for alerts queries to support multicluster mode.

Signed-off-by: Arun Kumar Mohan <[email protected]>
  • Loading branch information
aruniiird committed Dec 18, 2023
1 parent b450b29 commit 8f67291
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 26 deletions.
8 changes: 4 additions & 4 deletions metrics/deploy/prometheus-ocs-rules-external.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ spec:
severity_level: warning
storage_type: RGW
expr: |
(ocs_objectbucketclaim_info * on (namespace, objectbucket) group_left() (ocs_objectbucket_used_bytes/ocs_objectbucket_max_bytes)) > 0.80
(ocs_objectbucketclaim_info * on (namespace, objectbucket, managedBy) group_left() (ocs_objectbucket_used_bytes/ocs_objectbucket_max_bytes)) > 0.80
for: 10s
labels:
severity: warning
Expand All @@ -84,7 +84,7 @@ spec:
severity_level: warning
storage_type: RGW
expr: |
(ocs_objectbucketclaim_info * on (namespace, objectbucket) group_left() (ocs_objectbucket_objects_total/ocs_objectbucket_max_objects)) > 0.80
(ocs_objectbucketclaim_info * on (namespace, managedBy, objectbucket) group_left() (ocs_objectbucket_objects_total/ocs_objectbucket_max_objects)) > 0.80
for: 10s
labels:
severity: warning
Expand All @@ -95,7 +95,7 @@ spec:
severity_level: error
storage_type: RGW
expr: |
(ocs_objectbucketclaim_info * on (namespace, objectbucket) group_left() (ocs_objectbucket_used_bytes/ocs_objectbucket_max_bytes)) >= 1
(ocs_objectbucketclaim_info * on (namespace, managedBy, objectbucket) group_left() (ocs_objectbucket_used_bytes/ocs_objectbucket_max_bytes)) >= 1
for: 0s
labels:
severity: critical
Expand All @@ -106,7 +106,7 @@ spec:
severity_level: error
storage_type: RGW
expr: |
(ocs_objectbucketclaim_info * on (namespace, objectbucket) group_left() (ocs_objectbucket_objects_total/ocs_objectbucket_max_objects)) >= 1
(ocs_objectbucketclaim_info * on (namespace, managedBy, objectbucket) group_left() (ocs_objectbucket_objects_total/ocs_objectbucket_max_objects)) >= 1
for: 0s
labels:
severity: critical
Expand Down
22 changes: 11 additions & 11 deletions metrics/deploy/prometheus-ocs-rules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ spec:
severity_level: error
storage_type: ceph
expr: |
((count by(namespace) (ocs_mirror_daemon_count{job="ocs-metrics-exporter"} == 0)) * on(namespace) group_left() (count by(namespace) (ocs_pool_mirroring_status{job="ocs-metrics-exporter"} == 1))) > 0
((count by(namespace, managedBy) (ocs_mirror_daemon_count{job="ocs-metrics-exporter"} == 0)) * on(namespace, managedBy) group_left() (count by(namespace, managedBy) (ocs_pool_mirroring_status{job="ocs-metrics-exporter"} == 1))) > 0
for: 1m
labels:
severity: critical
Expand All @@ -85,7 +85,7 @@ spec:
severity_level: warning
storage_type: ceph
expr: |
(ocs_pool_mirroring_image_health{job="ocs-metrics-exporter"} * on (namespace) group_left() (max by(namespace) (ocs_pool_mirroring_status{job="ocs-metrics-exporter"}))) == 1
(ocs_pool_mirroring_image_health{job="ocs-metrics-exporter"} * on (namespace, managedBy) group_left() (max by(namespace, managedBy) (ocs_pool_mirroring_status{job="ocs-metrics-exporter"}))) == 1
for: 1m
labels:
mirroring_image_status: unknown
Expand All @@ -98,7 +98,7 @@ spec:
severity_level: warning
storage_type: ceph
expr: |
(ocs_pool_mirroring_image_health{job="ocs-metrics-exporter"} * on (namespace) group_left() (max by(namespace) (ocs_pool_mirroring_status{job="ocs-metrics-exporter"}))) == 2
(ocs_pool_mirroring_image_health{job="ocs-metrics-exporter"} * on (namespace, managedBy) group_left() (max by(namespace, managedBy) (ocs_pool_mirroring_status{job="ocs-metrics-exporter"}))) == 2
for: 1m
labels:
mirroring_image_status: warning
Expand All @@ -111,7 +111,7 @@ spec:
severity_level: error
storage_type: ceph
expr: |
(ocs_pool_mirroring_image_health{job="ocs-metrics-exporter"} * on (namespace) group_left() (max by(namespace) (ocs_pool_mirroring_status{job="ocs-metrics-exporter"}))) == 3
(ocs_pool_mirroring_image_health{job="ocs-metrics-exporter"} * on (namespace, managedBy) group_left() (max by(namespace, managedBy) (ocs_pool_mirroring_status{job="ocs-metrics-exporter"}))) == 3
for: 10s
labels:
mirroring_image_status: error
Expand All @@ -124,7 +124,7 @@ spec:
severity_level: error
storage_type: ceph
expr: |
ocs_rbd_mirror_image_state{job="ocs-metrics-exporter"} * on(image,pool_name) group_left(name,namespace) ocs_rbd_pv_metadata{job="ocs-metrics-exporter"} == 1
ocs_rbd_mirror_image_state{job="ocs-metrics-exporter"} * on(image,pool_name) group_left(name,namespace,managedBy) ocs_rbd_pv_metadata{job="ocs-metrics-exporter"} == 1
for: 1m
labels:
severity: critical
Expand All @@ -136,7 +136,7 @@ spec:
severity_level: warning
storage_type: ceph
expr: |
ocs_rbd_mirror_image_state{job="ocs-metrics-exporter"} * on(image,pool_name) group_left(name,namespace) ocs_rbd_pv_metadata{job="ocs-metrics-exporter"} == 0
ocs_rbd_mirror_image_state{job="ocs-metrics-exporter"} * on(image,pool_name) group_left(name,namespace,managedBy) ocs_rbd_pv_metadata{job="ocs-metrics-exporter"} == 0
for: 1m
labels:
severity: warning
Expand All @@ -150,7 +150,7 @@ spec:
severity_level: warning
storage_type: RGW
expr: |
(ocs_objectbucketclaim_info * on (namespace, objectbucket) group_left() (ocs_objectbucket_used_bytes/ocs_objectbucket_max_bytes)) > 0.80
(ocs_objectbucketclaim_info * on (namespace, objectbucket, managedBy) group_left() (ocs_objectbucket_used_bytes/ocs_objectbucket_max_bytes)) > 0.80
for: 10s
labels:
severity: warning
Expand All @@ -161,7 +161,7 @@ spec:
severity_level: warning
storage_type: RGW
expr: |
(ocs_objectbucketclaim_info * on (namespace, objectbucket) group_left() (ocs_objectbucket_objects_total/ocs_objectbucket_max_objects)) > 0.80
(ocs_objectbucketclaim_info * on (namespace, managedBy, objectbucket) group_left() (ocs_objectbucket_objects_total/ocs_objectbucket_max_objects)) > 0.80
for: 10s
labels:
severity: warning
Expand All @@ -172,7 +172,7 @@ spec:
severity_level: error
storage_type: RGW
expr: |
(ocs_objectbucketclaim_info * on (namespace, objectbucket) group_left() (ocs_objectbucket_used_bytes/ocs_objectbucket_max_bytes)) >= 1
(ocs_objectbucketclaim_info * on (namespace, managedBy, objectbucket) group_left() (ocs_objectbucket_used_bytes/ocs_objectbucket_max_bytes)) >= 1
for: 0s
labels:
severity: critical
Expand All @@ -183,7 +183,7 @@ spec:
severity_level: error
storage_type: RGW
expr: |
(ocs_objectbucketclaim_info * on (namespace, objectbucket) group_left() (ocs_objectbucket_objects_total/ocs_objectbucket_max_objects)) >= 1
(ocs_objectbucketclaim_info * on (namespace, managedBy, objectbucket) group_left() (ocs_objectbucket_objects_total/ocs_objectbucket_max_objects)) >= 1
for: 0s
labels:
severity: critical
Expand Down Expand Up @@ -216,7 +216,7 @@ spec:
)
and on(node) (
kube_pod_container_status_waiting_reason{reason="CreateContainerError"}
* on(pod, namespace) group_left(node)
* on(pod, namespace, managedBy) group_left(node)
kube_pod_info
) > 0
for: 10s
Expand Down
2 changes: 1 addition & 1 deletion metrics/mixin/alerts/blocklist.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
)
and on(node) (
kube_pod_container_status_waiting_reason{reason="CreateContainerError"}
* on(pod, namespace) group_left(node)
* on(pod, namespace, managedBy) group_left(node)
kube_pod_info
) > 0
||| % $._config,
Expand Down
12 changes: 6 additions & 6 deletions metrics/mixin/alerts/mirroring.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{
alert: 'OdfMirrorDaemonStatus',
expr: |||
((count by(namespace) (ocs_mirror_daemon_count{%(ocsExporterSelector)s} == 0)) * on(namespace) group_left() (count by(namespace) (ocs_pool_mirroring_status{%(ocsExporterSelector)s} == 1))) > 0
((count by(namespace, managedBy) (ocs_mirror_daemon_count{%(ocsExporterSelector)s} == 0)) * on(namespace, managedBy) group_left() (count by(namespace, managedBy) (ocs_pool_mirroring_status{%(ocsExporterSelector)s} == 1))) > 0
||| % $._config,
'for': $._config.odfMirrorDaemonStatusAlertTime,
labels: {
Expand All @@ -24,7 +24,7 @@
{
alert: 'OdfPoolMirroringImageHealth',
expr: |||
(ocs_pool_mirroring_image_health{%(ocsExporterSelector)s} * on (namespace) group_left() (max by(namespace) (ocs_pool_mirroring_status{%(ocsExporterSelector)s}))) == 1
(ocs_pool_mirroring_image_health{%(ocsExporterSelector)s} * on (namespace, managedBy) group_left() (max by(namespace, managedBy) (ocs_pool_mirroring_status{%(ocsExporterSelector)s}))) == 1
||| % $._config,
'for': $._config.odfPoolMirroringImageHealthWarningAlertTime,
labels: {
Expand All @@ -42,7 +42,7 @@
{
alert: 'OdfPoolMirroringImageHealth',
expr: |||
(ocs_pool_mirroring_image_health{%(ocsExporterSelector)s} * on (namespace) group_left() (max by(namespace) (ocs_pool_mirroring_status{%(ocsExporterSelector)s}))) == 2
(ocs_pool_mirroring_image_health{%(ocsExporterSelector)s} * on (namespace, managedBy) group_left() (max by(namespace, managedBy) (ocs_pool_mirroring_status{%(ocsExporterSelector)s}))) == 2
||| % $._config,
'for': $._config.odfPoolMirroringImageHealthWarningAlertTime,
labels: {
Expand All @@ -60,7 +60,7 @@
{
alert: 'OdfPoolMirroringImageHealth',
expr: |||
(ocs_pool_mirroring_image_health{%(ocsExporterSelector)s} * on (namespace) group_left() (max by(namespace) (ocs_pool_mirroring_status{%(ocsExporterSelector)s}))) == 3
(ocs_pool_mirroring_image_health{%(ocsExporterSelector)s} * on (namespace, managedBy) group_left() (max by(namespace, managedBy) (ocs_pool_mirroring_status{%(ocsExporterSelector)s}))) == 3
||| % $._config,
'for': $._config.odfPoolMirroringImageHealthCriticalAlertTime,
labels: {
Expand All @@ -78,7 +78,7 @@
{
alert: 'ODFPersistentVolumeMirrorStatus',
expr: |||
ocs_rbd_mirror_image_state{%(ocsExporterSelector)s} * on(image,pool_name) group_left(name,namespace) ocs_rbd_pv_metadata{%(ocsExporterSelector)s} == 1
ocs_rbd_mirror_image_state{%(ocsExporterSelector)s} * on(image,pool_name) group_left(name,namespace,managedBy) ocs_rbd_pv_metadata{%(ocsExporterSelector)s} == 1
||| % $._config,
'for': $._config.odfPoolMirroringImageHealthWarningAlertTime,
labels: {
Expand All @@ -95,7 +95,7 @@
{
alert: 'ODFPersistentVolumeMirrorStatus',
expr: |||
ocs_rbd_mirror_image_state{%(ocsExporterSelector)s} * on(image,pool_name) group_left(name,namespace) ocs_rbd_pv_metadata{%(ocsExporterSelector)s} == 0
ocs_rbd_mirror_image_state{%(ocsExporterSelector)s} * on(image,pool_name) group_left(name,namespace,managedBy) ocs_rbd_pv_metadata{%(ocsExporterSelector)s} == 0
||| % $._config,
'for': $._config.odfPoolMirroringImageHealthWarningAlertTime,
labels: {
Expand Down
8 changes: 4 additions & 4 deletions metrics/mixin/alerts/obc.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{
alert: 'ObcQuotaBytesAlert',
expr: |||
(ocs_objectbucketclaim_info * on (namespace, objectbucket) group_left() (ocs_objectbucket_used_bytes/ocs_objectbucket_max_bytes)) > 0.80
(ocs_objectbucketclaim_info * on (namespace, objectbucket, managedBy) group_left() (ocs_objectbucket_used_bytes/ocs_objectbucket_max_bytes)) > 0.80
||| % $._config,
'for': $._config.odfObcQuotaAlertTime,
labels: {
Expand All @@ -24,7 +24,7 @@
{
alert: 'ObcQuotaObjectsAlert',
expr: |||
(ocs_objectbucketclaim_info * on (namespace, objectbucket) group_left() (ocs_objectbucket_objects_total/ocs_objectbucket_max_objects)) > 0.80
(ocs_objectbucketclaim_info * on (namespace, managedBy, objectbucket) group_left() (ocs_objectbucket_objects_total/ocs_objectbucket_max_objects)) > 0.80
||| % $._config,
'for': $._config.odfObcQuotaAlertTime,
labels: {
Expand All @@ -40,7 +40,7 @@
{
alert: 'ObcQuotaBytesExhausedAlert',
expr: |||
(ocs_objectbucketclaim_info * on (namespace, objectbucket) group_left() (ocs_objectbucket_used_bytes/ocs_objectbucket_max_bytes)) >= 1
(ocs_objectbucketclaim_info * on (namespace, managedBy, objectbucket) group_left() (ocs_objectbucket_used_bytes/ocs_objectbucket_max_bytes)) >= 1
||| % $._config,
'for': $._config.odfObcQuotaCriticalAlertTime,
labels: {
Expand All @@ -56,7 +56,7 @@
{
alert: 'ObcQuotaObjectsExhausedAlert',
expr: |||
(ocs_objectbucketclaim_info * on (namespace, objectbucket) group_left() (ocs_objectbucket_objects_total/ocs_objectbucket_max_objects)) >= 1
(ocs_objectbucketclaim_info * on (namespace, managedBy, objectbucket) group_left() (ocs_objectbucket_objects_total/ocs_objectbucket_max_objects)) >= 1
||| % $._config,
'for': $._config.odfObcQuotaCriticalAlertTime,
labels: {
Expand Down

0 comments on commit 8f67291

Please sign in to comment.