Files
goldpinger/pkg
Cooper Ry Lees 7aaa34319c Clean up duplicate and out-of-order counters on pinger teardown
DeletePeerUDPMetrics was missing cleanup for the two counters added
in the previous commit (goldpinger_udp_duplicates_total and
goldpinger_udp_out_of_order_total). Without this, rolled pods would
leave stale counter label sets in /metrics.

Add TestDeletePeerUDPMetrics_CleansAllPerPeerMetrics which populates
every per-peer UDP metric, calls DeletePeerUDPMetrics, then verifies
all label sets are removed. If a future per-peer metric is added to
the perPeerCollectors map but not to DeletePeerUDPMetrics, the test
fails with: "metric X still has 1 label set(s) after
DeletePeerUDPMetrics — add it to the cleanup function"

Verified the test catches regressions by temporarily removing one
cleanup line — test correctly fails.

Signed-off-by: Cooper Ry Lees <me@cooperlees.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 13:33:43 +00:00
..