DevOps & CI/CD Bug Report

Our exporter died, the metric vanished, and the alert that should have fired never did

A disk filled up on a database host and nobody was paged, although we had an alert for exactly that. The node exporter had crashed two days earlier, so the disk metric had no data, and a Prometheus rule over no data returns nothing. How absent(), up checks and a dead man's switch close the gap.

Leila Farahani Leila Farahani @leilafarahani · November 30, 2026 · 7 min read · 52 Views
Banner: an alert that cannot fire because its metric has disappeared

On a Saturday morning the reporting database on db-rpt-02 stopped accepting writes:

FATAL:  could not write to file "pg_wal/xlogtemp.31877": No space left on device

The data volume was at 100 percent. We had an alert for this, one of the first rules anyone writes:

- alert: DiskAlmostFull
  expr: |
    (node_filesystem_avail_bytes{fstype!~"tmpfs|overlay"} /
     node_filesystem_size_bytes{fstype!~"tmpfs|overlay"}) < 0.10
  for: 15m
  labels: { severity: page }

It had not fired. Not for this host, not at 90 percent, not at 99. In the Prometheus UI, evaluating the expression returned results for every database host except one:

{instance="db-rpt-01:9100", mountpoint="/var/lib/postgresql"}  0.62
{instance="db-rpt-03:9100", mountpoint="/var/lib/postgresql"}  0.58

db-rpt-02 was missing entirely. Querying the raw metric for that host:

node_filesystem_avail_bytes{instance="db-rpt-02:9100"}
-> Empty query result

And the target's scrape status:

up{instance="db-rpt-02:9100", job="node"}  0

The node exporter on db-rpt-02 had been down since Thursday evening. The up metric for it had been 0 for almost 40 hours. Nothing alerted on that either.

On the host, systemctl status prometheus-node-exporter showed the process had been killed by the OOM killer during a memory spike on Thursday, and its unit had Restart=no.

Comparisons over no data return no data

A Prometheus alert fires when its expression returns one or more series. The expression above is a comparison: "available over size, less than 0.10". For each series that exists, Prometheus computes the ratio and keeps it if it is below 0.10.

When the exporter stops, its series stop being scraped. After about five minutes (the staleness period), Prometheus treats them as gone. The expression then has nothing to compute for that host. No series, no result, no alert. Prometheus is not saying "the disk is fine"; it is saying nothing at all, and an alert rule cannot tell "fine" from "unknown".

This is not specific to disks. Every threshold rule (> 0.9, < 10, rate(...) > x) silently stops covering a target the moment its metrics disappear.

What up tells you, and why nobody saw it

For every scrape target, Prometheus records up: 1 if the last scrape succeeded, 0 if it failed. When the exporter died, up for that target became 0. That is the signal we needed, and we were collecting it. We just had no rule on it, because the team that set up monitoring assumed "if something is broken, the specific alerts will fire".

Two kinds of absence

There are two ways a metric can be missing, and they need different checks:

  1. The target is gone or failing: up == 0, or the target disappeared from service discovery entirely, in which case there is no up series either.
  2. The target is up, but a specific metric is missing: for example, an exporter running but failing to read a filesystem, or an application that stopped emitting a counter after a code change.

Environment

Item Value
Monitoring Prometheus 2.53, Alertmanager 0.27, node_exporter 1.8
Targets about 340 node exporters via file-based service discovery
Failure node_exporter OOM-killed, Restart=no, down 40 hours
Impact reporting DB unavailable 3 hours on Saturday

1. Alert when targets are down

- alert: TargetDown
  expr: up == 0
  for: 5m
  labels: { severity: page }
  annotations:
    summary: "{{ $labels.job }} target {{ $labels.instance }} has been unreachable for 5 minutes"

For a fleet, we also alert on the share of targets down per job, so a network problem affecting many targets produces one page instead of three hundred:

- alert: ManyTargetsDown
  expr: (count by (job) (up == 0) / count by (job) (up)) > 0.1
  for: 5m

2. Alert when a metric that must exist is absent

absent(v) returns a single series with value 1 if v has no series, and nothing otherwise. It turns "no data" into something an alert can fire on:

- alert: DiskMetricsMissing
  expr: absent(node_filesystem_avail_bytes{instance="db-rpt-02:9100", mountpoint="/var/lib/postgresql"})
  for: 10m

