Skip to content

fix: show disk usage in the top bar alongside CPU and memory - #67

Merged
catinspace-au merged 1 commit into
mainfrom
fix/astra-monitor-disk-usage
Aug 27, 2026
Merged

fix: show disk usage in the top bar alongside CPU and memory#67
catinspace-au merged 1 commit into
mainfrom
fix/astra-monitor-disk-usage

Conversation

@catinspace-au

Copy link
Copy Markdown
Contributor

The panel monitored CPU and memory and hid storage, so the one resource that fills up silently and takes the machine down with it was the one nobody could see.

Storage now shows an icon and a usage bar, matching how memory renders.

Why every key is set explicitly

Astra's storage section is built around throughput, not usage. Its update interval is literally named "Storage IO", the header graph is an IO graph, and the usage percentage ships off. Taking the defaults gives you a kB/s readout, not a fullness one, so all nine keys are stated rather than inherited.

Key Set to
storage-header-show true show it at all
storage-header-bars true the usage bar
storage-header-percentage / -value / -free false no numbers next to the icon
storage-header-io / -io-bars / -graph false the throughput indicators
storage-ignored-regex ^(loop|ram|zram|sr|fd)[0-9] see below

Two things deliberately NOT configured

storage-main -- the device the bar tracks. Left alone, the extension resolves the root filesystem itself and stores a persistent per-disk id. Pinning it here would stamp one machine's disk onto every machine. Observed resolving on its own:

  • bare metal -> eui.ace42e003107a6f02ee4ac0000000001-part5
  • VM -> 0QEMU_QEMU_HARDDISK_drive-scsi0-part1

A device allowlist -- there isn't one, and shouldn't be. Devices are excluded by CLASS instead. loop, ram, zram, sr and fd mean the same thing on bare metal and in a VM, so whatever real disks a host has are simply what is left over. A workstation with snaps installed carries 25 loop devices otherwise.

That pair is what makes this portable rather than a list copied off one machine.

Verified

Applied on four hosts (one bare metal, three VMs). The bar reads the root filesystem and nothing else. The role run reported all nine keys changed, failed=0, and tools/ci/run-tests.sh is green.

One caveat worth recording: Astra keeps a profiles JSON blob, and Config.syncCurrentProfile() writes that blob back over the live keys. Reading the extension source, it runs only on import-settings, reset-settings, reset-profile and an explicit profile switch -- never at startup -- and it returns early when profiles is empty, which it is on a fresh machine. So these settings survive a shell restart, but a user who switches Astra profiles by hand will revert them.

The panel monitored CPU and memory and hid storage, so the one resource that
fills up silently and takes the machine down with it was the one nobody could
see.

Storage now shows an icon and a usage bar, matching how memory renders. Every
indicator key is set explicitly rather than left to its default, because
Astra's storage section is built around throughput rather than usage: the
update interval is named "Storage IO", the header graph is an IO graph, and
the usage percentage ships off. Taking the defaults would have produced a
kB/s readout, not a fullness one.

Two things are deliberately NOT configured:

  storage-main -- the device the bar tracks. Left alone the extension resolves
  the root filesystem itself and stores a persistent per-disk id, which comes
  out as an NVMe EUI on a laptop and a QEMU disk id on a VM. Pinning it here
  would stamp one machine's disk onto every machine.

  The device allowlist -- there isn't one. Devices are excluded by CLASS
  instead (loop, ram, zram, sr, fd), which means the same thing on bare metal
  and in a VM, so whatever real disks a host has are simply what is left. A
  workstation with snaps installed carries 25 loop devices otherwise.

Verified on four hosts. The bar reads the root filesystem and nothing else,
and storage-main resolved per host without being told:
bare metal to eui.ace42e00...-part5, VMs to 0QEMU_QEMU_HARDDISK_drive-scsi0-part1.
@catinspace-au
catinspace-au merged commit 12733eb into main Aug 27, 2026
16 checks passed
@catinspace-au
catinspace-au deleted the fix/astra-monitor-disk-usage branch August 27, 2026 05:57
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.

1 participant