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
expands allowed set of packages to define constants that can be verified as part of metric static analysis #103654
expands allowed set of packages to define constants that can be verified as part of metric static analysis #103654
Conversation
Skipping CI for Draft Pull Request. |
@logicalhan first cut at this. There are many things left to do. for this PR I want to only include packages from:
k8s.io/klog and k8s.io/utils packages are giving me grief, not sure why yet. I'm leaving packages managed by go itself for now as I need to get a better understanding of how go picks the correct library off disk at compile time to make sure I'm grabbing the right version. this PR will fail the static analysis check as I didn't update the golden list of stable metrics. I'm not entirely sure how to create a unit test for this. current unit tests are all done by passing in a string as a code file, my first guess is to create a |
oh this is kinda awesome, have you tried changing the logic so that we try to parse all metrics instead of just the stable ones? |
i'm quite curious how far it gets |
/assign |
the verify test failed as expected, I haven't added the demo metric to the stable list (and I shouldn't). verify failed in a bunch of unexpected ways, I'll sort that out soonish. |
/test pull-kubernetes-node-e2e-containerd |
@logicalhan @brancz this PR adds support to STABLE metrics for including conts/vars from k8s.io (both pkg/ and vendor/) and stdlib. The failing verify test is expected because that metric isn't mine to control but I've marked it as stable to verify the CI. If you want I can remove support for stdlib, it was easy and I had already done it so I've left it in for now. Otherwise, anything else for this PR? |
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.
what kind of output do you get if you try to get a full list of metrics that are ALPHA?
|
||
package metrics | ||
|
||
const OKGO = "ThisIsNotTheSoundOfTheTrain" |
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.
:)
/cc |
@logicalhan ALPHA output was categorized above #103654 (comment) |
/test pull-kubernetes-node-e2e-containerd |
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.
/lgtm
/hold cancel test STABLE metric label reverted to alpha. |
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.
/lgtm
/approve
This is great! Thanks for tackling this!
/priority important-soon |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: coffeepac, logicalhan The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retitle expands allowed set of packages to define constants that can be verified as part of metric static analysis |
What type of PR is this?
/kind feature
What this PR does / why we need it:
expands allowed set of packages to define constants that can be verified as part of metric static analysis
Which issue(s) this PR fixes:
Fixes #
partial fix for #81863
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: