Why Monitoring Wants a Raw Byte Count
An exporter has no opinion about prefixes. node_filesystem_avail_bytes, container_memory_usage_bytes, the block counts behind a filesystem quota — each is a plain integer of bytes. The moment "alert when the data volume drops below 50 GB free" has to become something a rule file or a quota script can evaluate, that sentence needs rewriting as digits.
50 × 1 000 000 000 = 50 000 000 000, so the expression reads node_filesystem_avail_bytes{mountpoint="/data"} < 50000000000.Gauges Ship in Base Units
_bytes holds bytes and nothing else. Dashboards add a human-readable prefix at display time; the stored series stays raw.One Zero Too Few Is an Incident
The Same Figure Lands in Three Places
Getting a Paste-Ready Number for a Rule File
Enter the Threshold as a Human Would Say It
Type the gigabyte figure from the capacity ticket — 5, 20, 50, 250. Fractions work too: 2.5 GB parses with either a dot or a comma.
Read the Byte Count
The byte side updates live, with digits grouped so you can confirm the magnitude at a glance. From 10 GB upward the display switches to scientific notation, which PromQL happily accepts as 1e10.
Copy the Integer, Not the Formatting
The copy button returns the bare number with no unit and no grouping spaces — exactly what a YAML expression, a JSON value or a shell variable expects.
Read an Existing Gauge Backwards
Swap the direction, or simply type into the byte field, and a value scraped from a metrics endpoint comes back as gigabytes you can put in an incident note.
Both directions, one page: the fields are independent inputs, so nothing stops you pasting 17 179 869 184 from a dashboard into the byte side to find it is about 17.18 GB, then adjusting the gigabyte side until you have the round threshold you want to standardise on.
Threshold Table for Alert Rules and Quotas
These are the round gigabyte figures that keep reappearing in rule files and quota scripts. Free-space alerts are often written as a percentage, but an absolute byte floor is what stops a 20 TB array from paging only when 200 GB — an hour of ingest — is left.
| Threshold | Bytes | Where it usually lands |
|---|---|---|
| 1 GB | 1 000 000 000 | Last-resort critical page on a small root volume |
| 5 GB | 5 000 000 000 | Warning on a container host's overlay filesystem |
| 10 GB | 10 000 000 000 | Free-space floor under a database data directory |
| 20 GB | 20 000 000 000 | Hard limit on an individual home directory |
| 50 GB | 50 000 000 000 | Per-project quota on a shared build server |
| 100 GB | 100 000 000 000 | Headroom check run before a bulk restore |
| 250 GB | 250 000 000 000 | Capacity-planning ceiling on an artifact volume |
Output Shaped for an Expression
Copy gives the digits alone — nothing to strip, no suffix to confuse a parser that only wants a number on the right of a comparison.
Decode a Firing Alert
When a notification carries a raw gauge value, put it in the byte field and read the gigabytes back before writing the timeline entry.
Binary Units When the Tool Insists
Some subsystems count in 1 024-based units. Both dropdowns list GiB, MiB and KiB, so a mismatch is one selection away from resolved.
A Second Pair of Eyes on the Zeros
Grouped digits make 50 000 000 000 visibly different from 5 000 000 000 — the check a review of a long integer literal rarely catches.
Questions From the Alerting Rulebook
Why does node_filesystem_avail_bytes never report gigabytes?
Prometheus naming convention asks every metric to use base units and name them in the suffix, which keeps one series comparable across machines of very different sizes. Prefixes are a presentation concern applied at render time. Note also that the avail gauge excludes blocks reserved for root, so it is the one to alert on rather than node_filesystem_free_bytes.
Should a disk alert use a fixed byte floor or a percentage?
Percentages travel well across a fleet — 80% warning, 90% critical is the usual pairing — but 10% of a 4 TB volume is 400 GB, either wasteful or far too late depending on the write rate. Many teams run both: a percentage rule for drift and an absolute floor such as 50 000 000 000 bytes so the page arrives with predictable runway left.
Why do df and du disagree on the same filesystem?
du walks directory entries and adds up what it can see; df asks the filesystem how many blocks are allocated. A file deleted while a process still holds it open has left the tree but still occupies blocks, and reserved space plus metadata belong to df alone. A gap of several gigabytes is usually a held-open file, not a bug.
What unit do the quota tools expect when I set a limit?
Classic setquota takes block counts, and its block is 1 KiB — so a 50 GB soft limit is 50 000 000 000 ÷ 1 024 = 48 828 125 blocks. Other stacks accept a suffix instead. Converting to bytes first gives one authoritative figure to divide down for whichever tool you are driving, rather than three approximations.
Can I just write "50GB" in the YAML and let it sort itself out?
Only where the consuming program documents a suffix parser, and those rarely agree — some read G as a billion, others as 230, and a PromQL comparison accepts no suffix at all. In a plain JSON or YAML value it is just a string, and a strict schema will reject it. An explicit integer with a comment naming the gigabyte figure never surprises anyone.
No comments yet. Be the first to comment!