mirror of
https://github.com/tailscale/tailscale.git
synced 2025-01-07 08:07:42 +00:00
wgengine/magicsock: add metrics for sent disco messages
We only tracked the transport type (UDP vs DERP), not what they were. Change-Id: Ia4430c1c53afd4634e2d9893d96751a885d77955 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
parent
81bc812402
commit
c7f5bc0f69
@ -1801,6 +1801,14 @@ func (c *Conn) sendDiscoMessage(dst netaddr.IPPort, dstKey key.NodePublic, dstDi
|
|||||||
} else {
|
} else {
|
||||||
metricSentDiscoUDP.Add(1)
|
metricSentDiscoUDP.Add(1)
|
||||||
}
|
}
|
||||||
|
switch m.(type) {
|
||||||
|
case *disco.Ping:
|
||||||
|
metricSentDiscoPing.Add(1)
|
||||||
|
case *disco.Pong:
|
||||||
|
metricSentDiscoPong.Add(1)
|
||||||
|
case *disco.CallMeMaybe:
|
||||||
|
metricSentDiscoCallMeMaybe.Add(1)
|
||||||
|
}
|
||||||
} else if err == nil {
|
} else if err == nil {
|
||||||
// Can't send. (e.g. no IPv6 locally)
|
// Can't send. (e.g. no IPv6 locally)
|
||||||
} else {
|
} else {
|
||||||
@ -4047,13 +4055,16 @@ func (di *discoInfo) setNodeKey(nk key.NodePublic) {
|
|||||||
metricRecvDataIPv6 = clientmetric.NewCounter("magicsock_recv_data_ipv6")
|
metricRecvDataIPv6 = clientmetric.NewCounter("magicsock_recv_data_ipv6")
|
||||||
|
|
||||||
// Disco packets
|
// Disco packets
|
||||||
metricSendDiscoUDP = clientmetric.NewCounter("magicsock_disco_send_udp")
|
metricSendDiscoUDP = clientmetric.NewCounter("magicsock_disco_send_udp")
|
||||||
metricSendDiscoDERP = clientmetric.NewCounter("magicsock_disco_send_derp")
|
metricSendDiscoDERP = clientmetric.NewCounter("magicsock_disco_send_derp")
|
||||||
metricSentDiscoUDP = clientmetric.NewCounter("magicsock_disco_sent_udp")
|
metricSentDiscoUDP = clientmetric.NewCounter("magicsock_disco_sent_udp")
|
||||||
metricSentDiscoDERP = clientmetric.NewCounter("magicsock_disco_sent_derp")
|
metricSentDiscoDERP = clientmetric.NewCounter("magicsock_disco_sent_derp")
|
||||||
metricRecvDiscoBadPeer = clientmetric.NewCounter("magicsock_disco_recv_bad_peer")
|
metricSentDiscoPing = clientmetric.NewCounter("magicsock_disco_sent_ping")
|
||||||
metricRecvDiscoBadKey = clientmetric.NewCounter("magicsock_disco_recv_bad_key")
|
metricSentDiscoPong = clientmetric.NewCounter("magicsock_disco_sent_pong")
|
||||||
metricRecvDiscoBadParse = clientmetric.NewCounter("magicsock_disco_recv_bad_parse")
|
metricSentDiscoCallMeMaybe = clientmetric.NewCounter("magicsock_disco_sent_callmemaybe")
|
||||||
|
metricRecvDiscoBadPeer = clientmetric.NewCounter("magicsock_disco_recv_bad_peer")
|
||||||
|
metricRecvDiscoBadKey = clientmetric.NewCounter("magicsock_disco_recv_bad_key")
|
||||||
|
metricRecvDiscoBadParse = clientmetric.NewCounter("magicsock_disco_recv_bad_parse")
|
||||||
|
|
||||||
metricRecvDiscoUDP = clientmetric.NewCounter("magicsock_disco_recv_udp")
|
metricRecvDiscoUDP = clientmetric.NewCounter("magicsock_disco_recv_udp")
|
||||||
metricRecvDiscoDERP = clientmetric.NewCounter("magicsock_disco_recv_derp")
|
metricRecvDiscoDERP = clientmetric.NewCounter("magicsock_disco_recv_derp")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user