Repository navigation
fix(cluster): let the low disk space alerts match WAL and tablespace PVCs - #1062
Open
abd-ulbasit wants to merge 1 commit into
Open
abd-ulbasit wants to merge 1 commit into
abd-ulbasit wants to merge 1 commit into
Conversation
…PVCs The podSelector passed to the PrometheusRule templates ends with "$". The low disk space rules append "-wal" and "-tbs.*" to it, so those matchers render as "<cluster>-([1-9][0-9]*)$-wal" and never match. A full WAL or tablespace volume does not raise CNPGClusterLowDiskSpaceWarning or CNPGClusterLowDiskSpaceCritical. Drop the "$". Prometheus anchors =~ matchers at both ends, so the other matchers built from podSelector (the pod matchers and the PGDATA PVC matchers) select the same series as before. Check the rendered WAL and tablespace matchers in the monitoring chainsaw test. Closes cloudnative-pg#966 Assisted-by: Claude Opus 5.5 Signed-off-by: abd-ulbasit <basit@basit.engineer>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #966
The PrometheusRule template builds
podSelectoras<fullname>-([1-9][0-9]*)$. The low disk space rules append-waland-tbs.*to it, so they render as:$only matches at the end of the value, so neither matcher can matchanything. A full WAL or tablespace volume raises neither
CNPGClusterLowDiskSpaceWarning nor CNPGClusterLowDiskSpaceCritical,
although the runbooks say both volumes are covered. This goes back to
the first version of the rules (#193).
The fix drops the
$. Prometheus anchors=~matchers at both endsanyway, so the other matchers built from
podSelector(thepod=~matchers and the PGDATA
persistentvolumeclaim=~matchers) select thesame series as before. In the rendered monitoring test, these matchers
are the only lines that change.
The monitoring chainsaw test now checks that both low disk space rules
render the
-waland-tbs.*matchers without the$.Testing:
the new assertions with
chainsaw assert -r(v0.2.15) against thehelm templateoutput. They pass with the fix. All four fail on main.PVC or a full tablespace PVC, both alerts fire with the fix and stay
silent on main. With no full PVC, nothing fires. Without the
$,CNPGClusterInstancesOnSameNode still ignores pooler and job pods on
the same node.
Disclosure: parts of this change and this description were written with
Claude Code (Claude Opus 5.5), as noted in the
Assisted-bycommittrailer.