Tags: google/cadvisor
Tags
Move OOM watching out of the lib module into the binary 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>
Move OOM watching out of the lib module into the binary 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>
lib/model: make ContainerStats sub-stats pointers to convey collectio… …n presence The collapsed model used value types for the per-subsystem stats (Cpu, Memory, Network, DiskIo, Processes), which cannot express "not collected" versus "collected and zero". Restore pointer fields so a nil signals the subsystem was not collected, matching the info/v2 shape the kubelet relies on. Handlers allocate each pointer when they collect the subsystem; the metrics collector and the v1/v2 REST converters nil-guard their reads. Signed-off-by: Davanum Srinivas <davanum@gmail.com>
lib/model: make ContainerStats sub-stats pointers to convey collectio… …n presence The collapsed model used value types for the per-subsystem stats (Cpu, Memory, Network, DiskIo, Processes), which cannot express "not collected" versus "collected and zero". Restore pointer fields so a nil signals the subsystem was not collected, matching the info/v2 shape the kubelet relies on. Handlers allocate each pointer when they collect the subsystem; the metrics collector and the v1/v2 REST converters nil-guard their reads. Signed-off-by: Davanum Srinivas <davanum@gmail.com>
deploy: add lib/go.mod to the image build's dependency cache The root go.mod replaces github.com/google/cadvisor/lib => ./lib, so the dependency-cache `go mod download` needs lib/go.mod present. The cmd submodule was handled but lib was not, so the container image build failed with "reading lib/go.mod: no such file or directory". Signed-off-by: Davanum Srinivas <davanum@gmail.com>
cmd: build the binary against lib + register the injection seams cmd builds the cAdvisor binary and v1/v2 REST API against lib, registering the perf/resctrl factories, summary reader, process-list and app-metrics providers, the cpu-load reader, and the events.EventManager (via the library's EventSink) into the manager's seams. Signed-off-by: Davanum Srinivas <davanum@gmail.com>
cmd: build the binary against lib + register the injection seams cmd builds the cAdvisor binary and v1/v2 REST API against lib, registering the perf/resctrl factories, summary reader, process-list and app-metrics providers, the cpu-load reader, and the events.EventManager (via the library's EventSink) into the manager's seams. Signed-off-by: Davanum Srinivas <davanum@gmail.com>
deploy: bump base images to Alpine 3.23 Move the build stage and final image to alpine 3.23 (current stable, released 2025-12-03) so that a rebuild picks up: - busybox 1.37.0-r20+ (addresses CVE-2024-58251, BusyBox netstat ANSI-escape DoS) - Go 1.25.10 via golang:1.25-alpine3.23 (addresses CVE-2025-58183, archive/tar unbounded sparse-region allocation, fixed in 1.25.9) Refs #3837 Signed-off-by: Davanum Srinivas <davanum@gmail.com>
docker: fix nil pointer dereference when GraphDriver is nil The migration to github.com/moby/moby modules in b20bcf1 changed GraphDriver from a value type to a pointer type. This causes a nil pointer dereference when Docker doesn't include GraphDriver in the container inspect response (which can happen with certain storage drivers or container configurations). Add a nil check before accessing GraphDriver.Data and log a warning at V(4) verbosity level when GraphDriver is not found. Fixes #3815 Signed-off-by: Davanum Srinivas <davanum@gmail.com>
PreviousNext