From 4065902fe5bf6fff0cabf5be2a948506684af158 Mon Sep 17 00:00:00 2001 From: Martin Kennelly Date: Thu, 18 Nov 2021 08:34:55 +0000 Subject: [PATCH] Add TCPTimeouts to netstat default filter (#2189) TCP timeouts count is a useful signal to show abnormal network performance and is another signal to aid debugging. This metric can be used to generate proactive alerts for host network namespace workloads. Signed-off-by: Martin Kennelly --- CHANGELOG.md | 1 + collector/fixtures/e2e-output.txt | 3 +++ collector/netstat_linux.go | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 26e8b2f8..9c091932 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ * [ENHANCEMENT] * [BUGFIX] + [CHANGE] Add TCPTimeouts to netstat default filter #2189 * [ENHANCEMENT] Add flag to disable guest CPU metrics #2123 * [ENHANCEMENT] Add DMI collector #303 * [BUGFIX] Fix possible panic on macOS #2133 diff --git a/collector/fixtures/e2e-output.txt b/collector/fixtures/e2e-output.txt index 81e1f55b..779eb3b6 100644 --- a/collector/fixtures/e2e-output.txt +++ b/collector/fixtures/e2e-output.txt @@ -2240,6 +2240,9 @@ node_netstat_TcpExt_SyncookiesRecv 0 # HELP node_netstat_TcpExt_SyncookiesSent Statistic TcpExtSyncookiesSent. # TYPE node_netstat_TcpExt_SyncookiesSent untyped node_netstat_TcpExt_SyncookiesSent 0 +# HELP node_netstat_TcpExt_TCPTimeouts Statistic TcpExtTCPTimeouts. +# TYPE node_netstat_TcpExt_TCPTimeouts untyped +node_netstat_TcpExt_TCPTimeouts 115 # HELP node_netstat_Tcp_ActiveOpens Statistic TcpActiveOpens. # TYPE node_netstat_Tcp_ActiveOpens untyped node_netstat_Tcp_ActiveOpens 3556 diff --git a/collector/netstat_linux.go b/collector/netstat_linux.go index 28a97fba..a034ab64 100644 --- a/collector/netstat_linux.go +++ b/collector/netstat_linux.go @@ -36,7 +36,7 @@ const ( ) var ( - netStatFields = kingpin.Flag("collector.netstat.fields", "Regexp of fields to return for netstat collector.").Default("^(.*_(InErrors|InErrs)|Ip_Forwarding|Ip(6|Ext)_(InOctets|OutOctets)|Icmp6?_(InMsgs|OutMsgs)|TcpExt_(Listen.*|Syncookies.*|TCPSynRetrans)|Tcp_(ActiveOpens|InSegs|OutSegs|OutRsts|PassiveOpens|RetransSegs|CurrEstab)|Udp6?_(InDatagrams|OutDatagrams|NoPorts|RcvbufErrors|SndbufErrors))$").String() + netStatFields = kingpin.Flag("collector.netstat.fields", "Regexp of fields to return for netstat collector.").Default("^(.*_(InErrors|InErrs)|Ip_Forwarding|Ip(6|Ext)_(InOctets|OutOctets)|Icmp6?_(InMsgs|OutMsgs)|TcpExt_(Listen.*|Syncookies.*|TCPSynRetrans|TCPTimeouts)|Tcp_(ActiveOpens|InSegs|OutSegs|OutRsts|PassiveOpens|RetransSegs|CurrEstab)|Udp6?_(InDatagrams|OutDatagrams|NoPorts|RcvbufErrors|SndbufErrors))$").String() ) type netStatCollector struct {