mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-25 19:15:34 +00:00
sockstats: add labels for netlog and sockstatlog packages
Signed-off-by: Will Norris <will@tailscale.com>
This commit is contained in:
parent
38e4d303a2
commit
e99c7c3ee5
@ -125,6 +125,7 @@ func NewLogger(logdir string, logf logger.Logf, logID logid.PublicID) (*Logger,
|
||||
|
||||
HTTPC: &http.Client{Transport: logger.tr},
|
||||
}, logf)
|
||||
logger.logger.SetSockstatsLabel(sockstats.LabelSockstatlogLogger)
|
||||
|
||||
return logger, nil
|
||||
}
|
||||
|
@ -18,11 +18,13 @@ func _() {
|
||||
_ = x[LabelPortmapperClient-7]
|
||||
_ = x[LabelMagicsockConnUDP4-8]
|
||||
_ = x[LabelMagicsockConnUDP6-9]
|
||||
_ = x[LabelNetlogLogger-10]
|
||||
_ = x[LabelSockstatlogLogger-11]
|
||||
}
|
||||
|
||||
const _Label_name = "ControlClientAutoControlClientDialerDERPHTTPClientLogtailLoggerDNSForwarderDoHDNSForwarderUDPNetcheckClientPortmapperClientMagicsockConnUDP4MagicsockConnUDP6"
|
||||
const _Label_name = "ControlClientAutoControlClientDialerDERPHTTPClientLogtailLoggerDNSForwarderDoHDNSForwarderUDPNetcheckClientPortmapperClientMagicsockConnUDP4MagicsockConnUDP6NetlogLoggerSockstatlogLogger"
|
||||
|
||||
var _Label_index = [...]uint8{0, 17, 36, 50, 63, 78, 93, 107, 123, 140, 157}
|
||||
var _Label_index = [...]uint8{0, 17, 36, 50, 63, 78, 93, 107, 123, 140, 157, 169, 186}
|
||||
|
||||
func (i Label) String() string {
|
||||
if i >= Label(len(_Label_index)-1) {
|
||||
|
@ -48,6 +48,8 @@ type SockStat struct {
|
||||
LabelPortmapperClient Label = 7 // net/portmapper/portmapper.go
|
||||
LabelMagicsockConnUDP4 Label = 8 // wgengine/magicsock/magicsock.go
|
||||
LabelMagicsockConnUDP6 Label = 9 // wgengine/magicsock/magicsock.go
|
||||
LabelNetlogLogger Label = 10 // wgengine/netlog/logger.go
|
||||
LabelSockstatlogLogger Label = 11 // log/sockstatlog/logger.go
|
||||
)
|
||||
|
||||
// WithSockStats instruments a context so that sockets created with it will
|
||||
|
@ -19,6 +19,7 @@
|
||||
"tailscale.com/logpolicy"
|
||||
"tailscale.com/logtail"
|
||||
"tailscale.com/net/connstats"
|
||||
"tailscale.com/net/sockstats"
|
||||
"tailscale.com/net/tsaddr"
|
||||
"tailscale.com/smallzstd"
|
||||
"tailscale.com/tailcfg"
|
||||
@ -121,6 +122,7 @@ func (nl *Logger) Startup(nodeID tailcfg.StableNodeID, nodeLogID, domainLogID lo
|
||||
IncludeProcID: true,
|
||||
IncludeProcSequence: true,
|
||||
}, log.Printf)
|
||||
nl.logger.SetSockstatsLabel(sockstats.LabelNetlogLogger)
|
||||
|
||||
// Startup a data structure to track per-connection statistics.
|
||||
// There is a maximum size for individual log messages that logtail
|
||||
|
Loading…
Reference in New Issue
Block a user