From 3c19e6d2a74516b10c61614829035811297bda34 Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Mon, 9 Nov 2026 01:46:00 +0100 Subject: [PATCH] util/clientmetric: define Type unconditionally Move Type and its constants to an unconditional file so syspolicy, and its dependents such as tsnet, compile with ts_omit_clientmetrics. Fixes #22252 Change-Id: Ib9ca1c192e3e1c570aa32d41650d72fbff1aff0c Signed-off-by: Fredrik Fornwall --- util/clientmetric/clientmetric.go | 8 -------- util/clientmetric/type.go | 12 ++++++++++++ 2 files changed, 12 insertions(+), 8 deletions(-) create mode 100644 util/clientmetric/type.go diff --git a/util/clientmetric/clientmetric.go b/util/clientmetric/clientmetric.go index 98068b9fa..765b69160 100644 --- a/util/clientmetric/clientmetric.go +++ b/util/clientmetric/clientmetric.go @@ -51,14 +51,6 @@ type scanEntry struct { lastLogged int64 // last logged value } -// Type is a metric type: counter or gauge. -type Type uint8 - -const ( - TypeGauge Type = iota - TypeCounter -) - // MetricUpdate requests that a client metric value be updated. // // This is the request body sent to /localapi/v0/upload-client-metrics. diff --git a/util/clientmetric/type.go b/util/clientmetric/type.go new file mode 100644 index 000000000..ccb84b7a0 --- /dev/null +++ b/util/clientmetric/type.go @@ -0,0 +1,12 @@ +// Copyright (c) Tailscale Inc & contributors +// SPDX-License-Identifier: BSD-3-Clause + +package clientmetric + +// Type is a metric type: counter or gauge. +type Type uint8 + +const ( + TypeGauge Type = iota + TypeCounter +)