mirror of
https://github.com/goauthentik/authentik.git
synced 2026-06-17 19:09:11 +03:00
internal: fix incorrect metric calculation (#19701)
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
@@ -75,6 +75,7 @@ func (ws *WebServer) configureProxy() {
|
||||
return
|
||||
}
|
||||
before := time.Now()
|
||||
|
||||
if ws.ProxyServer != nil && ws.ProxyServer.HandleHost(rw, r) {
|
||||
elapsed := time.Since(before)
|
||||
Requests.With(prometheus.Labels{
|
||||
@@ -82,12 +83,14 @@ func (ws *WebServer) configureProxy() {
|
||||
}).Observe(float64(elapsed) / float64(time.Second))
|
||||
return
|
||||
}
|
||||
|
||||
r.Body = http.MaxBytesReader(rw, r.Body, maxBodyBytes)
|
||||
rp.ServeHTTP(rw, r)
|
||||
|
||||
elapsed := time.Since(before)
|
||||
Requests.With(prometheus.Labels{
|
||||
"dest": "core",
|
||||
}).Observe(float64(elapsed) / float64(time.Second))
|
||||
r.Body = http.MaxBytesReader(rw, r.Body, maxBodyBytes)
|
||||
rp.ServeHTTP(rw, r)
|
||||
}))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user