Open ronaknnathani opened 1 week ago
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: ronaknnathani Once this PR has been reviewed and has the lgtm label, please assign rexagod for approval. For more information see the Kubernetes Code Review Process.
The full list of commands accepted by this bot can be found here.
This issue is currently awaiting triage.
If kube-state-metrics contributors determine 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.
Welcome @ronaknnathani!
It looks like this is your first PR to kubernetes/kube-state-metrics 🎉. 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/kube-state-metrics 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. :smiley:
@mrueg @CatherineF-dev - just checking if you got a chance to take a look. if this direction is okay, I can update the PR for rest of the resources or also send different PRs for different resources.
I don't think this is a good idea to add all labels to all metrics as the cardinality will go up by a lot. Instead you should join the _labels metric into the metric you want identified by the keys. Usually you can do this either per query you run or if you have a specific need use a recording rule.
/hold
What this PR does / why we need it: KSM allows providing a list of labels that should be added to the prometheus metric for the resource. These labels currently are only added to the
kube_<resource>_labels
metric. However, there are several use cases where having these labels on all of the metrics for the resource would be helpful. This change adds the allowed labels to all metrics of the resource instead of just the_labels
metric.How does this change affect the cardinality of KSM: (increases, decreases or does not change cardinality) Doesn't change the number of metrics. Increases the labels on each prometheus metric based on allowed labels.
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 https://github.com/kubernetes/kube-state-metrics/issues/2311
Tests Tested locally against a
kind
cluster. Just showing a handful of metrics here.