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.
This commit is contained in:
Paulo Luna authored and Kristoffer Dalby committed 2026-08-28 13:13:48 +02:00
1 parent 63123196cc
commit 63ce8f2295
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -446,7 +446,7 @@ func (h *Headscale) createRouter(apiV1Mux, apiV2Mux http.Handler) *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
View File
@@ -150,7 +150,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)