Skip to content

Commit

Permalink
Merge pull request #53 from coder/spike/fix-drop-reason-stats
Browse files Browse the repository at this point in the history
fix: fix dropReason metrics labels
  • Loading branch information
spikecurtis authored May 29, 2024
2 parents e0fddea + 7a387dd commit 0fa29af
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions derp/derp_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,15 +326,16 @@ 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"),
}

s.packetsDroppedReasonCounters = make([]*expvar.Int, 7)
s.packetsDroppedReasonCounters[dropReasonUnknownDest] = s.packetsDroppedReason.Get("unknown_dest")
s.packetsDroppedReasonCounters[dropReasonUnknownDestOnFwd] = s.packetsDroppedReason.Get("unknown_dest_on_fwd")
s.packetsDroppedReasonCounters[dropReasonGoneDisconnected] = s.packetsDroppedReason.Get("gone_disconnected")
s.packetsDroppedReasonCounters[dropReasonQueueHead] = s.packetsDroppedReason.Get("queue_head")
s.packetsDroppedReasonCounters[dropReasonQueueTail] = s.packetsDroppedReason.Get("queue_tail")
s.packetsDroppedReasonCounters[dropReasonWriteError] = s.packetsDroppedReason.Get("write_error")
s.packetsDroppedReasonCounters[dropReasonDupClient] = s.packetsDroppedReason.Get("dup_client")

s.packetsDroppedTypeDisco = s.packetsDroppedType.Get("disco")
s.packetsDroppedTypeOther = s.packetsDroppedType.Get("other")
return s
Expand Down

0 comments on commit 0fa29af

Please sign in to comment.