add metrics for the udp sockets using SO_MEMINFO (#390)

Retrieve the current socket stats using SO_MEMINFO and report them as
metrics gauges. If SO_MEMINFO isn't supported, we don't report these metrics.
This commit is contained in:
Wade Simmons
2021-03-01 19:51:33 -05:00
committed by GitHub
parent ecfb40f29c
commit d232ccbfab
3 changed files with 69 additions and 0 deletions

View File

@ -268,8 +268,13 @@ func (f *Interface) reloadFirewall(c *Config) {
func (f *Interface) emitStats(i time.Duration) {
ticker := time.NewTicker(i)
udpStats := NewUDPStatsEmitter(f.writers)
for range ticker.C {
f.firewall.EmitStats()
f.handshakeManager.EmitStats()
udpStats()
}
}