From 92dfaf53bb64319ccd9922049a3ec3cfb1250a43 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Thu, 20 Jan 2022 09:27:00 -0800 Subject: [PATCH] cmd/tailscaled: include Go runtime metrics in /debug/metrics Fixes #3772 Change-Id: I237ea23268664d99e83d27890146018b04474556 Signed-off-by: Brad Fitzpatrick --- cmd/tailscaled/depaware.txt | 3 ++- cmd/tailscaled/tailscaled.go | 2 ++ tstest/integration/tailscaled_deps_test_darwin.go | 1 + tstest/integration/tailscaled_deps_test_freebsd.go | 1 + tstest/integration/tailscaled_deps_test_linux.go | 1 + tstest/integration/tailscaled_deps_test_openbsd.go | 1 + tstest/integration/tailscaled_deps_test_windows.go | 1 + 7 files changed, 9 insertions(+), 1 deletion(-) diff --git a/cmd/tailscaled/depaware.txt b/cmd/tailscaled/depaware.txt index e8964704c..823d161e1 100644 --- a/cmd/tailscaled/depaware.txt +++ b/cmd/tailscaled/depaware.txt @@ -187,7 +187,7 @@ tailscale.com/cmd/tailscaled dependencies: (generated by github.com/tailscale/de tailscale.com/logtail from tailscale.com/logpolicy+ tailscale.com/logtail/backoff from tailscale.com/cmd/tailscaled+ tailscale.com/logtail/filch from tailscale.com/logpolicy - 💣 tailscale.com/metrics from tailscale.com/derp + 💣 tailscale.com/metrics from tailscale.com/derp+ tailscale.com/net/dns from tailscale.com/cmd/tailscaled+ tailscale.com/net/dns/resolver from tailscale.com/net/dns+ tailscale.com/net/dnscache from tailscale.com/control/controlclient+ @@ -219,6 +219,7 @@ tailscale.com/cmd/tailscaled dependencies: (generated by github.com/tailscale/de tailscale.com/tstime from tailscale.com/wgengine/magicsock 💣 tailscale.com/tstime/mono from tailscale.com/net/tstun+ tailscale.com/tstime/rate from tailscale.com/wgengine/filter + tailscale.com/tsweb from tailscale.com/cmd/tailscaled tailscale.com/types/dnstype from tailscale.com/ipn/ipnlocal+ tailscale.com/types/empty from tailscale.com/control/controlclient+ tailscale.com/types/flagtype from tailscale.com/cmd/tailscaled diff --git a/cmd/tailscaled/tailscaled.go b/cmd/tailscaled/tailscaled.go index 6c8a1bc43..bcd5501d5 100644 --- a/cmd/tailscaled/tailscaled.go +++ b/cmd/tailscaled/tailscaled.go @@ -41,6 +41,7 @@ import ( "tailscale.com/net/tstun" "tailscale.com/paths" "tailscale.com/safesocket" + "tailscale.com/tsweb" "tailscale.com/types/flagtype" "tailscale.com/types/logger" "tailscale.com/util/clientmetric" @@ -514,6 +515,7 @@ func newDebugMux() *http.ServeMux { func servePrometheusMetrics(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "text/plain") + tsweb.VarzHandler(w, r) clientmetric.WritePrometheusExpositionFormat(w) } diff --git a/tstest/integration/tailscaled_deps_test_darwin.go b/tstest/integration/tailscaled_deps_test_darwin.go index 8890ee8e8..402cf9001 100644 --- a/tstest/integration/tailscaled_deps_test_darwin.go +++ b/tstest/integration/tailscaled_deps_test_darwin.go @@ -30,6 +30,7 @@ import ( _ "tailscale.com/paths" _ "tailscale.com/safesocket" _ "tailscale.com/tailcfg" + _ "tailscale.com/tsweb" _ "tailscale.com/types/flagtype" _ "tailscale.com/types/key" _ "tailscale.com/types/logger" diff --git a/tstest/integration/tailscaled_deps_test_freebsd.go b/tstest/integration/tailscaled_deps_test_freebsd.go index 8890ee8e8..402cf9001 100644 --- a/tstest/integration/tailscaled_deps_test_freebsd.go +++ b/tstest/integration/tailscaled_deps_test_freebsd.go @@ -30,6 +30,7 @@ import ( _ "tailscale.com/paths" _ "tailscale.com/safesocket" _ "tailscale.com/tailcfg" + _ "tailscale.com/tsweb" _ "tailscale.com/types/flagtype" _ "tailscale.com/types/key" _ "tailscale.com/types/logger" diff --git a/tstest/integration/tailscaled_deps_test_linux.go b/tstest/integration/tailscaled_deps_test_linux.go index 8890ee8e8..402cf9001 100644 --- a/tstest/integration/tailscaled_deps_test_linux.go +++ b/tstest/integration/tailscaled_deps_test_linux.go @@ -30,6 +30,7 @@ import ( _ "tailscale.com/paths" _ "tailscale.com/safesocket" _ "tailscale.com/tailcfg" + _ "tailscale.com/tsweb" _ "tailscale.com/types/flagtype" _ "tailscale.com/types/key" _ "tailscale.com/types/logger" diff --git a/tstest/integration/tailscaled_deps_test_openbsd.go b/tstest/integration/tailscaled_deps_test_openbsd.go index 8890ee8e8..402cf9001 100644 --- a/tstest/integration/tailscaled_deps_test_openbsd.go +++ b/tstest/integration/tailscaled_deps_test_openbsd.go @@ -30,6 +30,7 @@ import ( _ "tailscale.com/paths" _ "tailscale.com/safesocket" _ "tailscale.com/tailcfg" + _ "tailscale.com/tsweb" _ "tailscale.com/types/flagtype" _ "tailscale.com/types/key" _ "tailscale.com/types/logger" diff --git a/tstest/integration/tailscaled_deps_test_windows.go b/tstest/integration/tailscaled_deps_test_windows.go index 6e5254203..9e87dba78 100644 --- a/tstest/integration/tailscaled_deps_test_windows.go +++ b/tstest/integration/tailscaled_deps_test_windows.go @@ -34,6 +34,7 @@ import ( _ "tailscale.com/paths" _ "tailscale.com/safesocket" _ "tailscale.com/tailcfg" + _ "tailscale.com/tsweb" _ "tailscale.com/types/flagtype" _ "tailscale.com/types/key" _ "tailscale.com/types/logger"