Show CPU, memory and disk usage per instance and per volume - #134
Open
traviswu-bigstack wants to merge 2 commits into
Open
traviswu-bigstack wants to merge 2 commits into
traviswu-bigstack wants to merge 2 commits into
Conversation
The instance list gains one Usage column holding three stacked gauges -- CPU, MEM, DISK -- and the volume list gains an Allocated column. Both read Prometheus directly with one instant query per metric returning every row at once, rather than a request per table row on each render. Gauge colours are the thresholds tpl_alert_vm_disk.tick fires on: blue below 50, green to 75, yellow to 85, red above. Warn and crit collapse into one red band because a row at 90% and a row at 96% both need attention now. A row about to raise a disk alarm looks like it before the alarm exists. Disk falls back when an instance has no qemu-guest-agent. The guest figure is absent for those, so the column uses block allocation instead of reading "-". It is drawn grey and marked, not coloured, because the two are not the same measurement: Ceph keeps a block allocated once written unless the guest passes TRIM through, so allocation runs far ahead of filesystem usage and never comes back down. One measured instance reads 85% allocated against 14.8% used, and fstrim freeing 32.1 GiB inside the guest moved rbd du by nothing. Colouring that red would flag an idle instance, and the disk alarm cannot fire for it anyway -- the alarm streams guest readings, which is exactly what these rows lack. The volume column is named Allocated rather than Usage for the same reason. There is no guest reading to fall back from: a volume is a block device and nothing maps one back to a guest mountpoint, so allocation is the only per-volume figure there is, and calling it "usage" invites reading a fully allocated thin volume as a full one. Signed-off-by: Travis Wu <travis.wu@bigstack.co>
traviswu-bigstack
force-pushed
the
travis.wu/instance-usage-columns
branch
2 times, most recently
from
September 15, 2026 07:40
0f505ad to
8cdd241
Compare
…ures Both the instance list and the volume list now show what the guest reports, and fall back to the block layer only when there is no guest reading. A fallback row carries a "block level" tag after its percentage. The volume list used to show allocation for every row. That is not usage: blocks stay allocated once written, so a volume written end to end reads 100% while its filesystem is nearly empty -- two volumes here read 85% and 100% against guests using 14.8% and less. It now reads the per-volume guest rollup, which the collector keys off the uuid nova writes into the disk's libvirt <serial>. A tag rather than a colour, because colour already carries the alert thresholds. Two meanings on one channel is why the same 100% appeared grey on one page and red on the other: grey meant "different measurement" on the instance list, while the volume list had no fallback concept at all and used the normal scale. One meaning per channel now -- colour is nearness to the alert, the tag is which layer measured it. The tag is a word rather than an icon or a fill pattern: those are only discoverable by hovering, and the figure being marked is precisely the one that has already been misread. A row with neither reading renders "Not measured" and no bar at all. An empty bar sits at zero, which reads as an empty disk rather than as an unanswered question -- the state of a volume on a backend with no usage adapter attached to an instance with no agent. Strings land in en, zh-hant and zh-hans; the tag reads 區塊層級 in Traditional and 区块层级 in Simplified. Signed-off-by: Travis Wu <travis.wu@bigstack.co>
traviswu-bigstack
force-pushed
the
travis.wu/instance-usage-columns
branch
from
September 16, 2026 06:19
8cdd241 to
c031c65
Compare
traviswu-bigstack
marked this pull request as ready for review
September 16, 2026 06:23
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 type of PR is this?
/kind feature
What this PR does / why we need it
The instance list (
/compute/instanceand/compute/instance-admin) gains a single Usage column holding three stacked gauges — CPU, MEM, DISK — and the volume list (/storage/volumeand/storage/volume-admin) gains an Allocated column. Part of the customer request behind bigstack-oss/cubecos#1449: see per-VM space use in the GUI.Both read Prometheus directly, one instant query per metric returning every row at once, so adding the columns costs a fixed number of requests per page rather than one per table row on every render.
Gauge colours are the disk alarm's thresholds (
tpl_alert_vm_disk.tick): blue below 50, green to 75, yellow to 85, red above. Warn and crit collapse into one red band — a row at 90% and a row at 96% both need attention now. A row that is about to raise an alarm looks like it before the alarm exists.Disk falls back when an instance has no qemu-guest-agent, rather than reading
-. The fallback is block allocation, drawn grey and marked with*, deliberately not on the colour scale — see below.Which issue(s) this PR fixes
Part of bigstack-oss/cubecos#1449. The series come from the collector in bigstack-oss/cubecos#1450, which also fixes the
prometheus_endpointinskyline.yaml.in— without that fix every Skyline Prometheus query 404s and all of these columns render-.Special notes for your reviewer
Additional documentation