-
Notifications
You must be signed in to change notification settings - Fork 40.4k
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 logged verbs match metric-reported verbs #102934
Conversation
/test pull-kubernetes-unit |
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 modulo the FIX BEFORE MERGING
Thanks for doing that - I wanted to do that for some time...
// we can convert GETs to LISTs when needed. | ||
scope := metrics.CleanScope(requestInfo) | ||
verb = metrics.CanonicalVerb(strings.ToUpper(verb), scope) | ||
// FIX BEFORE MERGING: this if clause doesn't get hit. Fix or delete. |
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.
Do you know why?
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.
Yeah, the filter chain ordering was wrong.
/triage accepted |
@@ -774,6 +773,7 @@ func DefaultBuildHandlerChain(apiHandler http.Handler, c *Config) http.Handler { | |||
handler = genericapifilters.WithCacheControl(handler) | |||
handler = genericfilters.WithHSTS(handler, c.HSTSDirectives) | |||
handler = genericfilters.WithHTTPLogging(handler) | |||
handler = genericapifilters.WithRequestInfo(handler, c.RequestInfoResolver) |
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.
For the curious, this reordering doesn't cause apiserver to do more net work unless the probabilistic GOAWAY triggers, which is going to be rare or extremely rare.
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.
SGTM
This works now. Since you already looked at it: cc @logicalhan fyi |
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
@@ -774,6 +773,7 @@ func DefaultBuildHandlerChain(apiHandler http.Handler, c *Config) http.Handler { | |||
handler = genericapifilters.WithCacheControl(handler) | |||
handler = genericfilters.WithHSTS(handler, c.HSTSDirectives) | |||
handler = genericfilters.WithHTTPLogging(handler) | |||
handler = genericapifilters.WithRequestInfo(handler, c.RequestInfoResolver) |
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.
SGTM
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lavalamp, wojtek-t 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 |
/kind bug
What this PR does / why we need it:
Make the verbs printed in the logs match the verbs in the metrics. (That is, show LIST, WATCH, APPLY virtual verbs correctly)
/sig api-machinery