Skip to content

Commit ab42c9c

Browse files
committed
[cluster]: don't fire HA alerts on replica clusters
1 parent d1b5ad6 commit ab42c9c

6 files changed

Lines changed: 16 additions & 2 deletions

File tree

charts/cluster/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ description: Deploys and manages a CloudNativePG cluster and its associated reso
2222
kubeVersion: ">=1.29.0-0"
2323
icon: https://raw.githubusercontent.com/cloudnative-pg/artwork/main/cloudnativepg-logo.svg
2424
type: application
25-
version: 0.7.0
25+
version: 0.7.1
2626
sources:
2727
- https://github.com/cloudnative-pg/charts
2828
keywords:

charts/cluster/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# cluster
22

3-
![Version: 0.7.0](https://img.shields.io/badge/Version-0.7.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
3+
![Version: 0.7.1](https://img.shields.io/badge/Version-0.7.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
44

55
> **Warning**
66
> ### This chart is under active development.

charts/cluster/docs/runbooks/CNPGClusterHACritical.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ instances. The replaced instance may need some time to catch-up with the cluster
1212
This alarm will be always triggered if your cluster is configured to run with only 1 instance. In this case you
1313
may want to silence it.
1414

15+
This alert does not fire for replica clusters. On a replica cluster the designated primary runs a WAL receiver
16+
(streaming from the source cluster), which lowers the computed standby count by one. The rule is gated on
17+
`cnpg_collector_replica_mode == 0`, which yields an empty result on replica clusters, so the alert only fires on
18+
primary clusters.
19+
1520
Impact
1621
------
1722

charts/cluster/docs/runbooks/CNPGClusterHAWarning.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ The `CNPGClusterHAWarning` alert is triggered when the CloudNativePG cluster rea
99
This alarm will be always triggered if your cluster is configured to run with less than `3` instances. In this case you
1010
may want to silence it.
1111

12+
This alert does not fire for replica clusters. On a replica cluster the designated primary runs a WAL receiver
13+
(streaming from the source cluster), which lowers the computed standby count by one and would otherwise fire this alert
14+
permanently. The rule is gated on `cnpg_collector_replica_mode == 0`, which yields an empty result on replica clusters,
15+
so the alert only fires on primary clusters.
16+
1217
Impact
1318
------
1419

charts/cluster/prometheus_rules/cluster-ha-critical.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ annotations:
1818
runbook_url: https://github.com/cloudnative-pg/charts/blob/main/charts/cluster/docs/runbooks/CNPGClusterHACritical.md
1919
expr: |
2020
max by (job) (cnpg_pg_replication_streaming_replicas{namespace="{{ .namespace }}"} - cnpg_pg_replication_is_wal_receiver_up{namespace="{{ .namespace }}"}) < 1
21+
and on (job)
22+
(max by (job) (cnpg_collector_replica_mode{namespace="{{ .namespace }}"}) == 0)
2123
for: 5m
2224
labels:
2325
severity: critical

charts/cluster/prometheus_rules/cluster-ha-warning.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ annotations:
1616
runbook_url: https://github.com/cloudnative-pg/charts/blob/main/charts/cluster/docs/runbooks/CNPGClusterHAWarning.md
1717
expr: |
1818
max by (job) (cnpg_pg_replication_streaming_replicas{namespace="{{ .namespace }}"} - cnpg_pg_replication_is_wal_receiver_up{namespace="{{ .namespace }}"}) < 2
19+
and on (job)
20+
(max by (job) (cnpg_collector_replica_mode{namespace="{{ .namespace }}"}) == 0)
1921
for: 5m
2022
labels:
2123
severity: warning

0 commit comments

Comments
 (0)