tsweb: expose native Prometheus metrics in /debug/varz
The handler will expose built-in process and Go metrics by default, which currently duplicate some of the expvar-proxied metrics (`goroutines` vs `go_goroutines`, `memstats` vs `go_memstats`), but as long as their names are different, Prometheus server will just scrape both. This will change /debug/varz behaviour for most tsweb binaries, but notably not for control, which configures a `tsweb.VarzHandler` [explicitly](https://github.com/tailscale/corp/blob/a5b5d5167f1a2b780d313ec6a30e7b96dfa25b2d/cmd/tailcontrol/tailcontrol.go#L779) Updates https://github.com/tailscale/corp/issues/10205 Signed-off-by: Anton Tolchanov <anton@tailscale.com>
This commit is contained in:
committed by
Anton Tolchanov
parent
690446c784
commit
11e6247d2a
+1
-1
@@ -54,7 +54,7 @@ func Debugger(mux *http.ServeMux) *DebugHandler {
|
||||
ret.KVFunc("Uptime", func() any { return Uptime() })
|
||||
ret.KV("Version", version.Long())
|
||||
ret.Handle("vars", "Metrics (Go)", expvar.Handler())
|
||||
ret.Handle("varz", "Metrics (Prometheus)", http.HandlerFunc(VarzHandler))
|
||||
ret.Handle("varz", "Metrics (Prometheus)", http.HandlerFunc(CombinedVarzHandler))
|
||||
ret.Handle("pprof/", "pprof", http.HandlerFunc(pprof.Index))
|
||||
ret.URL("/debug/pprof/goroutine?debug=1", "Goroutines (collapsed)")
|
||||
ret.URL("/debug/pprof/goroutine?debug=2", "Goroutines (full)")
|
||||
|
||||
Reference in New Issue
Block a user