Skip to content

Conversation

yalosev
Copy link
Contributor

@yalosev yalosev commented Jun 19, 2025

What type of PR is this?

/kind bug

What this PR does / why we need it:

The in-place metric constructors in the vpa-updater used an incorrect GaugeVec during initialization, which caused the metrics not to be exported.

If you check them using the curl command, you will notice that the metrics are missing:

$ curl -s http://127.0.0.1:8943/metrics | grep in_place
$ echo $?
1

$ curl -s http://127.0.0.1:8943/metrics | grep in_place | wc -l
0

After the patch, this command will return the result:

$ curl -s http://127.0.0.1:8943/metrics  | grep in_place
# HELP vpa_updater_in_place_Updatable_pods_total Number of Pods matching in place update criteria.
# TYPE vpa_updater_in_place_Updatable_pods_total gauge
vpa_updater_in_place_Updatable_pods_total{vpa_size_log2="0"} 0
vpa_updater_in_place_Updatable_pods_total{vpa_size_log2="1"} 0
vpa_updater_in_place_Updatable_pods_total{vpa_size_log2="10"} 0
vpa_updater_in_place_Updatable_pods_total{vpa_size_log2="11"} 0
vpa_updater_in_place_Updatable_pods_total{vpa_size_log2="12"} 0
...

$ curl -s http://127.0.0.1:8943/metrics  | grep in_place | wc -l
66

The patch also fixes some misspellings.

Which issue(s) this PR fixes:

Fixes N/A

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jun 19, 2025
@k8s-ci-robot
Copy link
Contributor

Welcome @yalosev!

It looks like this is your first PR to kubernetes/autoscaler 🎉. 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/autoscaler 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 needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 19, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @yalosev. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added area/vertical-pod-autoscaler size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jun 19, 2025
@yalosev yalosev changed the title Fix(VPA): in-place metrics initialization Fix(VPA): updater in-place metrics initialization Jun 19, 2025
@adrianmoisey
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 20, 2025
@adrianmoisey
Copy link
Member

/lgtm
/approve
/cherry-pick vpa-release-1.3

@k8s-infra-cherrypick-robot

@adrianmoisey: once the present PR merges, I will cherry-pick it on top of vpa-release-1.3 in a new PR and assign it to you.

In response to this:

/lgtm
/approve
/cherry-pick vpa-release-1.3

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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 20, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: adrianmoisey, yalosev

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

The pull request process is described 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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 20, 2025
@k8s-ci-robot k8s-ci-robot merged commit ee360d4 into kubernetes:master Jun 20, 2025
6 of 7 checks passed
@k8s-infra-cherrypick-robot

@adrianmoisey: #8253 failed to apply on top of branch "vpa-release-1.3":

Applying: Fix vpa in-place metrics
Using index info to reconstruct a base tree...
M	vertical-pod-autoscaler/pkg/updater/logic/updater.go
M	vertical-pod-autoscaler/pkg/utils/metrics/updater/updater.go
Falling back to patching base and 3-way merge...
Auto-merging vertical-pod-autoscaler/pkg/utils/metrics/updater/updater.go
CONFLICT (content): Merge conflict in vertical-pod-autoscaler/pkg/utils/metrics/updater/updater.go
Auto-merging vertical-pod-autoscaler/pkg/updater/logic/updater.go
CONFLICT (content): Merge conflict in vertical-pod-autoscaler/pkg/updater/logic/updater.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0001 Fix vpa in-place metrics

In response to this:

/lgtm
/approve
/cherry-pick vpa-release-1.3

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-sigs/prow repository.

@adrianmoisey
Copy link
Member

Oh my bad, I thought that in-place was in 1.3, but it isn't. That cherry pick is fine to fail, I shouldn't have cherry picked it.

@yalosev yalosev deleted the fix/vpa-in-place-metrics branch June 20, 2025 07:33
@adrianmoisey
Copy link
Member

🤦
It should be in 1.4
/cherry-pick vpa-release-1.4

@k8s-infra-cherrypick-robot

@adrianmoisey: new pull request created: #8255

In response to this:

🤦
It should be in 1.4
/cherry-pick vpa-release-1.4

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-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/vertical-pod-autoscaler cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants