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
294 stars 54 forks source link

RSS memory calculation overflow for some low in resource usage processes #84

Closed btmc closed 4 weeks ago

btmc commented 1 month ago

For some nodes in my setup in node view, Memory consumers, bytes graph I see some processes have 18.45E memory consumption, so the graph gets unusable.

My nodes in question run on Debian 11, using cgroups v2.

It seems to be a consequence of current RSS calculation in the agent here, wherein RSS is calculated as: current - vars["file"],.

For example, for system-getty.slice cgroup I see:

cat /sys/fs/cgroup/system.slice/system-getty.slice/memory.current
249856
cat /sys/fs/cgroup/system.slice/system-getty.slice/memory.stat | grep ^file\
file 270336

So subtraction gives negative result.

def commented 1 month ago

@btmc thank you for the report. We'll take a look ASAP