feature/featuretags: make usermetrics modular

Saves ~102 KB from the min build.

Updates #12614

Change-Id: Ie1d4f439321267b9f98046593cb289ee3c4d6249
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2025-10-06 12:02:16 -07:00
committed by Brad Fitzpatrick
parent ea8e991d69
commit d816454a88
17 changed files with 97 additions and 31 deletions

View File

@@ -51,11 +51,9 @@ import (
"tailscale.com/safesocket"
"tailscale.com/syncs"
"tailscale.com/tsd"
"tailscale.com/tsweb/varz"
"tailscale.com/types/flagtype"
"tailscale.com/types/logger"
"tailscale.com/types/logid"
"tailscale.com/util/clientmetric"
"tailscale.com/util/osshare"
"tailscale.com/util/syspolicy/pkey"
"tailscale.com/util/syspolicy/policyclient"
@@ -831,12 +829,6 @@ func tryEngine(logf logger.Logf, sys *tsd.System, name string) (onlyNetstack boo
var hookNewDebugMux feature.Hook[func() *http.ServeMux]
func servePrometheusMetrics(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "text/plain")
varz.Handler(w, r)
clientmetric.WritePrometheusExpositionFormat(w)
}
func runDebugServer(logf logger.Logf, mux *http.ServeMux, addr string) {
if !buildfeatures.HasDebug {
return