Host metrics on the host card (load, disk, network, uptime)
Hi! First off, thanks for Dozzle — it's excellent. I forked it to add host-level metrics that complement the per-container CPU/memory/network you already show, and I'd love to contribute it upstream if you're open to it.
What it adds
The host card currently shows CPU and Memory. I added four more facts for the host:
- Disk (used/total with a usage bar)
- Load (1m / 5m / 15m)
- Uptime
- Network (rx / tx totals)
Rendered as tiles matching the existing CPU/Memory cards. (I'll attach a screenshot in a follow-up comment.)
How it works
- Backend (Go): new fields on
container.Host(memUsed,load1/5/15,uptime,diskTotal/diskFree,netRxTotal/netTxTotal), populated for the local host by reading/proc/loadavg,/proc/uptime,/proc/meminfo,/proc/net/dev, plusstatfsfor the root filesystem (reusing the existingstatfshelper). The host is already serialized to the UI, so the fields flow through automatically. - Frontend (Vue): a small tiles row in
HostCard.vue.
Important caveat
To report the host's values (not the container's), the Dozzle container needs the host /proc and root mounted, e.g.:
volumes:
- /proc:/host/proc:ro
- /:/host/root:roWithout those mounts it falls back to /proc (container values). So this would likely need to be opt-in and documented.
Open questions
- Would you want this at all, or is host metrics out of scope for Dozzle?
- If yes: opt-in via env flag, or always-on when the host mounts are present?
- UI: tiles on the host card (what I did), or a different placement?
- Scope: I only did the local host. Remote/agent hosts can be a follow-up through the agent protocol — fine to leave out of a first PR?
- I'll follow your conventions (i18n, component tests, etc.) before opening the PR.
Happy to adjust the approach based on your preference. Thanks!
Source: amir20/dozzle