From 017dcd520f3cb485faea037b2a6e9fad438afa43 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Thu, 14 Jan 2021 11:49:44 -0800 Subject: [PATCH] tsweb: export VarzHandler --- tsweb/tsweb.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tsweb/tsweb.go b/tsweb/tsweb.go index 411e615a4..0cbe2fb82 100644 --- a/tsweb/tsweb.go +++ b/tsweb/tsweb.go @@ -43,7 +43,7 @@ func registerCommonDebug(mux *http.ServeMux) { expvar.Publish("counter_uptime_sec", expvar.Func(func() interface{} { return int64(Uptime().Seconds()) })) 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))) + mux.Handle("/debug/varz", Protected(http.HandlerFunc(VarzHandler))) mux.Handle("/debug/gc", Protected(http.HandlerFunc(gcHandler))) } @@ -371,7 +371,7 @@ func Error(code int, msg string, err error) HTTPError { return HTTPError{Code: code, Msg: msg, Err: err} } -// varzHandler is an HTTP handler to write expvar values into the +// VarzHandler is an HTTP handler to write expvar values into the // prometheus export format: // // https://github.com/prometheus/docs/blob/master/content/docs/instrumenting/exposition_formats.md @@ -388,7 +388,7 @@ func Error(code int, msg string, err error) HTTPError { // is not exported. // // This will evolve over time, or perhaps be replaced. -func varzHandler(w http.ResponseWriter, r *http.Request) { +func VarzHandler(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "text/plain; version=0.0.4") var dump func(prefix string, kv expvar.KeyValue)