-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Conversation
9e50da3
to
633ba5c
Compare
/assign @mrueg |
@whitebear009 my previous comments are still unresolved, could you have a look at them? |
@dgrisonnet My reply was not sent before, sorry. please check again |
/lgtm |
[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 |
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 #