Skip to content
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

Implement/local metrics #3609

Closed

Conversation

KPostOffice
Copy link
Contributor

What type of PR is this?

/kind feature
/kind api-change

What this PR does / why we need it:

Implementation of LQ metrics KEP

Which issue(s) this PR fixes:

Fixes #1833

Special notes for your reviewer:

I'm uncertain if I've updated all the metrics in the right places. I still need to write tests, but I figured I'd open the PR as I have it now in case anything is egregiously off.

Does this PR introduce a user-facing change?

Addition of configuration that allows users to get prometheus metrics about LQ info, including the LQ status and the status of pending workloads

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Nov 21, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: KPostOffice
Once this PR has been reviewed and has the lgtm label, please assign tenzen-y for approval. For more information see the Kubernetes Code Review Process.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot
Copy link
Contributor

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 21, 2024
Copy link

netlify bot commented Nov 21, 2024

Deploy Preview for kubernetes-sigs-kueue canceled.

Name Link
🔨 Latest commit 22ffa40
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-kueue/deploys/673fa099c77dfe00086d7748

Signed-off-by: Kevin <[email protected]>
@kannon92
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 21, 2024
// If left empty, then metrics will expose for all local queues across namespaces.
type LocalQueueMetrics struct {
// Enable is a knob to allow metrics to be exposed for local queues. Defaults to false.
Enable bool `json:"enable,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we just take the absence of LocalQueueMetrics to mean that this is not enabled?

@@ -300,6 +344,19 @@ func (r *LocalQueueReconciler) SetupWithManager(mgr ctrl.Manager, cfg *config.Co
Complete(WithLeadingManager(mgr, r, &kueue.LocalQueue{}, cfg))
}

func localQueueStatusMetricForReason(reason string, queue *kueue.LocalQueue) {
switch reason {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am very confused on this block of code. Reading the correspondence between the reason and the metric string makes me feel like something is wrong..

If nothing is wrong, can we consider making the metric string match the reason?

Copy link
Contributor

@kannon92 kannon92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a lot of code here without any unit tests. I'm not sure what we have existing in this repo for testing around metrics but this code is nontrivial so it may be worth thinking of some test.

@k8s-ci-robot
Copy link
Contributor

@KPostOffice: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kueue-test-integration-main 22ffa40 link true /test pull-kueue-test-integration-main
pull-kueue-verify-main 22ffa40 link true /test pull-kueue-verify-main
pull-kueue-test-e2e-main-1-28 22ffa40 link true /test pull-kueue-test-e2e-main-1-28
pull-kueue-test-e2e-main-1-29 22ffa40 link true /test pull-kueue-test-e2e-main-1-29
pull-kueue-test-e2e-main-1-31 22ffa40 link true /test pull-kueue-test-e2e-main-1-31
pull-kueue-test-e2e-main-1-30 22ffa40 link true /test pull-kueue-test-e2e-main-1-30
pull-kueue-test-tas-e2e-main 22ffa40 link true /test pull-kueue-test-tas-e2e-main
pull-kueue-test-multikueue-e2e-main 22ffa40 link true /test pull-kueue-test-multikueue-e2e-main

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.

@tenzen-y
Copy link
Member

In favor of #3673
/close

@k8s-ci-robot
Copy link
Contributor

@tenzen-y: Closed this PR.

In response to this:

In favor of #3673
/close

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/feature Categorizes issue or PR as related to a new feature. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Local queues prometheus metrics
5 participants