Skip to content

Move the RegisterScaleUp metric calls to NodeGroupChangeMetricsProducer.#9667

Open
shaikenov wants to merge 2 commits into
kubernetes:masterfrom
shaikenov:shaikenov-move-register-scaleup-metric
Open

Move the RegisterScaleUp metric calls to NodeGroupChangeMetricsProducer.#9667
shaikenov wants to merge 2 commits into
kubernetes:masterfrom
shaikenov:shaikenov-move-register-scaleup-metric

Conversation

@shaikenov

@shaikenov shaikenov commented May 19, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

This is a follow up of #9136. In this PR I retrieved the scaled_up_nodes_total metrics generation in NodeGroupChangeMetricsProducer. I also evaluated the possibility of moving scaled_down_nodes_total, but it requires a bit more work for which I have no capacity right now. It might be prioritized further down the line.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

During the implementation I figured out that we do not have a single test which covers the RegisterScaleUp metric emission. So I decided to have two commits here:

  1. Introduced unit tests which will check that the metric calls did actually happen (apparently we had only one place in scaleUpExecutor). Ensure that the metric is correctly called in there.
  2. Moved the metric generation into NodeGroupChangeMetricsProducer and adjusted a little bit the test to the new implementation - double checked it by checking that tests from point 1 are still passing.
    That is the reason that you will see some lines introduced in commit 1 getting deleted in commit 2.

Also since now metric is emitted from a single place -NodeGroupChangeMetricsProducer - there is no need to pass nodeInfos around as we already have a logic for gpu and dra info retrieval in the NodeGroupChangeMetricsProducer

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 release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels May 19, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

This issue is currently awaiting triage.

If SIG Autoscaling contributors determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Details

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 needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label May 19, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: shaikenov
Once this PR has been reviewed and has the lgtm label, please assign x13n for approval. For more information see the Code Review Process.

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

Details 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 do-not-merge/needs-area Indicates that a PR should not merge because it lacks an area label. area/cluster-autoscaler Issues or PRs related to the Cluster Autoscaler component needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 19, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

Hi @shaikenov. 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.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

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.

Details

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 size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed do-not-merge/needs-area Indicates that a PR should not merge because it lacks an area label. labels May 19, 2026
@shaikenov

Copy link
Copy Markdown
Contributor Author

Hi @elmiko, @jackfrancis, I am working towards applying for the K8s membership and I would like to ask for a review from some folks outside Google. Would you be able to take a look at this PR?
Thanks!

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 27, 2026
@shaikenov shaikenov force-pushed the shaikenov-move-register-scaleup-metric branch from 534f1a8 to 3ee5f27 Compare June 17, 2026 16:23
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 17, 2026
@shaikenov shaikenov force-pushed the shaikenov-move-register-scaleup-metric branch from 3ee5f27 to 85857f8 Compare June 18, 2026 07:35
@shaikenov

Copy link
Copy Markdown
Contributor Author

Hi @elmiko, @jackfrancis, I am working towards applying for the K8s membership and I would like to ask for a review from some folks outside Google. Would you be open to take a look at this PR?
Thanks!

@elmiko elmiko left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nice refactor

/lgtm

@kubernetes-prow kubernetes-prow Bot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 23, 2026
@shaikenov shaikenov force-pushed the shaikenov-move-register-scaleup-metric branch from 85857f8 to 0b6d02c Compare July 7, 2026 08:06
@kubernetes-prow kubernetes-prow Bot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 7, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: shaikenov
Once this PR has been reviewed and has the lgtm label, please assign x13n for approval. For more information see the Code Review Process.

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

Details 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

@shaikenov

Copy link
Copy Markdown
Contributor Author

The e2e test was fixed in master, so it is passing now after rebasing.

@elmiko, thanks for the review! it looks like the lgtm label was removed because of the rebase :(

Also would you be open for sponsoring my k8s membership?

Thanks!

@elmiko elmiko left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

/lgtm

happy to help sponsor @shaikenov =)

@kubernetes-prow kubernetes-prow Bot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/cluster-autoscaler Issues or PRs related to the Cluster Autoscaler component cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants