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
332 stars 61 forks source link

Issue with hardcoded CRI-O socket path #128

Closed jeinwag closed 2 months ago

jeinwag commented 2 months ago

Hi,

we're currently giving coroot a try. Unfortunately, it doesn't collect any metrics from any kubernetes pods (with CRI-O as the container runtime). I guess this is due to the inability to initialize the CRI-O client:

W0924 13:36:52.417937 2399180 registry.go:91] stat /proc/1/root/var/run/crio/crio.sock: no such file or directory W0924 13:36:52.417937 2399180 registry.go:91] stat /proc/1/root/var/run/crio/crio.sock: no such file or directory

The location of the socket on the host is /run/crio/crio.sock while /var/run is just a symlink to /run, so /1/proc/root/var/run will point to the wrong location (/run of the container's filesystem).

Maybe some kind of retry logic like it does exist for different possible locations of the containerd.sock should be implemented?

def commented 2 months ago

Sure, if you don't mind implementing this, that would be great. Additionally, could you please share details of your system, OS, and CRI-O installation so we can reproduce the issue?

jeinwag commented 2 months ago

Of course: OS: Ubuntu 24.04.01 Kubernetes: 1.30.4 CRI-O: 1.30.3

Kubernetes and CRI-O are deployed via kubespray v2.26.0

Will open a PR tomorrow.