coroot / coroot-node-agent

A Prometheus exporter based on eBPF that gathers comprehensive container metrics
https://coroot.com/docs/metrics/node-agent
Apache License 2.0
311 stars 55 forks source link

Fix TCP connection timestamp handling #24

Closed def closed 1 year ago

def commented 1 year ago

While using a non-blocking TCP connect, there can be excessive connect() calls, which invalidate the valid timestamps in the eBPF map. However, since we use BPF_MAP_TYPE_LRU_HASH, I've removed this invalidation.

[pid 3867078] connect(14, {sa_family=AF_INET, sin_port=htons(8080), sin_addr=inet_addr("10.43.10.151")}, 16) = -1 EINPROGRESS (Operation now in progress)
[pid 3867078] getsockopt(14, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
[pid 3867078] connect(14, {sa_family=AF_INET, sin_port=htons(8080), sin_addr=inet_addr("10.43.10.151")}, 16) = 0