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
add failopen metric #107171
add failopen metric #107171
Conversation
|
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
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/test-infra repository. I understand the commands that are listed here. |
Welcome @ltagliamonte-dd! |
Hi @ltagliamonte-dd. Thanks for your PR. I'm waiting for a kubernetes 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/test-infra repository. |
/assign @sttts |
This PR may require API review. If so, when the changes are ready, complete the pre-review checklist and request an API review. Status of requested reviews is tracked in the API Review project. |
@@ -116,6 +116,7 @@ type AdmissionMetrics struct { | |||
controller *metricSet | |||
webhook *metricSet | |||
webhookRejection *metrics.CounterVec | |||
webhookFailOpen *metrics.CounterVec |
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.
Please see my comment in #107146 (comment). I wonder if we can achieve the goal by reusing / extending the existing metrics.
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
/ok-to-test
@@ -250,6 +262,11 @@ func (m *AdmissionMetrics) ObserveWebhookRejection(ctx context.Context, name, st | |||
m.webhookRejection.WithContext(ctx).WithLabelValues(name, stepType, operation, string(errorType), strconv.Itoa(rejectionCode)).Inc() | |||
} | |||
|
|||
// ObserveWebhookFailOpen records validating or mutating webhook that fail open. | |||
func (m *AdmissionMetrics) ObserveWebhookFailOpen(ctx context.Context, name, stepType string) { |
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.
Please add a unit test here
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.
done with commit 0844891, thanks to point this out.
/triage accepted |
"I signed it" |
Sgtm. Waiting for @roycaihw to do a final pass. |
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ltagliamonte-dd, roycaihw, sttts 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 |
&metrics.CounterOpts{ | ||
Namespace: namespace, | ||
Subsystem: subsystem, | ||
Name: "webhook_fail_open_count", |
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.
This must be suffixed _total
as per instrumentation guidelines.
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.
@logicalhan let me fix that, will open a PR shortly adding you are reviewer
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.
@logicalhan the file contains 2 counter metrics:
- webhook_rejection_count (preexisting)
- webhook_fail_open_count (new added by me)
Do you want me to address both? renaming them to:
- webhook_rejection_total
- webhook_fail_open_total
Ah this ended up bypassing sig-instrumentation triage, can we agree on the protocol that to |
#107171 (comment) IIRC the bot will add a SIG back when a new git push happens, based on the files in the PR. But I agree it would be nice if we can have a way to express triage per SIG. |
What type of PR is this?
/kind feature
/kind api-change
What this PR does / why we need it:
Add a new metric to monitor webhooks that fail open
Which issue(s) this PR fixes:
Fixes #
#107146
Special notes for your reviewer:
N/A
Does this PR introduce a user-facing change?