net/sockstats: disable deltas for the cell radio power state metric

Updates tailscale/corp#9230

Signed-off-by: Mihai Parparita <mihai@tailscale.com>
pull/7821/head
Mihai Parparita 2 years ago committed by Mihai Parparita
parent 22680a11ae
commit e978299bf0

@ -63,6 +63,14 @@ var sockStats = struct {
radioHighMetric: clientmetric.NewGaugeFunc("sockstats_cellular_radio_high_fraction", radio.radioHighPercent), radioHighMetric: clientmetric.NewGaugeFunc("sockstats_cellular_radio_high_fraction", radio.radioHighPercent),
} }
func init() {
// Deltas are not useful for this gauge metric, we want the collector to be
// able to get current values without having to wait for the 4 hour
// metricLogNameFrequency interval (by which point the cell radio state may
// be very different).
sockStats.radioHighMetric.DisableDeltas()
}
func withSockStats(ctx context.Context, label Label) context.Context { func withSockStats(ctx context.Context, label Label) context.Context {
sockStats.mu.Lock() sockStats.mu.Lock()
defer sockStats.mu.Unlock() defer sockStats.mu.Unlock()

Loading…
Cancel
Save