mirror of
https://github.com/juanfont/headscale.git
synced 2026-09-26 02:04:53 +09:00
fix(metrics): collect metrics for non-OPTIONS requests
Fix the inverted HTTP metrics skip condition, which caused the collector to ignore all requests except OPTIONS.
Apply the correction to both the main and Noise routers so regular HTTP traffic is included in http_requests_total and http_request_duration_seconds.
(cherry picked from commit 63ce8f2295)
This commit is contained in:
committed by
Kristoffer Dalby
parent
00babf430a
commit
33db8c6b29
+1
-1
@@ -531,7 +531,7 @@ func (h *Headscale) createRouter(grpcMux *grpcRuntime.ServeMux) *chi.Mux {
|
||||
Host: false,
|
||||
Proto: true,
|
||||
Skip: func(r *http.Request) bool {
|
||||
return r.Method != http.MethodOptions
|
||||
return r.Method == http.MethodOptions
|
||||
},
|
||||
}))
|
||||
r.Use(middleware.RequestID)
|
||||
|
||||
+1
-1
@@ -153,7 +153,7 @@ func (h *Headscale) NoiseUpgradeHandler(
|
||||
Host: false,
|
||||
Proto: true,
|
||||
Skip: func(r *http.Request) bool {
|
||||
return r.Method != http.MethodOptions
|
||||
return r.Method == http.MethodOptions
|
||||
},
|
||||
}))
|
||||
r.Use(middleware.RequestID)
|
||||
|
||||
Reference in New Issue
Block a user