-
Notifications
You must be signed in to change notification settings - Fork 300
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
make local metrics configurable #4337
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: KPostOffice 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 |
Hi @KPostOffice. 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 Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions 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. |
✅ Deploy Preview for kubernetes-sigs-kueue canceled.
|
/ok-to-test |
cmd/kueue/main.go
Outdated
@@ -162,6 +162,14 @@ func main() { | |||
kubeConfig.UserAgent = useragent.Default() | |||
} | |||
|
|||
if cfg.Metrics.LocalQueueMetrics != nil { |
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.
Since this feature is not GA we should have this guarded by a feature gate also.
c.Lock() | ||
defer c.Unlock() | ||
_, ok := c.hm.ClusterQueues[cq.Name] | ||
if !ok { | ||
return | ||
} | ||
if features.Enabled(features.LocalQueueMetrics) { |
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 you still want the feature gate here as long as this feature is alpha/beta.
Also, you should make sure to bump the feature gate to beta if you are intending to bump this to beta.
7c14df3
to
3b626e0
Compare
f0ceb78
to
9ad1776
Compare
add a singleton localQueueMetrics config which can be enabled and changed by KueueConfig Signed-off-by: Kevin <[email protected]>
9ad1776
to
f672c3f
Compare
@KPostOffice: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions 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. I understand the commands that are listed here. |
Integration tests seem to say you are hitting a data race. |
@@ -488,18 +488,22 @@ func (s *Scheduler) admit(ctx context.Context, e *entry, cq *cache.ClusterQueueS | |||
waitTime := workload.QueuedWaitTime(newWorkload) | |||
s.recorder.Eventf(newWorkload, corev1.EventTypeNormal, "QuotaReserved", "Quota reserved in ClusterQueue %v, wait time since queued was %.0fs", admission.ClusterQueue, waitTime.Seconds()) | |||
metrics.QuotaReservedWorkload(admission.ClusterQueue, waitTime) | |||
if features.Enabled(features.LocalQueueMetrics) { |
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 would think that if the feature gate is disabled we want to avoid checking for local queue.
add a singleton localQueueMetrics config which can be enabled and changed by KueueConfig
What type of PR is this?
/kind feature
/kind api-change
What this PR does / why we need it:
#1833
https://github.com/kubernetes-sigs/kueue/tree/main/keps/1833-metrics-for-local-queue#api-changes
Which issue(s) this PR fixes:
Fixes #1833
Special notes for your reviewer:
There are three changes of note that I'm uncertain about:
ctx
to many functions so that it can trickle down to the ShouldReportLocalMetricsFunctionDoes this PR introduce a user-facing change?