diff --git a/client/web/web.go b/client/web/web.go index 85f549fab..9114e617a 100644 --- a/client/web/web.go +++ b/client/web/web.go @@ -41,6 +41,10 @@ "tailscale.com/version/distro" ) +// TODO(kradalby): Remove this once we have landed on a final set of +// metrics to export to clients and consider the metrics stable. +var debugUsermetricsEndpoint = envknob.RegisterBool("TS_DEBUG_USER_METRICS") + // ListenPort is the static port used for the web client when run inside tailscaled. // (5252 are the numbers above the letters "TSTS" on a qwerty keyboard.) const ListenPort = 5252 @@ -284,7 +288,7 @@ func (s *Server) serve(w http.ResponseWriter, r *http.Request) { } } - if strings.HasPrefix(r.URL.Path, "/metrics") { + if debugUsermetricsEndpoint() && strings.HasPrefix(r.URL.Path, "/metrics") { usermetric.Handler(w, r) return }