✨ Allow overriding REST client latency histogram buckets - #3573
Conversation
|
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: wieghx The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Welcome @wieghx! |
|
Hi @wieghx. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Add RegisterRESTClientMetricsWithOptions so callers can supply classic Prometheus buckets for the opt-in REST client duration metrics without changing the Kubernetes-default 5ms+ buckets. Native histogram settings are unchanged. The first registration call wins so collectors are not replaced. Signed-off-by: wieghx <gudemail1991@gmail.com>
5f5cd86 to
65d8c00
Compare
|
CLA is signed ( Could an org member please add |
|
/ok-to-test |
What
Make classic histogram buckets for the opt-in REST client duration metrics overridable at registration time.
RegisterRESTClientMetricsis unchanged and still uses the Kubernetes-default buckets (starting at 5ms). Callers that scrape only classic buckets and need sub-5ms resolution can do:This applies to:
rest_client_request_duration_secondsrest_client_dns_resolution_duration_secondsrest_client_rate_limiter_duration_secondsNative histogram settings (
NativeHistogramBucketFactoretc.) are not changed. Size histograms are not changed. The firstRegisterRESTClientMetrics*call wins so already-registered collectors are not replaced.Why
Follow-up to #3510 / #3559. Fast controller hot-path PATCH/PUT latencies often sit in the 1–15ms range; with the default 5ms / 25ms buckets, p50/p90 on classic histograms is mostly quantization artifact. Changing the defaults would diverge from Kubernetes core, so this is opt-in only.
How to verify
go test ./pkg/metrics/ -count=1This PR was written in part with the assistance of generative AI.
Fixes #3559