stops puting a stacktrace of aborted requests in the logs

Aborted requests are the ones that were disrupted with http.ErrAbortHandler.
For example, the timeout handler will panic with http.ErrAbortHandler when a response to the client has been already sent
and the timeout elapsed.

Additionally, a new metric requestAbortsTotal was defined to count aborted requests. The new metric allows for aggregation for each group, version, verb, resource, subresource and scope.
This commit is contained in:
Lukasz Szaszkiewicz
2020-09-24 10:07:24 +02:00
parent e0a51c9e6b
commit 057986e32c
9 changed files with 285 additions and 23 deletions

View File

@@ -221,7 +221,7 @@ func buildHandlerChain(handler http.Handler, authn authenticator.Request, authz
handler = genericapifilters.WithAuthentication(handler, authn, failedHandler, nil)
handler = genericapifilters.WithRequestInfo(handler, requestInfoResolver)
handler = genericapifilters.WithCacheControl(handler)
handler = genericfilters.WithPanicRecovery(handler)
handler = genericfilters.WithPanicRecovery(handler, requestInfoResolver)
return handler
}