prometheus / procfs

procfs provides functions to retrieve system, kernel and process metrics from the pseudo-filesystem proc.
Apache License 2.0
756 stars 311 forks source link

support UDP drops #506

Closed funkiestj closed 7 months ago

funkiestj commented 1 year ago

on newer linux systems /proc/net/udp (and /proc/net/udp6) have a drop column on the far right:


$ uname -a
Linux ip-172-31-10-56 5.4.0-1045-aws #47~18.04.1-Ubuntu SMP Tue Apr 13 15:58:14 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux 

$ cat /proc/net/udp
  sl  local_address rem_address   st tx_queue rx_queue tr tm->when retrnsmt   uid  timeout inode ref pointer drops
 4000: 3500007F:0035 00000000:0000 07 00000000:00000000 00:00000000 00000000   101        0 256693 2 0000000000000000 0
 4015: 380A1FAC:0044 00000000:0000 07 00000000:00000000 00:00000000 00000000   100        0 1016179 2 0000000000000000 0
 5890: 0100007F:8797 0100007F:C351 01 00000000:00000000 00:00000000 00000000  1001        0 1016395 2 0000000000000000 0
 8736: 00000000:12B5 00000000:0000 07 00000000:00000000 00:00000000 00000000     0        0 32052 2 0000000000000000 0
12419: 00000000:2118 00000000:0000 07 00000000:00000000 00:00000000 00000000     0        0 24157 2 0000000000000000 0
alebsys commented 1 year ago

@discordianfish, can you please assign this to me? tnx

alebsys commented 1 year ago

The TCP and UDP interfaces are very different after the inode column in /proc/net/udp | /proc/net/tcp files. Maybe it's worth creating separate structures for UDP and TCP instead of a single netIPSocketLine? Otherwise, it breaks the logic in the tests at the stage of DeepEqual comparison.