-
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
feat: enable customresource metrics by configuration #1710
Conversation
Welcome @iamnoah! |
Thanks @iamnoah, it is a really good practice! |
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.
Overall looks really interesting. Thanks for the contribution!
Is that linter error related to my changes in some way? |
I think it's an issue in golangci-lint: golangci/golangci-lint#2374. Seems to be happening with go 1.18. I can take a look today to see if we can get it quickly resolved. |
This PR should fix the CI issue: #1713 |
The CI should be fixed with #1713. Can you rebase your branch against main? |
576fa12
to
dc6f869
Compare
dadea8e
to
be1ab05
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.
I think this would be a great addition to KSM 👍
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.
Other than one last nit, I'm okay with merging this as it is. I think we should just announce it as an experimental feature in the changelog and keep an eye on incoming feedback.
@mrueg or @dgrisonnet any thoughts?
@iamnoah we're planning for a next release in the upcoming days, are you interested in getting your contribution into that one? If you want to get it in please rebase on latest master and help with the linting/unit tests. |
The main use case is just surfacing fields from custom resources without having to write a lot of code for each one.
Co-authored-by: Manuel Rüger <[email protected]>
is there a tool for this?
Co-authored-by: Manuel Rüger <[email protected]>
/lgtm |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fpetkovski, iamnoah, mrueg 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 |
Thanks for your contribution @iamnoah ! |
… strings in arguments The newly introduced `--custom-resource-state-config` argument (kubernetes/kube-state-metrics#1710) accepts a multi-line string as value. The deployment.yaml template currently loops over each .Values.extraArgs, which causes indentation issues when passing a multi-line string. This PR fixes that by rendering .Values.extraArgs as YAML with proper indentation. Signed-off-by: Mitch Hulscher <[email protected]>
… strings in arguments (#2167) The newly introduced `--custom-resource-state-config` argument (kubernetes/kube-state-metrics#1710) accepts a multi-line string as value. The deployment.yaml template currently loops over each .Values.extraArgs, which causes indentation issues when passing a multi-line string. This PR fixes that by rendering .Values.extraArgs as YAML with proper indentation. Signed-off-by: Mitch Hulscher <[email protected]>
… strings in arguments (prometheus-community#2167) The newly introduced `--custom-resource-state-config` argument (kubernetes/kube-state-metrics#1710) accepts a multi-line string as value. The deployment.yaml template currently loops over each .Values.extraArgs, which causes indentation issues when passing a multi-line string. This PR fixes that by rendering .Values.extraArgs as YAML with proper indentation. Signed-off-by: Mitch Hulscher <[email protected]>
… strings in arguments (#2167) The newly introduced `--custom-resource-state-config` argument (kubernetes/kube-state-metrics#1710) accepts a multi-line string as value. The deployment.yaml template currently loops over each .Values.extraArgs, which causes indentation issues when passing a multi-line string. This PR fixes that by rendering .Values.extraArgs as YAML with proper indentation. Signed-off-by: Mitch Hulscher <[email protected]>
What this PR does / why we need it:
Building off of the new
customresource.RegistryFactory
(thanks @Garrybest !), I found myself making a list of metrics I wanted on my custom resources and thought it made more sense to drive collection of those metrics from a config file than having to write pretty similar code for each one.I've put together some examples in the .md file, and the tests cover most of the ins and outs.
This is a pretty early rough draft that suits my needs, but I thought I would put it out there for feedback and see if it's useful.
How does this change affect the cardinality of KSM: (increases, decreases or does not change cardinality)
Users may add unlimited custom metrics, but the default cardinality remains unchanged.