Skip to content

feat(#105): Docker storage usage in detailed health endpoint#122

Merged
dennisonbertram merged 1 commit intomainfrom
issue-105-docker-storage-health
Mar 21, 2026
Merged

feat(#105): Docker storage usage in detailed health endpoint#122
dennisonbertram merged 1 commit intomainfrom
issue-105-docker-storage-health

Conversation

@dennisonbertram
Copy link
Owner

Summary

  • Adds docker_disk and docker_storage fields to detailed health response
  • Reports Docker images, containers, volumes, and build cache sizes
  • Adds DiskUsage method to Docker client interface
  • Degrades health status to "degraded" if Docker disk > 90%
  • 7 new tests

Test plan

Add docker_disk (filesystem-level /var/lib/docker stats), docker_storage
(Docker API breakdown: images_size_bytes, containers_size_bytes,
volumes_size_bytes, build_cache_size_bytes, total_size_gb) to the
detailed health response. Either disk path exceeding 90% triggers
"degraded" status. Adds DiskUsage method to docker.Client interface.

Closes #105

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d6e20c892a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


for _, img := range du.Images {
if img != nil {
usage.ImagesSize += img.Size

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use unique image bytes when aggregating Docker image usage

DiskUsage() sums img.Size for every image entry, but image.Summary.Size is the full size of each image including shared layers, so hosts with many images sharing base layers will have those bytes counted multiple times. This inflates ImagesSize and therefore docker_storage.total_size_gb, making the detailed health endpoint report significantly higher usage than what Docker actually stores on disk in common multi-image environments.

Useful? React with 👍 / 👎.

@dennisonbertram dennisonbertram merged commit 908080e into main Mar 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(health): include Docker storage usage in detailed health endpoint

1 participant