feat: Export kubernetes client-go metrics #1578
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: <a href="https://github.com/kubernetes-csi/external-provisioner/pull/1578#" title="Author self-approved">AndrewSirenko</a>
Once this PR has been reviewed and has the lgtm label, please assign xing-yang for approval. For more information see the Code Review Process.
The full list of commands accepted by this bot can be found here.
<details open>
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
</details>
<!-- META={"approvers":["xing-yang"]} -->
This needs to be done in all sidecars and it's hard to keep them consistent. Would it make sense to move it to csi-lib-utils and plug it into e.g. github.com/kubernetes-csi/csi-lib-utils/metrics? Do all sidecars import it? Is there anyone who would not want client-go metrics?
(And you could move all other dummy imports there too...)
Works for me!
I'll prep PRs for:
1. csi-lib-utils change
2. csi-lib-utils release
3. sidecar refactorings
Thanks!
Done! Will refactor after https://github.com/kubernetes-csi/csi-lib-utils/pull/219 is merged.
lmk if you want me to help make csi-lib-utils release but we can also wait until closer to k8s 1.38 🤷
jsafrane
AndrewSirenko
What type of PR is this?
/kind feature
What this PR does / why we need it:
We've had some EKS customers throttled by our default
kube-qpsandkube-burstsidecar args. We realized sidecars weren't exporting the metrics that would help us see the impact of this throttle likerest_client_rate_limiter_duration_seconds.PR follows https://github.com/kubernetes-csi/external-provisioner/pull/579 to add a blank import of
k8s.io/component-base/metrics/prometheus/restclientso this sidecar registers and serves the client-go metrics in default legacy Prometheus registry.Testing (AI proof, logs here): https://gist.github.com/AndrewSirenko/512be4fc29e90e4237384f337da62713
controller.enableMetrics=true) on an EKS cluster./metricsendpoint and confirmed the fullrest_client_family is now emitted (rest_client_requests_total,rest_client_request_duration_seconds,rest_client_rate_limiter_duration_seconds, etc.)rest_client_was absent (0 series) whileworkqueue_was still present.Which issue(s) this PR fixes:
Fixes # N/A
Special notes for your reviewer:
One-line change in same vein as existing
_ "k8s.io/component-base/metrics/prometheus/clientgo/leaderelection"blank imports already present in this file. + Updated vendor deps.Does this PR introduce a user-facing change?:
``
release-note
``Serve client-go REST client metrics (rest_client_)