Repository navigation
feat(monitoring): disk usage history by category, with image and build cache cleanup - #69
Merged
agentHits merged 1 commit intoOct 13, 2026
Conversation
…d cache cleanup on the Monitoring page The Disk Space card on the Monitoring page showed one number and a chart of the last few minutes, recorded only while the page was open. It could not answer what filled the disk over a day or a week, and its number did not match the Docker disk usage card under it. History. The panel now samples the disk in the background: the used space every minute, Docker's image, container and build cache sizes every five minutes, and once an hour the parts that need a walk over files (volumes, container logs, Dokploy's own data, swap files). When the used space moves by 0.5% of the disk (at least 256 MiB) since the last saved sample, the next sample is taken on that minute, so a short spike is recorded with its breakdown. A probe never takes more than 2% of the time: after a slow one the sampler waits fifty times its duration. Samples are kept for 30 days as JSON lines under the monitoring directory; "Clean Monitoring" removes them with the rest. Docker is asked through the Engine API, so no docker CLI process holds up the cleanup commands that wait for Docker to be idle. Container logs live under Docker's root directory, which the panel's container does not see; a throwaway busybox container with that directory mounted read-only measures them. When it cannot run, the logs stay in "System and other". Card. It shows the used space split into images, build cache, volumes, container logs, container files, Dokploy data, swap files and "System and other", and the rows add up to the used space. A stacked bar chart covers 1, 3, 7 or 30 days; each bar is the fullest moment of its interval. A table gives the change of every category over the period, and a list names the images, volumes and containers that grew or shrank the most. Sizes are in decimal units, as Docker prints them; the old card counted in GiB and labelled the result GB, which is one reason the two cards disagreed. Build cache is counted without the records that images share, which Docker's total counts twice. Cleanup. The block that removes old Dokploy images and, on request, the build cache was reachable only from the update dialog. It is now also in the Disk Space card, where it lists the builds it removes. After a cleanup the disk is sampled at once, so the card shows the freed space. The Docker disk usage chart takes the colours of the same categories in the new card. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
agentHits
deleted the
claude-test/disk-monitoring-image-cleanup-504338
branch
October 13, 2026 17:15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes
Disk Space card on the Monitoring page. It now answers two questions the old card could not: what takes the disk, and what filled it over a period.
Background sampling. The history is collected by the panel process, not by an open page:
statfs)A probe never takes more than 2% of the time: after a slow one the sampler waits fifty times its duration. Samples are kept for 30 days as JSON lines in
monitoring/disk-history/.Why the two cards disagreed
Notes for review
GET /system/dfwith atypefilter), so nodockerCLI process delays the cleanup commands that wait for Docker to be idle.busyboxcontainer with that directory mounted read-only measures them once an hour. If it cannot run, the logs stay in "System and other".settings.getDiskUsageHistoryis an admin procedure, classified "read".UpdateDiskSpacegainedoldImages;freeUpdateDiskSpacesamples the disk after a cleanup so the card shows the freed space at once.docker-disk-chart.tsxis removed; the new card replaces it.Testing
disk-usage.test.ts), sampler, storage and query (disk-history.test.ts), formatting and axes (disk-usage-format.test.ts).bun run typecheckpasses for all workspaces.application.real.test.tsneeds swarm and timed out, andacme-delete-docker.test.tsfailed once under that load and passes when run alone./system/dfanswer was checked on a Docker 29.4 daemon with the overlay2 driver.Not tested: the card inside a running panel with real history. That needs a deployed build.
🤖 Generated with Claude Code