tailscale/control/controlclient
Brad Fitzpatrick dbf468740b control/controlclient: add patchify miss stats
Add an opt-in metrics.LabelMap tracking why patchifyPeer fails to
convert a PeersChanged entry into a PeersChangedPatch. The stats are
gated behind the TS_DEBUG_PATCHIFY_PEER_MISS envknob so there is zero
overhead in normal operation.

peerChangeDiff now takes an optional onFalse callback that is called
with the field name on every non-patchable return path. When the
envknob is off, nil is passed and replaced with a no-op at the top of
peerChangeDiff.

The resulting metric renders as:

    counter_patchify_miss{why="Hostinfo"} 2
    counter_patchify_miss{why="peer_not_found"} 1170

Updates tailscale/corp#40088

Change-Id: I2d4b9074bf42ec03ab296c0629a54106bafa873e
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2026-04-15 08:05:57 -07:00
..
auto.go control/controlclient,ipn/ipnlocal,wgengine: avoid restarting wireguard when key is learned via tsmp (#19142) 2026-03-30 14:26:08 -04:00
client.go control,health,ipn: move IP forwarding check to health tracker (#19007) 2026-03-18 16:24:12 -04:00
controlclient_test.go all: use Go 1.26 things, run most gofix modernizers 2026-03-06 13:32:03 -08:00
direct_test.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
direct.go tsd, all: add Sys.ExtraRootCAs, plumb through TLS dial paths 2026-04-07 18:10:54 -07:00
errors.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
map_debug.go control/controlclient: add patchify miss stats 2026-04-15 08:05:57 -07:00
map_test.go control/controlclient: add patchify miss stats 2026-04-15 08:05:57 -07:00
map.go control/controlclient: add patchify miss stats 2026-04-15 08:05:57 -07:00
sign_supported_test.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
sign_supported.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
sign_unsupported.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
sign.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
status.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00