From 516e8a483807d49b77c775d88fc148db0da8a2cd Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Mon, 1 Feb 2021 10:50:36 -0800 Subject: [PATCH] tsweb: add num_goroutines expvar Signed-off-by: Josh Bleecher Snyder --- tsweb/tsweb.go | 1 + 1 file changed, 1 insertion(+) diff --git a/tsweb/tsweb.go b/tsweb/tsweb.go index a7cb50725..a7299b607 100644 --- a/tsweb/tsweb.go +++ b/tsweb/tsweb.go @@ -42,6 +42,7 @@ func NewMux(debugHandler http.Handler) *http.ServeMux { func registerCommonDebug(mux *http.ServeMux) { expvar.Publish("counter_uptime_sec", expvar.Func(func() interface{} { return int64(Uptime().Seconds()) })) + expvar.Publish("gauge_goroutines", expvar.Func(func() interface{} { return runtime.NumGoroutine() })) mux.Handle("/debug/pprof/", Protected(http.DefaultServeMux)) // to net/http/pprof mux.Handle("/debug/vars", Protected(http.DefaultServeMux)) // to expvar mux.Handle("/debug/varz", Protected(http.HandlerFunc(VarzHandler)))