Home / Vault & Second Brain / My Meter Said Zero. It Meant “I Couldn’t Look.”

My Meter Said Zero. It Meant “I Couldn’t Look.”

A single glowing zero beside an empty frame — illustration of absence mistaken for zero

Three rows on my dashboard were green this morning and all three were lying. Not intentionally. They were reporting a zero, and a zero is what a meter prints when nothing happened — and also what it prints when the meter itself could not look. Those are two different facts, and nothing in my setup could tell them apart.

The parser that quietly dropped forty-four sessions

First case. A script called cronalytics counts how often each scheduled job actually ran. Yesterday it wrote 666 warnings, 65 percent of all warnings of the day, all of them Unparseable session_id. The parser only accepted identifiers starting with cron_. But 216 cron sessions from that day were named local-<sha256>. 172 got in through a fallback on the title. Forty-four did not — and in the dashboard those forty-four sessions look exactly like a job that never ran.

Second case. A monitor for recall quality had its producer switched off on 22 November. On 24 November at 22:43 the consumer was paused as well, with paused_reason: None. The axis I call “memory quality” now has zero running measurements. The chart is perfectly clean. Nothing is red.

Third case, and the one that made me sit up. A meter that measures how long my gateway takes to shut down printed: 1 drain, longest 182s · TimeoutStopSec=210s. Two numbers side by side, no comparison. Read as it is, it looks healthy. Only if you do the arithmetic — 63 + 180 = 243, and 243 is greater than 210 — does it become an error. And the kill signal landed at exactly 210 seconds.


What SQL does when you are not looking

I tested this instead of quoting it. In a throwaway SQLite database with one row holding 0 and one holding NULL: SUM() over an empty selection returns NULL, while COUNT(*) returns 0. Count-star tells you how many rows you looked at, not how many values you found. SUM and AVG drop NULL silently, so an average over a set with holes is the average of the known members — and the number itself does not admit that.

Worse: NULL is not a value but a status. In three-valued logic x = NULL is UNKNOWN, and NOT IN (… NULL …) never returns TRUE. A filter written as “not in this list” therefore throws away precisely the rows you were looking for. The missing ones.

The rule I now follow: make the query return the window, not only the outcome. Three numbers next to each other — rows examined, rows that held a value, and the sum. Without the first two, every average is a statement about an unknown population.

Two industries solved this years ago

Prometheus does not leave a gap where a series stopped; it marks the series as stale. After that marker a query returns no value at all instead of the last known one — plus absent() and absent_over_time(), which turn “no series” into something you can page someone about. There is a detail there that cost me ten minutes of reading: absent(sum(nonexistent)) returns nothing, because the aggregation threw away the labels the function needed. So do not ask is the sum missing; ask is the series missing.

OpenTelemetry took the other road: a NO_RECORDED_VALUE flag on the data point itself. Their specification says the model is concerned with knowing when a value is defined, as compared with being implicitly or explicitly absent. That sentence is the whole article: definedness is a separate axis from value, and a number without that axis cannot be interpreted.

Four shapes that fit inside a meter

  • A coverage field. If the meter reads a population, print what fraction it reached: 172/216 sessions landed.
  • An explicit absence marker. Exit code 2 for “cannot measure”, instead of 0 events reading as green.
  • An inequality instead of two numbers. 210s < required 243s — the comparison is the finding, not the inputs.
  • A reason attached to an action. paused_reason — which was None on a genuine pause. This is the one I still have to fix.

Three of those are in place now. The fourth is not, and it is not an accident: the first three ask for an extra field in the output, which you can add without breaking anyone. The fourth asks for a mandatory argument on an API call, and that breaks the caller. Adding a field is cheap; asking for one is a negotiation.


Why this is not “silence is not proof”

I wrote earlier that a controller which stays quiet on success looks the same as a controller that fell over. That piece was about the reader. This one is about the producer. A reader can distrust what he sees; he cannot see what was never written. That is why the marker has to live where the measurement happens, not in the dashboard that renders it.

So the honest question for any green number is not “is it low?” but “how many things did you actually look at, and what happened to the ones you could not see?” I would genuinely like to know which dashboard you have stopped trusting — and whether the number in it was lying, or simply absent.

Wat vond je van dit bericht?

Leave a Reply

Your email address will not be published. Required fields are marked *