-
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 DeprecatedVersion to struct FamilyGenerator and func NewFamilyGenerator #1160
Add DeprecatedVersion to struct FamilyGenerator and func NewFamilyGenerator #1160
Conversation
I like this a lot! Similar to the metrics stability framework, could you add that the description is prefixed with the deprecated version? |
@brancz Thank you for your comments. Sorry I don't understand what you say. You mean DeprecatedVersion will be set like "DeprecatedVersion: 1.19"? It would be written as just "1.19". I'm sorry if I misunderstand what you say. |
In Kubernetes, when a metric is deprecated, it will say in the help text for example:
I would like that we also do this in kube-state-metrics. |
@brancz Thanks, I understand. In kubernetes, in case of kube-scheduler, the string "Deprecated since x.xx.x" in #HELP is written manually like https://github.com/kubernetes/kubernetes/pull/92160/files (This is my PR, approved but not merged yet😅) |
In kubernetes/kubernetes a metric is annotated with it's deprecated version (if it's deprecated), and since which version. https://github.com/kubernetes/component-base/blob/d18546f5347cab6a8690e9b863d9ab977f771079/metrics/desc.go#L196 |
@brancz oh, I didn't know it. Thank you for the advice. I will try to fix this PR. |
a90fbaf
to
bd621b3
Compare
I've added new func NewFamilyGenerator also. If it looks good, I will fix all callers of FamilyGenerator to use NewFamilyGenerator. Thanks. |
bd621b3
to
5ffb6f1
Compare
The strategy looks good, but there are some failures that need fixing. |
5ffb6f1
to
e4649ed
Compare
Seems like the failures is:
|
e4649ed
to
15eca9d
Compare
fbafca9
to
f495176
Compare
f495176
to
10a67db
Compare
10a67db
to
23bff34
Compare
23bff34
to
ee7f34d
Compare
ee7f34d
to
dd1de68
Compare
1125649
to
bbe7a25
Compare
bbe7a25
to
4919742
Compare
/lgtm Leaving approval up to @tariq1890 or @lilic |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: brancz, YuikoTakada 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 |
sorry I didn't realize that it would also automatically approve the PR. @tariq1890 @lilic please feel free to comment anyways! :) |
What this PR does / why we need it:
Currently, in kube-state-metrics, deprecated metrics is managed just in document. And also there are many docs about metrics(node-metrics.md, pod-metrics.md, ...)
This PR adds a new field "DeprecatedVersion" to struct FamilyGenerator and new func "NewFamilyGenerator" which generate struct FamilyGenerator. In NewFamilyGenerator, if the metrics is deprecated, "(Deprecated since x.x)" will be added at the begining of help string. It makes easier to manage deprecated metrics.
Also see:
https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/component-base/metrics/opts.go#L198
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 #