diff --git a/client/web/web.go b/client/web/web.go index efc0ea3d9..85f549fab 100644 --- a/client/web/web.go +++ b/client/web/web.go @@ -36,7 +36,7 @@ import ( "tailscale.com/tailcfg" "tailscale.com/types/logger" "tailscale.com/util/httpm" - "tailscale.com/util/usermetrics" + "tailscale.com/util/usermetric" "tailscale.com/version" "tailscale.com/version/distro" ) @@ -285,7 +285,7 @@ func (s *Server) serve(w http.ResponseWriter, r *http.Request) { } if strings.HasPrefix(r.URL.Path, "/metrics") { - usermetrics.Handler(w, r) + usermetric.Handler(w, r) return } diff --git a/cmd/k8s-operator/depaware.txt b/cmd/k8s-operator/depaware.txt index ed2faef14..17c22a394 100644 --- a/cmd/k8s-operator/depaware.txt +++ b/cmd/k8s-operator/depaware.txt @@ -754,7 +754,7 @@ tailscale.com/cmd/k8s-operator dependencies: (generated by github.com/tailscale/ tailscale.com/tstime from tailscale.com/cmd/k8s-operator+ tailscale.com/tstime/mono from tailscale.com/net/tstun+ tailscale.com/tstime/rate from tailscale.com/derp+ - tailscale.com/tsweb/varz from tailscale.com/util/usermetrics + tailscale.com/tsweb/varz from tailscale.com/util/usermetric tailscale.com/types/appctype from tailscale.com/ipn/ipnlocal tailscale.com/types/dnstype from tailscale.com/ipn/ipnlocal+ tailscale.com/types/empty from tailscale.com/ipn+ @@ -813,7 +813,7 @@ tailscale.com/cmd/k8s-operator dependencies: (generated by github.com/tailscale/ tailscale.com/util/testenv from tailscale.com/control/controlclient+ tailscale.com/util/truncate from tailscale.com/logtail tailscale.com/util/uniq from tailscale.com/ipn/ipnlocal+ - tailscale.com/util/usermetrics from tailscale.com/client/web+ + tailscale.com/util/usermetric from tailscale.com/client/web+ tailscale.com/util/vizerror from tailscale.com/tailcfg+ 💣 tailscale.com/util/winutil from tailscale.com/clientupdate+ W 💣 tailscale.com/util/winutil/authenticode from tailscale.com/clientupdate+ diff --git a/cmd/tailscale/depaware.txt b/cmd/tailscale/depaware.txt index 47352655c..51e3b8183 100644 --- a/cmd/tailscale/depaware.txt +++ b/cmd/tailscale/depaware.txt @@ -132,7 +132,7 @@ tailscale.com/cmd/tailscale dependencies: (generated by github.com/tailscale/dep tailscale.com/tstime from tailscale.com/control/controlhttp+ tailscale.com/tstime/mono from tailscale.com/tstime/rate tailscale.com/tstime/rate from tailscale.com/cmd/tailscale/cli+ - tailscale.com/tsweb/varz from tailscale.com/util/usermetrics + tailscale.com/tsweb/varz from tailscale.com/util/usermetric tailscale.com/types/dnstype from tailscale.com/tailcfg tailscale.com/types/empty from tailscale.com/ipn tailscale.com/types/ipproto from tailscale.com/net/flowtrack+ @@ -174,7 +174,7 @@ tailscale.com/cmd/tailscale dependencies: (generated by github.com/tailscale/dep tailscale.com/util/syspolicy/setting from tailscale.com/util/syspolicy tailscale.com/util/testenv from tailscale.com/cmd/tailscale/cli tailscale.com/util/truncate from tailscale.com/cmd/tailscale/cli - tailscale.com/util/usermetrics from tailscale.com/client/web + tailscale.com/util/usermetric from tailscale.com/client/web tailscale.com/util/vizerror from tailscale.com/tailcfg+ 💣 tailscale.com/util/winutil from tailscale.com/clientupdate+ W 💣 tailscale.com/util/winutil/authenticode from tailscale.com/clientupdate diff --git a/cmd/tailscaled/depaware.txt b/cmd/tailscaled/depaware.txt index 5c48a7d8b..fb49fd21c 100644 --- a/cmd/tailscaled/depaware.txt +++ b/cmd/tailscaled/depaware.txt @@ -403,7 +403,7 @@ tailscale.com/cmd/tailscaled dependencies: (generated by github.com/tailscale/de tailscale.com/util/testenv from tailscale.com/ipn/ipnlocal+ tailscale.com/util/truncate from tailscale.com/logtail tailscale.com/util/uniq from tailscale.com/ipn/ipnlocal+ - tailscale.com/util/usermetrics from tailscale.com/client/web+ + tailscale.com/util/usermetric from tailscale.com/client/web+ tailscale.com/util/vizerror from tailscale.com/tailcfg+ 💣 tailscale.com/util/winutil from tailscale.com/clientupdate+ W 💣 tailscale.com/util/winutil/authenticode from tailscale.com/clientupdate+ diff --git a/control/controlclient/map.go b/control/controlclient/map.go index 985217074..19590db7b 100644 --- a/control/controlclient/map.go +++ b/control/controlclient/map.go @@ -33,7 +33,7 @@ import ( "tailscale.com/util/clientmetric" "tailscale.com/util/mak" "tailscale.com/util/set" - "tailscale.com/util/usermetrics" + "tailscale.com/util/usermetric" "tailscale.com/wgengine/filter" ) @@ -362,7 +362,7 @@ type healthMessageLabel struct { Severity string } -var metricHealthMessages = usermetrics.NewMultiLabelMap[healthMessageLabel]( +var metricHealthMessages = usermetric.NewMultiLabelMap[healthMessageLabel]( "tailscaled_health_messages", "gauge", "A gauge of health messages from control, by severity", diff --git a/ipn/ipnlocal/local.go b/ipn/ipnlocal/local.go index 5e01dddc9..f309af0c3 100644 --- a/ipn/ipnlocal/local.go +++ b/ipn/ipnlocal/local.go @@ -107,7 +107,7 @@ import ( "tailscale.com/util/systemd" "tailscale.com/util/testenv" "tailscale.com/util/uniq" - "tailscale.com/util/usermetrics" + "tailscale.com/util/usermetric" "tailscale.com/version" "tailscale.com/version/distro" "tailscale.com/wgengine" @@ -4616,7 +4616,7 @@ func unmapIPPrefixes(ippsList ...[]netip.Prefix) (ret []netip.Prefix) { return ret } -var metricAdvertisedRoutes = usermetrics.NewMultiLabelMap[struct{}]( +var metricAdvertisedRoutes = usermetric.NewMultiLabelMap[struct{}]( "tailscaled_advertised_routes", "gauge", "Number of subnet routes advertised by the node. (excluding exit node /0 routes)", diff --git a/net/tstun/wrap.go b/net/tstun/wrap.go index 3ca60a2bf..79879b1db 100644 --- a/net/tstun/wrap.go +++ b/net/tstun/wrap.go @@ -34,7 +34,7 @@ import ( "tailscale.com/types/key" "tailscale.com/types/logger" "tailscale.com/util/clientmetric" - "tailscale.com/util/usermetrics" + "tailscale.com/util/usermetric" "tailscale.com/wgengine/capture" "tailscale.com/wgengine/filter" "tailscale.com/wgengine/wgcfg" @@ -1434,12 +1434,12 @@ type trafficLabel struct { } var ( - metricInboundPacketsTotal = usermetrics.NewMultiLabelMap[trafficLabel]( + metricInboundPacketsTotal = usermetric.NewMultiLabelMap[trafficLabel]( "tailscaled_inbound_packets_total", "counter", "Counts the number of packets received by the node from other peers", ) - metricOutboundPacketsTotal = usermetrics.NewMultiLabelMap[trafficLabel]( + metricOutboundPacketsTotal = usermetric.NewMultiLabelMap[trafficLabel]( "tailscaled_outbound_packets_total", "counter", "Counts the number of packets sent by the node to other peers", diff --git a/util/usermetrics/usermetrics.go b/util/usermetric/usermetric.go similarity index 87% rename from util/usermetrics/usermetrics.go rename to util/usermetric/usermetric.go index d164bc303..208826186 100644 --- a/util/usermetrics/usermetrics.go +++ b/util/usermetric/usermetric.go @@ -1,9 +1,9 @@ // Copyright (c) Tailscale Inc & AUTHORS // SPDX-License-Identifier: BSD-3-Clause -// Package usermetrics provides a container and handler +// Package usermetric provides a container and handler // for user-facing metrics. -package usermetrics +package usermetric import ( "expvar" @@ -19,7 +19,7 @@ var vars expvar.Map // MultiLabelMap[T] variable with the given name and returns it. // The variable is registered with the userfacing metrics package. // -// Note that usermetrics are not protected against duplicate +// Note that usermetric are not protected against duplicate // metrics name. It is the caller's responsibility to ensure that // the name is unique. func NewMultiLabelMap[T comparable](name string, promType, helpText string) *metrics.MultiLabelMap[T] {