mirror of
https://github.com/google/cadvisor.git
synced 2026-10-28 16:44:49 +08:00
The lib module is the subset of cAdvisor that the kubelet vendors, and the kubelet does not need cAdvisor to watch for OOMs. It reads /dev/kmsg itself and supplies container_oom_events_total on its own, so the OOM machinery does not belong in lib. Remove watchForNewOoms and the per-container OOM counter from lib/manager, and move the kmsg reader (utils/oomparser) from lib to the root module, which the binary depends on. lib no longer imports github.com/euank/go-kmsg-parser. The cAdvisor binary keeps its OOM events and the container_oom_events_total metric. cmd/internal/api now runs the OOM watcher, feeds OOM and OOM-kill events to the event manager, and wraps the manager so the prometheus collector reports the per-container OOM count. Signed-off-by: Davanum Srinivas <davanum@gmail.com>