From 0380cbc90d6cd98a8477726dd6a02b576cf047b2 Mon Sep 17 00:00:00 2001 From: Spike Curtis Date: Fri, 31 May 2024 18:55:04 +0400 Subject: [PATCH] derp: fix dropReason metrics labels (#12288) Updates #2745 Updates #7552 Signed-off-by: Spike Curtis --- derp/derp_server.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/derp/derp_server.go b/derp/derp_server.go index 115dbf761..3f08a6487 100644 --- a/derp/derp_server.go +++ b/derp/derp_server.go @@ -329,15 +329,17 @@ func NewServer(privateKey key.NodePrivate, logf logger.Logf) *Server { s.initMetacert() s.packetsRecvDisco = s.packetsRecvByKind.Get("disco") s.packetsRecvOther = s.packetsRecvByKind.Get("other") + s.packetsDroppedReasonCounters = []*expvar.Int{ - s.packetsDroppedReason.Get("unknown_dest"), - s.packetsDroppedReason.Get("unknown_dest_on_fwd"), - s.packetsDroppedReason.Get("gone_disconnected"), - s.packetsDroppedReason.Get("gone_not_here"), - s.packetsDroppedReason.Get("queue_head"), - s.packetsDroppedReason.Get("queue_tail"), - s.packetsDroppedReason.Get("write_error"), + dropReasonUnknownDest: s.packetsDroppedReason.Get("unknown_dest"), + dropReasonUnknownDestOnFwd: s.packetsDroppedReason.Get("unknown_dest_on_fwd"), + dropReasonGoneDisconnected: s.packetsDroppedReason.Get("gone_disconnected"), + dropReasonQueueHead: s.packetsDroppedReason.Get("queue_head"), + dropReasonQueueTail: s.packetsDroppedReason.Get("queue_tail"), + dropReasonWriteError: s.packetsDroppedReason.Get("write_error"), + dropReasonDupClient: s.packetsDroppedReason.Get("dup_client"), } + s.packetsDroppedTypeDisco = s.packetsDroppedType.Get("disco") s.packetsDroppedTypeOther = s.packetsDroppedType.Get("other") return s