-
Notifications
You must be signed in to change notification settings - Fork 2.1k
feat: Add info metric for client-go version #2739
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
base: main
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: fpetkovski 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 |
KSM supports a range of Kubernetes versions which makes it important to keep up with new versions as clusters upgrade. In order to allow for alerting on unsupported cluster versions, this commit adds an info metric for the client-go version used by KSM. This way users can set up alerts if the cluster in which KSM is running is outside of the supported range. Signed-off-by: fpetkovski <[email protected]>
a07e79f
to
66373c2
Compare
|
||
clientGoVersion := promauto.With(ksmMetricsRegistry).NewGaugeVec( | ||
prometheus.GaugeOpts{ | ||
Name: "kube_state_metrics_client_go_info", |
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 wonder if we can make this part of the kube_state_metrics_build_info metrics, but then on the other hand we don't have that many metrics in this metric path.
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.
Adding the label to kube_state_metrics_build_info
makes sense. Does this metric exist though? I wasn't able to find it on port 8081.
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.
prometheus/client_golang#1860 PR is here to add support.
clientGoVersion := promauto.With(ksmMetricsRegistry).NewGaugeVec( | ||
prometheus.GaugeOpts{ | ||
Name: "kube_state_metrics_client_go_info", | ||
Help: "An info metric for the client-go version used by kube-state-metrics", |
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.
Can we mark it as experimental?
Dropping this from the v2.17 milestone, I would prefer to have it in the build_info metric via the client_golang patch. |
@fpetkovski prometheus/client_golang#1860 got merged. Do you want to update the client_golang dep to point at a commit on main and make the change here? |
/triage accepted |
What this PR does / why we need it:
KSM supports a range of Kubernetes versions which makes it important to keep up with new versions as clusters upgrade.
In order to allow for alerting on unsupported cluster versions, this commit adds an info metric for the client-go version used by KSM. This way users can set up alerts if the cluster in which KSM is running is outside of the supported range.
Alternatively, we can directly add expose the supported min and max versions as metrics instead of having users calculate the values themselves.
How does this change affect the cardinality of KSM: (increases, decreases or does not change cardinality)
Cardinality is unchanged
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 #