DEV Community

Cover image for Silent Failure #9: The Heartbeat Was Green Because Nothing Ran

Silent Failure #9: The Heartbeat Was Green Because Nothing Ran

Renhua Wei on November 17, 2026

I was staring at 10:26:20 on the heartbeat card, and it said the same thing it had said at 08:26:17, and at every even hour before that: nothing to...
Collapse
 
danorie profile image
MinSoo Kim •

Checking the source instead of what actually ran is the one that got me too. My extension's options page showed its price as .99 from August until late October. Just the cents. Anyone opening the HTML saw the right price on line 144, but Chrome's i18n read $9 as the ninth substitution and dropped it, and no test ever read the rendered text back. The fix was one character per locale file plus a five-line test that loads the page and checks the price on screen.

When you write down the artifact for each job, will the check be that it exists, or what's in it?

Collapse
 
dafili profile image
Renhua Wei •

What's in it — existence is the same green light one level down. I assert a value that can only come from the work: count above zero and max(created_at) inside the window the job just covered, so an old row cannot satisfy it. Your price bug is the same shape: assert the rendered text equals $9.99, not that the options page returned 200.

Collapse
 
danorie profile image
MinSoo Kim •

The window is the part I'd have missed. Without it, yesterday's row passes for today's run.

Mine is the same check at the page level: the test opens the options page and reads the price text on screen, so a 200 alone can't pass it. I'd keep that test over a lint rule for $ plus a digit, which would also flag the 7 lines where the placeholders are on purpose, and someone would learn to ignore it.

What does your check do on a run where the job really had nothing to process? There, count zero is the correct answer.

Thread Thread
 
dafili profile image
Renhua Wei •

Zero rows is only green if the run itself left a trace: insert a job_runs row (job, window_start, window_end, status) before the work starts, then assert that row exists for the window just covered — SELECT 1 FROM job_runs WHERE job='x' AND window_end > now() - interval '25 hours' — and let the data assertion ride only when the input count is non-zero. A dead job then has no row for the window and a genuine no-op has one with status='noop', so the two cases stop looking identical. Same split as your price page: the DOM assertion covers 'it rendered', the run row covers 'the job ran at all'.

Collapse
 
sinarezaei profile image
Sina Rezaei •

I've seen a similar blind spot in Kafka-based data pipelines, especially when processing CDC events.

Imagine a Debezium connector capturing changes from a PostgreSQL database and publishing them to Kafka. The consumer group is healthy, heartbeats are coming in, and the monitoring dashboard shows no crashed instances. But a schema change introduces a new field, and a downstream transformation silently filters out every event that doesn't match the old schema.

The consumer is alive, Kafka is reachable, and offsets may even keep advancing, but the analytical database stops receiving meaningful updates.

I'd monitor three separate signals here: consumer group health, per-partition offset progression, and successful downstream writes. I'd also track the ratio between consumed records and successfully processed records.

A heartbeat proves that something is responding. It doesn't prove that the data is making it through the pipeline.

That's the distinction I'd want in any monitoring system.

Collapse
 
dafili profile image
Renhua Wei •

The ratio survives only if both counters come from the same stage: offsets advancing while rate(sink_rows_written_total[5m]) goes flat is the signature, and Kafka's own lag stays green through all of it.
Pin the schema rather than the data — curl -s localhost:8081/subjects/<topic>-value/versions | jq length jumping is the alarm, because after that the transform is guessing and a dropped event looks exactly like a quiet minute.

Collapse
 
sinarezaei profile image
Sina Rezaei •

That's a good distinction. I'd add one more layer though: a schema version change isn't necessarily a failure, even when it introduces a field the consumer doesn't understand.

For example, imagine a CDC pipeline feeding a financial reporting system. PostgreSQL adds a settlement_currency field to a payment table. Schema Registry accepts the new Avro schema under BACKWARD compatibility, but an older Kafka Streams topology still maps events using the previous field set. The records deserialize successfully, offsets advance, and the aggregation continues running, but transactions in different currencies start getting grouped together.

I'd track the schema ID distribution alongside the transformation outcome, and alert when a newly observed schema ID correlates with unexpected field loss or changes in downstream aggregates. I'd also keep dropped-records-total and deserialization errors separate, since a record can be processed successfully at the Kafka level and still produce incorrect business data.

Schema compatibility protects the contract between versions. It doesn't guarantee that the consumer's business logic still interprets the data correctly.

Thread Thread
 
dafili profile image
Renhua Wei •

The schema ID belongs in the metric label, not just the alert text: emit something like transforms_schema_id{id="7"} from the serde wrapper and compare sum by (id) against the ID set baked in at deploy - a new ID with any traffic is the alert, well before aggregates drift. Your second point is the one that bites, a record can deserialize fine into the wrong shape and never touch dropped-records or deser errors, so those counters prove nothing about business correctness. Cheapest sanity check I keep around: curl -s registry:8081/subjects/payments-value/versions | jq 'length' versus the version count the consumer was built against.

Collapse
 
mariosfong profile image
Mario Fang •

"A status line is proof of nothing" is the sentence I am keeping from this. The version that cost me a month: a nightly database backup reporting success for five weeks while silently skipping every database whose name contained a space. Exit code 0, clean log, a green run in the catalog for each night.

What I check now is the artifact, not the job: the newest file's mtime is under 24 hours old, its size is within 20% of the seven-day median, and a restore of the newest file returns the expected row count from one known table. Three cheap assertions that catch the did-nothing case and the half-done case with the same code.

Your second mistake is the one that still catches me — reading back the value you just wrote and calling it verification. I did it with a config change that needed a reload: the file was right, the running process kept the old value for two more days, and I had already told everyone it was done. The check reads from the running thing now, not from the file.

Collapse
 
dafili profile image
Renhua Wei •

Word splitting, nearly every time: for db in $(mysql -N -e 'show databases') turns my db into two names, both fail, and one || true at the end of the loop body keeps the exit code at 0. while IFS= read -r db is the fix, and pipefail will not save you because the failure is inside the loop, not in the pipeline.

I would keep the size check next to the row count: mine was a dump that was fresh, the right size, and had every table in it, all empty, because the job had been pointed at a truncated replica for six days.

Collapse
 
mariosfong profile image
Mario Fang •

That word-splitting example is exactly the silent failure I worry about — a database name with a space becomes two names, both fail, and the || true at the end keeps the exit code at 0. I had not thought about pipefail not saving you because the failure is inside the loop. And your size-plus-row-count point lands: I now check one known row count from a canary table after every dump, because a fresh, right-sized dump full of empty tables fooled me once too.

Thread Thread
 
dafili profile image
Renhua Wei •

A canary row catches empty tables, but it will not catch a dump pointed at the wrong database entirely - the canary exists there too, dumps fine, and every business table is missing. If the replica risk is real, stamp the source into the file itself: dump with --dump-date plus a header query like SELECT @@hostname, @@server_id INTO the header comment, then your restore test greps that header and fails if server_id is not the primary's. Six days of wrong-source dumps with a passing size check is exactly the failure that only shows up when someone runs a restore.