I'm currently trying to export prometheus metrics for TCP-related stats - that which can be found by polling /proc/net/tcp - and I'm finding that the sockets returned within the context of my main container process do NOT include those exposed by the docker container for my service code. I'm primarily interested in the status of TCP connections relating to the ports exposed by my service, but those seem inexplicably missing.
I'm leveraging a library from the prometheus project (procfs) and the sockets returned from the NetTCP() function, which effectively reads /proc/net/tcp, does not include information related to the ports I'm exposing for my service code.
Conversely, running kubectl exec <pod> -- netstat -tulpn does show the sockets associated with my exposed ports.
Can anyone provide insight regarding why the sockets of interest are not included in the results from /proc/net/tcp when reading it from service code?
Tried:
Called NetTCP() to inspect TCP information from within my service code
Expected:
Sockets information for the ports exposed by my service
Actual:
Sockets information for other processes/ports, but not for the ports exposed by my service.