Skip to content

Fix: add namespace to PVC rules to avoid many-to-many joins#131

Closed
BenjaminBanwart wants to merge 1 commit intoopenebs:developfrom
BenjaminBanwart:fix/namespace-in-pvc-prom-rules
Closed

Fix: add namespace to PVC rules to avoid many-to-many joins#131
BenjaminBanwart wants to merge 1 commit intoopenebs:developfrom
BenjaminBanwart:fix/namespace-in-pvc-prom-rules

Conversation

@BenjaminBanwart
Copy link
Contributor

@BenjaminBanwart BenjaminBanwart commented May 20, 2025

This pull request updates the Prometheus alerting rules for detecting unconsumed Persistent Volume Claims (PVCs) to improve accuracy and maintain consistency across configurations.

This ensures that PVC's with the same labels in different namespaces will not cause duplication errors.

Changes to Prometheus alerting rules:

  • Updated the expr field in deploy/charts/rules/volume/volume-rules.json to use UNLESS ON (namespace, persistentvolumeclaim) with count by (namespace, persistentvolumeclaim) for better alignment with Prometheus query language best practices.
  • Made a similar update to the expr field in jsonnet/openebs-mixin/rules/volume/volume-rules.libsonnet to ensure consistency with the JSON configuration.

@BenjaminBanwart BenjaminBanwart requested review from a team as code owners May 20, 2025 16:54
@BenjaminBanwart
Copy link
Contributor Author

@BenjaminBanwart
Copy link
Contributor Author

Is there an estimate on a timeline for getting this into a release?

@abhilashshetty04
Copy link
Member

Hi, This should be along with OpenEBS v4.3

@abhilashshetty04
Copy link
Member

@BenjaminBanwart Can you please squash your commits.

Signed-off-by: Benji Banwart <70287143+BenjaminBanwart@users.noreply.github.com>

fix/ update expression in jsonnet dir

Signed-off-by: Benji Banwart <70287143+BenjaminBanwart@users.noreply.github.com>

fix/ implement count by() on the right side of the expression

The count by() returns one series per claim. This makes the join key unique on both sides.

Signed-off-by: Benji Banwart <70287143+BenjaminBanwart@users.noreply.github.com>

fix/ simplify and fix the expression here

introduce count by() to allow for unique join keys

Signed-off-by: Benji Banwart <70287143+BenjaminBanwart@users.noreply.github.com>

fix: add namespace to PVC joins

Avoid many-to-many errors when the same PVC name exists in multiple namespaces by joining on namespace.
@BenjaminBanwart BenjaminBanwart force-pushed the fix/namespace-in-pvc-prom-rules branch from 83d37aa to d73936e Compare May 29, 2025 14:33
@abhilashshetty04
Copy link
Member

Cherry-picked: #132
Thanks @BenjaminBanwart for your contribution.

@BenjaminBanwart
Copy link
Contributor Author

@abhilashshetty04 No problem, thanks for getting this in!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants