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

add ContainerResourceSourceType for hpa metrics #1831

Merged
merged 1 commit into from
Nov 3, 2022

Conversation

whitebear009
Copy link
Contributor

@whitebear009 whitebear009 commented Sep 13, 2022

What this PR does / why we need it:
kubernetes hpa support ContainerResourceSourceType(https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#container-resource-metrics) since v1.20, but there is no metrics about it in the kube-state-metrics.
The PR add ContainerResourceSourceType for hpa metrics kube_horizontalpodautoscaler_spec_target_metric and kube_horizontalpodautoscaler_status_target_metric.
Then decrease cyclomatic complexity by reusing metricTarget objects, so as to pass golint-ci.

How does this change affect the cardinality of KSM: (increases, decreases or does not change cardinality)
Increases cardinality. Add metrics for ContainerResourceSourceType hpa.

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 #

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Sep 13, 2022
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 13, 2022
@whitebear009 whitebear009 force-pushed the hpa branch 2 times, most recently from 9e50da3 to 633ba5c Compare September 13, 2022 09:55
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 13, 2022
@whitebear009
Copy link
Contributor Author

/assign @mrueg
Please take a look. Thanks :)

@whitebear009 whitebear009 requested review from dgrisonnet and removed request for mrueg and fpetkovski September 27, 2022 08:44
@dgrisonnet
Copy link
Member

@whitebear009 my previous comments are still unresolved, could you have a look at them?

@whitebear009
Copy link
Contributor Author

@dgrisonnet My reply was not sent before, sorry. please check again

@dgrisonnet
Copy link
Member

/lgtm
/approve

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dgrisonnet, whitebear009

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 Nov 3, 2022
@k8s-ci-robot k8s-ci-robot merged commit 086a6fd into kubernetes:master Nov 3, 2022
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. 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