-
Notifications
You must be signed in to change notification settings - Fork 2.2k
feat: Add access mode metric for PersistentVolumes #2823
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: Add access mode metric for PersistentVolumes #2823
Conversation
|
|
|
Welcome @viragvoros! |
2b6ab10 to
17c531d
Compare
|
/assign |
Expose a kube_persistentvolume_access_mode metric that mirrors the existing PVC access mode metric. This allows consumers to filter and aggregate PersistentVolumes by access mode directly, without having to scrape kube_persistentvolumeclaim_access_mode. Using a small set of access-mode labels keeps cardinality low while still allowing PV metrics to be sliced by access mode. Signed-off-by: vvoeroes <[email protected]>
17c531d to
d01f7e8
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: viragvoros The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
I wonder if it's worth adding a new metric here or enhancing kube_persistentvolume_volume_mode instead? |
|
I considered merging There is also a cardinality consideration for metric consumers. If only a combined Users who need both dimensions can still correlate them via PV labels. |
What this PR does / why we need it:
This PR adds a
kube_persistentvolume_access_modemetric that exposes the access modes ofPersistentVolumeobjects, in a way that mirrors the existing PVC access mode metric.At the moment, if we want to filter or aggregate PersistentVolumes by access mode (e.g.
ReadWriteOnce,ReadWriteMany,ReadOnlyMany), we have to rely onkube_persistentvolumeclaim_access_modeand join throughPVC metrics. That forces us to scrape the PVC access mode metrics even when we only care about PVs, and increases metric cardinality.
By exposing a dedicated PV access mode metric with a small label set, we can:
otherwise needed,
while still keeping metric cardinality low.
Details of the change
kube_persistentvolume_access_modemetric in the PV store:access_modelabel uses the standard Kubernetes accessmodes (
ReadWriteOnce,ReadOnlyMany,ReadWriteMany, etc.)internal/store/persistentvolume_test.goHow does this change affect the cardinality of KSM:
Previously, dashboards and alerts that needed PV access mode information had to join against PVC access mode metrics and therefore scrape
kube_persistentvolumeclaim_access_mode, which may have higher cardinality in large clusters.With
kube_persistentvolume_access_mode, users can query PV access modes directly from the PV metrics.