Skip to content
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

fix: adjust "volume name" label for kube_persistentvolumeclaim_* #2303

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

multani
Copy link

@multani multani commented Jan 13, 2024

What this PR does / why we need it:

This changes the name of the volume name label, reported by the kube_persistentvolumeclaim_* metrics, to be the same label as the one in the kube_persistentvolume_* metrics.

This makes it easier to combine the 2 related set of metrics together to being labels and values from one metric into another.

How does this change affect the cardinality of KSM: (increases, decreases or does not change cardinality)

Does not change cardinality

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):

Fixes #2288

@k8s-ci-robot k8s-ci-robot added do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jan 13, 2024
@k8s-ci-robot
Copy link
Contributor

Welcome @multani!

It looks like this is your first PR to kubernetes/kube-state-metrics 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/kube-state-metrics has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jan 13, 2024
@multani multani changed the title Adjust "volume name" label for kube_persistentvolumeclaim_* fix: adjust "volume name" label for kube_persistentvolumeclaim_* Jan 13, 2024
@multani multani force-pushed the fix-2288 branch 3 times, most recently from 2aa4fba to 1c67ed2 Compare January 13, 2024 18:26
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label Jan 13, 2024
@multani
Copy link
Author

multani commented Jan 13, 2024

Sorry for the noise, I was trying to understand what was the problem with the commit message 🤦

Should be good now :)

@CatherineF-dev
Copy link
Contributor

CatherineF-dev commented Jan 13, 2024

Also update https://github.com/kubernetes/kube-state-metrics/blob/main/CHANGELOG.md

Next:

@multani
Copy link
Author

multani commented Jan 13, 2024

@@ -4,7 +4,7 @@
| ---------------------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------ |
| kube_persistentvolumeclaim_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](./cli-arguments.md) | | `persistentvolumeclaim`=&lt;persistentvolumeclaim-name&gt; <br> `namespace`=&lt;persistentvolumeclaim-namespace&gt; <br> `annotation_PERSISTENTVOLUMECLAIM_ANNOTATION`=&lt;PERSISTENTVOLUMECLAIM_ANNOATION&gt; | EXPERIMENTAL |
| kube_persistentvolumeclaim_access_mode | Gauge | | | `access_mode`=&lt;persistentvolumeclaim-access-mode&gt; <br>`namespace`=&lt;persistentvolumeclaim-namespace&gt; <br> `persistentvolumeclaim`=&lt;persistentvolumeclaim-name&gt; | STABLE |
| kube_persistentvolumeclaim_info | Gauge | | | `namespace`=&lt;persistentvolumeclaim-namespace&gt; <br> `persistentvolumeclaim`=&lt;persistentvolumeclaim-name&gt; <br> `storageclass`=&lt;persistentvolumeclaim-storageclassname&gt;<br>`volumename`=&lt;volumename&gt;<br>`volumemode`=&lt;volumemode&gt; | STABLE |
| kube_persistentvolumeclaim_info | Gauge | | | `namespace`=&lt;persistentvolumeclaim-namespace&gt; <br> `persistentvolumeclaim`=&lt;persistentvolumeclaim-name&gt; <br> `storageclass`=&lt;persistentvolumeclaim-storageclassname&gt;<br>`persistentvolume`=&lt;volumename&gt;<br>`volumemode`=&lt;volumemode&gt; | STABLE |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This metric is STABLE, so can't change label name.

Copy link
Author

@multani multani Jan 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@CatherineF-dev what is the recommended approach here then?

I understand I can't change volumename and I will revert it.

Should I keep this label and add a new persistentvolume label (with the same value as volumename) instead?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tried updating your promQL to support join on different label names?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned in the parent issue, AFAIK it's difficult to join metrics on different label names.

We are already relabelling the kube_persistentvolumeclaim_annotations metric to "fix" the label, but my hope with this pull request would be to bring this change upstream.

Is there a simpler way to join on different label names that would not require this change? (this discussion belongs more in the parent issue perhaps...)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@CatherineF-dev is there any other options to move this change forward?

@dgrisonnet
Copy link
Member

/triage accepted
/assign @CatherineF-dev @dgrisonnet

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jan 25, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: multani
Once this PR has been reviewed and has the lgtm label, please ask for approval from dgrisonnet. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@mrueg
Copy link
Member

mrueg commented Jan 26, 2024

Also update https://github.com/kubernetes/kube-state-metrics/blob/main/CHANGELOG.md

Next:

Has anything changed in the release process I'm not aware of? We usually do not update the changelog within the PR.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 14, 2024
This changes the name of the volume name label, reported by the
`kube_persistentvolumeclaim_*` metrics, to be the same label as the one
in the `kube_persistentvolume_*` metrics.

This makes it easier to combine the 2 related set of metrics together to
being labels and values from one metric into another.
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 15, 2024
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 3, 2024
@k8s-ci-robot
Copy link
Contributor

PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

kube_persistentvolume_* and kube_persistentvolumeclaim_* should expose the volume name under the same label
5 participants