Add connection count to base OS checks.
Would be nice if dd-agent also got the amount of connections and added it to its "base" of stats to check, like disk space and memory today. Either something from netstat or fetch the data from proc. Maybe group on type, TCP/UDP and such.
$ cat /proc/net/sockstat
sockets: used 786
TCP: inuse 702 orphan 0 tw 4346 alloc 703 mem 382
UDP: inuse 22 mem 2
UDPLITE: inuse 0
RAW: inuse 0
FRAG: inuse 0 memory 0
Hi @drohr, We are thinking about it and there is a lot of way to do that. Does specific information (TCP/UDP, connection state, ...) really interest you?
On TCP/UDP, I think most users don't really care about UDP stuff, as its, UDP. So either look for just TCP connections or group on connection type.
On the connection type, I would guess you would like to create an alert based on if you have a large number of TIMED_WAIT. But this could of course be triggered inside your application instead. Information about current ESTABLISHED connections is always useful.
Other information that could be useful is group by port number.
Example what it could look like, but this really depends on what features you want to add, and how stuff is implemented. But I would love to hear some of your ideas.

system.net.connections_tcp system.net.connections_udp
and then being able to split it by connection state
New networks metrics were added to the last release.
By default, we have 4 new metrics : system.net.packet_(in|out).(count|error). Interfaces defined in excluded_interface in conf.d/network.yaml won't return these metrics.
You can also enable tracking of TCP/UDP connections. In conf.d/network.yaml, set collect_connection_state: true. It will report a connection count by IPv4/IPv6, TCP/UDP and TCP state. Right now, it only works on Linux.
any chance to add this functionality in windows @LotharSee ?
Note that this issue requests the number of TCP connections but it was closed after the number of packets sent/received was added. Could the number of connections be added, please?
Bump
This should be reopened, it doesn't address the original ask. The ask was for individual tallys for specific ports, not just the aggregations of all ports in the given states.