fix(3643) add containerd-snapshotter support#3709
Conversation
iwankgb
left a comment
There was a problem hiding this comment.
I would be more than happy to give it a chance, but I am no longer able to merge PRs in cAdvisor.
|
curious why this isn't merged? |
|
Any news on this ? |
|
is something preventing this from merging? it LOOKS like all's copacetic? |
|
@iwankgb |
cAdvisor Docker 29 Compatibility Fix - ChangelogProblem StatementAfter upgrading to Docker 29.x on Ubuntu 24.04, cAdvisor was unable to monitor Docker containers. Prometheus metrics showed no container data, only the root filesystem metrics. Root Cause: Docker 29.x introduced Error encountered: Reference: #3749 Solution SummaryThe fix involves two key changes:
This allows cAdvisor to monitor containers via systemd cgroup integration instead of relying on the deprecated layerdb metadata. Changes Made1. Create/Update Docker Daemon ConfigurationFile: Before: File did not exist (or had different configuration) After: {
"features": {
"containerd-snapshotter": false
}
}
Action Required: sudo tee /etc/docker/daemon.json > /dev/null << 'EOF'
{
"features": {
"containerd-snapshotter": false
}
}
EOF
Then restart Docker: sudo systemctl restart docker
2. Update cAdvisor Image and ConfigurationFile: Before: cadvisor:
image: gcr.io/cadvisor/cadvisor:v0.45.0
command:
- '--housekeeping_interval=10s'
- '--store_container_labels=true'
After: cadvisor:
image: ghcr.io/google/cadvisor:v0.53.0
command:
- '--housekeeping_interval=10s'
- '--store_container_labels=true'
Key Changes:
Action Required: cd /home/user/docker/prometheus
docker compose up -d cadvisor
docker compose restart cadvisor
Verification Steps1. Verify Docker Configurationcat /etc/docker/daemon.json
Expected output: {
"features": {
"containerd-snapshotter": false
}
}
2. Verify Docker Infodocker info | grep -i snapshotter
Should show: 3. Verify cAdvisor Logsdocker logs prometheus-cadvisor | grep "Registration of the docker container factory"
Expected output: 4. Verify Metrics Collectioncurl -s http://localhost:8029/metrics | grep "container_memory_usage_bytes" | grep "docker-" | head -5
Should show metrics like: 5. Verify Prometheus Scrapingcurl -s 'http://localhost:12090/api/v1/query?query=container_memory_usage_bytes' | jq '.data.result | length'
Should return a number greater than 20 (at least system cgroups + Docker containers) How It Works After FixContainer Monitoring Flow: Key Insight: Instead of reading Docker metadata from layerdb, cAdvisor now reads container resource metrics directly from the systemd cgroup hierarchy. This is actually more reliable and doesn't require Docker-specific metadata. Reverting the Fix (When cAdvisor Fixes containerd-snapshotter Support)When to revert: After cAdvisor releases a version with full containerd-snapshotter support (currently being worked on in PR #3709) Step 1: Re-enable containerd-snapshotter in DockerFile: Change from: {
"features": {
"containerd-snapshotter": false
}
}
Change to: {
"features": {
"containerd-snapshotter": true
}
}
Or delete the file entirely (containerd-snapshotter is the default in Docker 29.x): sudo rm /etc/docker/daemon.json
Restart Docker: sudo systemctl restart docker
Step 2: Update cAdvisor to the Fixed VersionFile: Change from: cadvisor:
image: ghcr.io/google/cadvisor:v0.53.0
command:
- '--housekeeping_interval=10s'
- '--store_container_labels=true'
Change to: cadvisor:
image: ghcr.io/google/cadvisor:v0.55.0 # or newer version with containerd-snapshotter support
command:
- '--housekeeping_interval=10s'
- '--store_container_labels=true'
- '--docker_only=true' # Can re-enable this flag
Note: Replace Step 3: Restart cAdvisorcd /home/user/docker/prometheus
docker compose up -d cadvisor
Step 4: Verifydocker logs prometheus-cadvisor | tail -20
curl -s http://localhost:8029/metrics | grep container_memory_usage_bytes | head -5
Why This Temporary Fix is Safe
Related Issues and PRs
Files Modified
Testing Checklist
Support and MonitoringMonitor these metrics going forward: # Docker container count
curl -s 'http://localhost:12090/api/v1/query?query=container_memory_usage_bytes' | jq '.data.result[] | select(.metric.id | contains("docker-")) | .metric.id' | wc -l
# Disk usage (if concerned about storage)
df -h /var/lib/docker
# Docker info
docker info
Last Updated: November 29, 2025 Status: ✅ Working - cAdvisor v0.53.0 successfully monitoring all Docker containers |
|
please merge it already! |
Fix for: #3643
containerd snapshotteris an experimental feature https://github.com/docker/docs/blob/1da5f51da8a9c40c4318c8cec90b3939f0a25ca2/content/manuals/engine/storage/containerd.md that uses thecontainerdimage store.Using
containerdoffers multiple benefits, primarily multi-platform images and wasm container support.When user containerd-snapshotter,
rootfspoints to the wrong directory leading to error incadvisor:This PR adds support for
overlayfsdriver and retrieves the root path fromcontainerdspec directly. With this PR the containers can be loaded successfully: