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
314 stars 56 forks source link

k3s compatibility #2

Closed rlex closed 1 year ago

rlex commented 1 year ago

I'm not sure if it related to k3s, but my testlab is running it, so here is some report:

Installed coroot from ymls provided in docs. Looks like everything started and works correctly, pods are in ready state, UI opens. Specified prometheus - it works. Also, added podmonitor since i use prometheus-operator. Coroot node-agent targets are green and scraping as expected.

However, i got alot of those errors in node-agent logs:

I0917 01:17:31.021970  589105 registry.go:222] got cgroup by pid 603314 -> /kubepods.slice/kubepods-burstable.slice/kubepods-burstable-pod62c5feb2_0cb6_4693_876c_4b54014e085e.slice/cri-containerd-22ebc6fd6681fe43a65f392647adf215c94c4e263bbbd7cbd4cce0980022bfb7.scope
W0917 01:17:31.022457  589105 registry.go:230] failed to interact with dockerd (%!s(<nil>)) or with containerd (%!s(<nil>))

Additionally, my map looks like this:

Screenshot 2022-09-17 at 04 20 42

10.251.x.x is my pod network, backed by cilium.

And if i go to app details, i receive this:

Screenshot 2022-09-17 at 04 21 22

One thing that comes to mind is that k3s have non-standard containerd socket, /run/k3s/containerd/containerd.sock (default containerd is /run/containerd/containerd.sock), but i can't find any hardcode in node-agent code.

def commented 1 year ago

Thanks for the bug report! As you suggested, the issue was related to the containerd socket path.