-
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
docs: updated VPA CustomResourceStateMetrics docs #2193
docs: updated VPA CustomResourceStateMetrics docs #2193
Conversation
Welcome @sherifkayad! |
6bdf818
to
f34ba86
Compare
@@ -272,19 +267,51 @@ spec: | |||
target_kind: [spec, targetRef, kind] | |||
target_name: [spec, targetRef, name] | |||
metrics: | |||
- name: "annotations" | |||
help: "Kubernetes annotations converted to Prometheus labels." | |||
- name: "vpa_containerrecommendations_target" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest to follow the previous VPA metrics naming format "verticalpodautoscaler_status_recommendation_containerrecommendations_target_cpu". Append resource (cpu/memory) at the end of metrics name due to this is changed to be customized metrics name, we can't have duplicate metrics name at line 270 and line 282 which both are "vpa_containerrecommendations_target".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chihshenghuang I slightly disagree due to two reasons:
- The name of the metric will be super long as there is already a prefix appended automatically by the custom resource (check the doc further for the full name)
- The previous implemention had already the same metric with different labels / selectors for CPU / Memory and I think that to make it close to the original implementation (prior to v2.9.0), it should be like that.
Remember this is just an example and people can freely choose what to do / how to name the metric. I can suggest adding a line or two in the docs that this is also possible of course.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using the same metric name both for cpu and memory will result in two HELP messages for the same type (ie # HELP kube_customresource_vpa_containerrecommendations_target VPA container recommendations for memory
and # HELP kube_customresource_vpa_containerrecommendations_target VPA container recommendations for cpu
). As a result, client (for example telegraf) fails to fetch metrics with Error in plugin: error reading metrics for http://kube-state-metrics.kube-system.svc.cluster.local:8080/metrics: reading text format failed: text format parsing error in line 11485: second HELP line for metric name "kube_customresource_vpa_containerrecommendations_target"
.
So +1 for appending resource at the end (ie - name: "vpa_containerrecommendations_target_cpu"
).
And if we do this, probably commonLabels
can be removed
/assign @dgrisonnet |
f34ba86
to
9fb3bae
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: sherifkayad 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 |
Fixed MD linting issues /test all |
@sherifkayad: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
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. |
@dashpole @dgrisonnet can you please re-trigger the testing pipeline again? |
/ok-to-test |
Signed-off-by: Sherif Ayad <sherif.k.ayad@gmail.com>
9fb3bae
to
14a4ad7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks ok now
Can you please re-trigger the tests? |
I’m not sure I’m able to do that :) |
@CatherineF-dev seems like we need re-trigger tests again, the doc was updated |
/ok-to-test |
guys, let's move on to have this merged! This would save so much time for me (was lucky enough to bump into this PR after spending some time trying to figure out the correct config) and maybe for other folks when it's merged. |
Would be really good to get this one merged soon |
The above configuration was tested on [this](https://github.com/kubernetes/autoscaler/blob/master/vertical-pod-autoscaler/examples/hamster.yaml) VPA configuration, outputting the following metrics: | ||
|
||
``` | ||
# HELP kube_customresource_vpa_containerrecommendations_target VPA container recommendations for memory. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you can see here, this will generate two different help outputs for the same title. This should either be postfixed with _cpu / _memory (if you want two help outputs) or
# HELP kube_customresource_vpa_containerrecommendations_target VPA container recommendations for memory. | |
# HELP kube_customresource_vpa_containerrecommendations_target VPA container recommendations for CPU and memory. |
- verbs: | ||
- list | ||
- watch | ||
apiGroups: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usually permissions are set per apigroup/resource Otherwise you would give permission to an (unlikely, but possible) customresourcedefinitions.autoscaling.k8s.io or verticalpodautoscalers.apiextensions.k8s.io which you did not intend to provide.
@@ -272,19 +267,51 @@ spec: | |||
target_kind: [spec, targetRef, kind] | |||
target_name: [spec, targetRef, name] | |||
metrics: | |||
- name: "annotations" | |||
help: "Kubernetes annotations converted to Prometheus labels." | |||
- name: "vpa_containerrecommendations_target" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using the same metric name both for cpu and memory will result in two HELP messages for the same type (ie # HELP kube_customresource_vpa_containerrecommendations_target VPA container recommendations for memory
and # HELP kube_customresource_vpa_containerrecommendations_target VPA container recommendations for cpu
). As a result, client (for example telegraf) fails to fetch metrics with Error in plugin: error reading metrics for http://kube-state-metrics.kube-system.svc.cluster.local:8080/metrics: reading text format failed: text format parsing error in line 11485: second HELP line for metric name "kube_customresource_vpa_containerrecommendations_target"
.
So +1 for appending resource at the end (ie - name: "vpa_containerrecommendations_target_cpu"
).
And if we do this, probably commonLabels
can be removed
The above configuration was tested on [this](https://github.com/kubernetes/autoscaler/blob/master/vertical-pod-autoscaler/examples/hamster.yaml) VPA configuration, outputting the following metrics: | ||
|
||
``` | ||
# HELP kube_customresource_vpa_containerrecommendations_target VPA container recommendations for memory. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# TYPE kube_customresource_vpa_containerrecommendations_target gauge
line is missing in the output
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
I am not really sure what needs to be done to merge this one. Has been open for a very long time and I would love to see it closed. |
indeed would be great to have this merged, so it's much easier to find correct documentation |
The Kubernetes project currently lacks enough active contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close |
@k8s-triage-robot: Closed this PR. In response to this:
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. |
/reopen |
@korjek: You can't reopen an issue/PR unless you authored it or you are a collaborator. In response to this:
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. |
What this PR does / why we need it:
docs PR to address #2041
How does this change affect the cardinality of KSM: (increases, decreases or does not change cardinality)
N.A. .. Just a docs PR
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 #2041