Open msgrt opened 2 months ago
I'd guess that the Docker API doesn't provide the usage
key anymore. You could debug this by printing the value of stats
inside print_containers_memory
.
Although, I see in the API docs that there should be a usage
key, so 🤷 https://docs.docker.com/engine/api/v1.46/#tag/Container/operation/ContainerStats
You can see what the Docker API is providing like this:
curl --unix-socket /var/run/docker.sock http://localhost/v1.46/containers/<container ID>/stats | jq --color-output .
Thank you very much @kenyon . Unfortunately no usage values here. I have tested with all the containers I have running. The last 4 values given in the example in the documentation (max_usage, usage, failcnt, limit) are missing for me.
"memory_stats": {
"stats": {
"active_anon": 0,
"active_file": 0,
"anon": 0,
"anon_thp": 0,
"file": 0,
"file_dirty": 0,
"file_mapped": 0,
"file_writeback": 0,
"inactive_anon": 0,
"inactive_file": 0,
"kernel_stack": 0,
"pgactivate": 0,
"pgdeactivate": 0,
"pgfault": 0,
"pglazyfree": 0,
"pglazyfreed": 0,
"pgmajfault": 0,
"pgrefill": 0,
"pgscan": 0,
"pgsteal": 0,
"shmem": 0,
"slab": 0,
"slab_reclaimable": 0,
"slab_unreclaimable": 0,
"sock": 0,
"thp_collapse_alloc": 0,
"thp_fault_alloc": 0,
"unevictable": 0,
"workingset_activate": 0,
"workingset_nodereclaim": 0,
"workingset_refault": 0
}
},
docker_ plugin stops the execution in the memory section with the following error:
Raspberry OS/Debian Bookworm Docker CE 27.1.2 Python 3.11.2
Any ideas how to get this to work?