Skip to content

Commit

Permalink
Avoid many-to-many join by collapsing records by claim using max-by
Browse files Browse the repository at this point in the history
Signed-off-by: Phillip Schichtel <[email protected]>
  • Loading branch information
pschichtel committed Dec 14, 2024
1 parent bf1f5e6 commit 0385d05
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion deploy/charts/rules/volume/volume-rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"description": "Persistent Volume Claim '{{ $labels.persistentvolumeclaim }}' has no consumer",
"summary": "Persistent Volume Claim '{{ $labels.persistentvolumeclaim }}' in namespace '{{ $labels.namespace }}' is not consumed by any pod in any namespace"
},
"expr": "kube_persistentvolumeclaim_info unless (kube_persistentvolumeclaim_info * on(persistentvolumeclaim) group_left kube_pod_spec_volumes_persistentvolumeclaims_info) == 1",
"expr": "kube_persistentvolumeclaim_info unless (kube_persistentvolumeclaim_info * on(persistentvolumeclaim) group_left (max by (persistentvolumeclaim) (kube_pod_spec_volumes_persistentvolumeclaims_info)))) == 1",
"for": "5m",
"labels": {
"severity": "info"
Expand Down

0 comments on commit 0385d05

Please sign in to comment.