Writing one rule per host does not scale. For a fleet, compare against a known list. up is a good reference because it exists for every target, even failing ones. The rule below fires for each target that is up but has no filesystem metrics, which covers the second kind of absence:

- alert: FilesystemMetricsMissing
  expr: |
    up{job="node"} == 1
    unless on (instance)
    count by (instance) (node_filesystem_avail_bytes{fstype!~"tmpfs|overlay"})
  for: 15m

For targets that disappear from discovery entirely (so even up is gone), we compare against the inventory: our configuration management exports the expected list of hosts as a metric inventory_host_info{instance=...} via a small textfile collector on the Prometheus server. A rule alerts on hosts in the inventory with no up series.

absent_over_time(v[30m]) is the range-vector variant, useful for metrics that are only emitted occasionally, such as a batch job's completion timestamp.

3. Make sure the monitoring system itself is alive: a dead man's switch

Everything above depends on Prometheus and Alertmanager working. If Prometheus dies, or Alertmanager cannot send notifications, no alert fires at all. The standard answer is an alert that always fires:

- alert: Watchdog
  expr: vector(1)
  labels: { severity: none }
  annotations:
    summary: "Alerting pipeline heartbeat; this alert should always be firing"

Alertmanager routes it to an external heartbeat service that expects to receive it every few minutes. If the heartbeat stops arriving, the external service pages us. That covers Prometheus down, rule evaluation broken, Alertmanager down, and notification delivery failing, with a check that lives outside the system it is checking.

4. Restart the exporter

The immediate operational fix: Restart=on-failure and a memory limit in the node exporter's systemd unit, applied fleet-wide by configuration management. And a review of other agents on our hosts for the same Restart=no setting; we found it on two more.

1. Kill an exporter in staging.

sudo systemctl stop prometheus-node-exporter    # on a staging host

TargetDown fired after 5 minutes and paged the on-call rotation for staging. Restarting the exporter resolved it.

2. Break one metric while the target stays up. We started the node exporter with the filesystem collector disabled (--no-collector.filesystem). up stayed 1, and FilesystemMetricsMissing fired after 15 minutes.

3. Kill Prometheus. We stopped the staging Prometheus. Within ten minutes, the external heartbeat service paged us that the Watchdog had stopped arriving.

4. Rule unit tests. promtool test rules now covers each of these rules, including the case where the input series is missing:

tests:
  - interval: 1m
    input_series:
      - series: 'up{job="node", instance="h1:9100"}'
        values: '1x30'
    alert_rule_test:
      - eval_time: 20m
        alertname: FilesystemMetricsMissing
        exp_alerts:
          - exp_labels: { job: node, instance: "h1:9100" }

5. Coverage audit. We listed every paging alert and asked for each: what happens if its input metric disappears? Eleven of 48 rules had no coverage for missing data. Each now has either a target-level check or a specific absent rule.

6. Security implications. Silent monitoring is also a security gap: an attacker who stops an agent on a host removes visibility of that host. TargetDown and the inventory check now make stopping an agent a visible event.

Takeaways

  • A threshold alert over a missing metric returns nothing, which looks exactly like "everything is fine".
  • Alert on up == 0 for every scrape job, with a fleet-level ratio rule to avoid alert storms.
  • Use absent(), absent_over_time() or unless against a reference series to detect metrics that should exist.
  • Run an always-firing Watchdog alert into an external dead man's switch so a broken monitoring pipeline pages you.

References: Prometheus querying functions, absent and absent_over_time, Prometheus jobs and instances, the up metric, Prometheus staleness, Unit testing rules with promtool.

Add a label

#monitoring #prometheus #alerting #absent #dead-mans-switch
Written by
Leila Farahani @leilafarahani

I lead a small team responsible for observability and quality tooling, and I spend a fair share of my time on application security reviews. That mix means I see many incidents twice: once when they happen and again when we ask why nothing warned us. The posts here come from that second look. An alert that never fired because the metric disappeared, sampling that dropped exactly the traces we needed, a catch-all that reported success for weeks, a secret recoverable from an image layer, tests that passed against mocks while production failed. Each one covers how the gap was found, what we changed in code or configuration, and how we verified the fix with a test or a drill. Security topics stay defensive and practical: controls you can add to your own code and a way to test each one.

Advertisement

Comments

0

No comments yet. Be the first to comment!

Sign In to post a comment.