diff options
author | Ben Kochie <superq@gmail.com> | 2020-06-04 08:41:53 +0200 |
---|---|---|
committer | Ben Kochie <superq@gmail.com> | 2020-06-04 08:51:39 +0200 |
commit | 204164e4e44cea0d1db041a72f525c90781f823c (patch) | |
tree | 2b29184ce227704645a132fc84eb2cfa00885966 | |
parent | b9c96706a7425383902b6143d097cf6d7cfd1960 (diff) | |
download | prometheus_node_collector-204164e4e44cea0d1db041a72f525c90781f823c.tar.bz2 prometheus_node_collector-204164e4e44cea0d1db041a72f525c90781f823c.tar.xz prometheus_node_collector-204164e4e44cea0d1db041a72f525c90781f823c.zip |
Include TCP OutRsts in netstat metrics
TCP "OutRsts" is the number of TCP Resets sent by the node. This can be
useful for monitoring connection failures and flooding.
Signed-off-by: Ben Kochie <superq@gmail.com>
-rw-r--r-- | CHANGELOG.md | 2 | ||||
-rw-r--r-- | collector/fixtures/e2e-64k-page-output.txt | 3 | ||||
-rw-r--r-- | collector/fixtures/e2e-output.txt | 3 | ||||
-rw-r--r-- | collector/netstat_linux.go | 2 |
4 files changed, 8 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f32b94..36a1ad7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | * [CHANGE] | 3 | * [CHANGE] |
4 | * [FEATURE] | 4 | * [FEATURE] |
5 | * [ENHANCEMENT] | 5 | * [ENHANCEMENT] Include TCP OutRsts in netstat metrics |
6 | * [BUGFIX] | 6 | * [BUGFIX] |
7 | 7 | ||
8 | ## 1.0.0 / 2020-05-25 | 8 | ## 1.0.0 / 2020-05-25 |
diff --git a/collector/fixtures/e2e-64k-page-output.txt b/collector/fixtures/e2e-64k-page-output.txt index 3e9f6cb..fe32915 100644 --- a/collector/fixtures/e2e-64k-page-output.txt +++ b/collector/fixtures/e2e-64k-page-output.txt | |||
@@ -1886,6 +1886,9 @@ node_netstat_Tcp_InErrs 5 | |||
1886 | # HELP node_netstat_Tcp_InSegs Statistic TcpInSegs. | 1886 | # HELP node_netstat_Tcp_InSegs Statistic TcpInSegs. |
1887 | # TYPE node_netstat_Tcp_InSegs untyped | 1887 | # TYPE node_netstat_Tcp_InSegs untyped |
1888 | node_netstat_Tcp_InSegs 5.7252008e+07 | 1888 | node_netstat_Tcp_InSegs 5.7252008e+07 |
1889 | # HELP node_netstat_Tcp_OutRsts Statistic TcpOutRsts. | ||
1890 | # TYPE node_netstat_Tcp_OutRsts untyped | ||
1891 | node_netstat_Tcp_OutRsts 1003 | ||
1889 | # HELP node_netstat_Tcp_OutSegs Statistic TcpOutSegs. | 1892 | # HELP node_netstat_Tcp_OutSegs Statistic TcpOutSegs. |
1890 | # TYPE node_netstat_Tcp_OutSegs untyped | 1893 | # TYPE node_netstat_Tcp_OutSegs untyped |
1891 | node_netstat_Tcp_OutSegs 5.4915039e+07 | 1894 | node_netstat_Tcp_OutSegs 5.4915039e+07 |
diff --git a/collector/fixtures/e2e-output.txt b/collector/fixtures/e2e-output.txt index df04679..0edc65b 100644 --- a/collector/fixtures/e2e-output.txt +++ b/collector/fixtures/e2e-output.txt | |||
@@ -1955,6 +1955,9 @@ node_netstat_Tcp_InErrs 5 | |||
1955 | # HELP node_netstat_Tcp_InSegs Statistic TcpInSegs. | 1955 | # HELP node_netstat_Tcp_InSegs Statistic TcpInSegs. |
1956 | # TYPE node_netstat_Tcp_InSegs untyped | 1956 | # TYPE node_netstat_Tcp_InSegs untyped |
1957 | node_netstat_Tcp_InSegs 5.7252008e+07 | 1957 | node_netstat_Tcp_InSegs 5.7252008e+07 |
1958 | # HELP node_netstat_Tcp_OutRsts Statistic TcpOutRsts. | ||
1959 | # TYPE node_netstat_Tcp_OutRsts untyped | ||
1960 | node_netstat_Tcp_OutRsts 1003 | ||
1958 | # HELP node_netstat_Tcp_OutSegs Statistic TcpOutSegs. | 1961 | # HELP node_netstat_Tcp_OutSegs Statistic TcpOutSegs. |
1959 | # TYPE node_netstat_Tcp_OutSegs untyped | 1962 | # TYPE node_netstat_Tcp_OutSegs untyped |
1960 | node_netstat_Tcp_OutSegs 5.4915039e+07 | 1963 | node_netstat_Tcp_OutSegs 5.4915039e+07 |
diff --git a/collector/netstat_linux.go b/collector/netstat_linux.go index 9b4be49..60bdbea 100644 --- a/collector/netstat_linux.go +++ b/collector/netstat_linux.go | |||
@@ -34,7 +34,7 @@ const ( | |||
34 | ) | 34 | ) |
35 | 35 | ||
36 | var ( | 36 | var ( |
37 | 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|PassiveOpens|RetransSegs|CurrEstab)|Udp6?_(InDatagrams|OutDatagrams|NoPorts|RcvbufErrors|SndbufErrors))$").String() | 37 | 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() |
38 | ) | 38 | ) |
39 | 39 | ||
40 | type netStatCollector struct { | 40 | type netStatCollector struct { |