docker: keep metadata when containerd socket is unavailable - #3910
docker: keep metadata when containerd socket is unavailable#3910U-S-jun wants to merge 1 commit into
Conversation
Keep the Docker factory registered when the containerd snapshotter socket cannot be reached. Disable Docker disk usage metrics for that factory so container names and labels remain available through Docker inspect.
1acbdad to
fc91a45
Compare
|
Confirming this on a second runtime, OrbStack rather than Docker Desktop, on the current release. Same root cause, and in one configuration the outcome is worse than described. EnvironmentThe failure, verbatimOrbStack exposes a Docker socket but no containerd socket, so the Docker factory aborts even though With
|
Summary
Keep Docker metadata collection available when cAdvisor detects the
containerd snapshotter storage driver (
overlayfs) but cannot connect tothe containerd socket.
This is a follow-up to #3709.
Problem
In the reproduced Docker Desktop environment, the Docker API is available
through
/var/run/docker.sockand reportsoverlayfsas the storagedriver, but
/run/containerd/containerd.sockis not exposed to thecAdvisor container.
cAdvisor currently treats failure to create the containerd client as a
Docker factory registration failure:
The raw cgroup handler continues to expose resource metrics, but Docker
metadata is unavailable because the Docker handler is never created.
Before this change, metrics only contained the cgroup path:
The container name, image, Docker labels, and Compose labels were missing.
Fix
DiskUsageMetricsfor the Docker factory instead of aborting registration.Docker
ContainerInspect.overlayfsDocker handler without acontainerd client or disk usage metrics.
After this change, Docker factory registration succeeds and metadata is
restored:
Degraded behavior
When the containerd socket is unavailable, per-container disk usage metrics
such as
container_fs_usage_bytes, filesystem limits, and inode usage arenot reported.
CPU, memory, disk I/O, container names, images, and Docker/Compose labels
remain available.
Testing
go test -count=1 ./container/dockercd lib && go test -count=1 ./container/... ./manager ./metricsdeploy/Dockerfileoverlayfsstorage driver
connection warning
name, image, Compose service, and custom Docker labels arepresent in Prometheus metrics