mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-07-19 15:39:17 +00:00
fix: record authentication latency before audit filter wraps up
Signed-off-by: Min Jin <minkimzz@amazon.com>
This commit is contained in:
@@ -66,9 +66,9 @@ func withAuthentication(handler http.Handler, auth authenticator.Request, failed
|
||||
}
|
||||
resp, ok, err := auth.AuthenticateRequest(req)
|
||||
authenticationFinish := time.Now()
|
||||
genericapirequest.TrackAuthenticationLatency(req.Context(), authenticationFinish.Sub(authenticationStart))
|
||||
defer func() {
|
||||
metrics(req.Context(), resp, ok, err, apiAuds, authenticationStart, authenticationFinish)
|
||||
genericapirequest.TrackAuthenticationLatency(req.Context(), authenticationFinish.Sub(authenticationStart))
|
||||
}()
|
||||
if err != nil || !ok {
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user