Skip to main content

How to Alert on Missing Sensor Data Separately from Thresholds

GuideWritten by oncall.fyi editorialPublication approved by Burak YApproval recorded 12 September 2026
Sources and verification
Source dates
Oldest source check: 12 September 2026.
Technical verification
Separate technical verification has not been recorded.

Publication approval and technical verification are recorded separately. Automated link checks establish reachability, not accuracy. A checked example verifies only its stated test cases, not the whole article or your production setup.

In short

Give each expected sensor a value condition and a separate freshness condition. Evaluate freshness against the expected reporting interval and the age of the last trustworthy observation, while tracking collector health independently. Test a sustained threshold breach, a silent sensor and a failed collector. Missing measurements must produce an explicit unknown or stale state instead of silently becoming a healthy value.

Key takeaways

  • Threshold evaluation and measurement freshness answer different questions.
  • Inventory is needed to identify expected sensors that disappear.
  • A healthy collector does not prove every attached sensor is reporting.

Name the three failure paths

A sensor can report an out-of-range value, stop sending new measurements, or become unreachable because its collector has failed. Treat these as separate conditions with different diagnostic instructions.

Start with an inventory of expected devices, measurement type, reporting interval and maintenance schedule. Without that list, a sensor that disappears completely may also disappear from the query result, leaving no label set on which to evaluate a per-device threshold.

For intermittently connected equipment, define an explicit expected silence window. Do not infer scheduled maintenance merely because a device has been quiet for a long time.

Use the measurement timestamp deliberately

Record whether timestamps represent device sampling, collector receipt or database ingestion. A collector replaying buffered measurements can be reachable while the latest actual measurement is old. Conversely, clock drift on a device can make fresh data appear stale.

Where possible, retain both observed and received times and flag implausible clock differences. Pick the clock used for the operational freshness policy and document its limitations. “Data arrived now” is a different statement from “the equipment was measured now.”

Configure value and freshness rules independently

For the value condition, specify comparison, required duration, unit and recovery behavior. For freshness, specify the longest expected interval plus an agreed tolerance for collection and transport delay.

PromQL's absence functions (opens in a new tab) can detect a missing selected series. This illustrative expression checks one explicitly selected sensor over a ten-minute window:

promql
absent_over_time(sensor_temperature_celsius{sensor="demo-pump"}[10m])

The metric and sensor label are examples. This expression does not automatically enumerate all expected sensors. For a fleet, compare an authoritative inventory against reporting series or provision a rule per controlled sensor set. Validate the result with the actual label model and staleness behavior.

Keep unknown distinct from normal

Grafana's missing-data guidance (opens in a new tab) distinguishes disappearing series from queries that return no data. Its No Data and Error states (opens in a new tab) also require an explicit policy for failed evaluation.

Choose behavior for a sensor that has never reported, a previously healthy sensor that stops and a query source that times out. Display the last valid value with its timestamp if useful, but mark it stale. Do not substitute zero unless zero is genuinely the observed measurement.

Validate each condition in isolation

Use a simulator or approved test device so the exercise does not interrupt equipment operations. Record the first missing sample and the time the alert became eligible for delivery.

TestExpected evidence
Value breaches threshold while reports continueValue alert; freshness remains healthy
One sensor stops, collector remains healthyThat sensor's freshness alert
Collector loses all devicesCollector failure and scoped affected-device visibility
Buffered old readings arriveOriginal measurement age remains visible
Device resumes reportingFreshness recovers after valid observations

Finally, confirm the receiving operator can tell which first action applies: inspect equipment, inspect its sensor, or inspect the collection path. Keep the exact test window and result with the rule so future threshold changes do not silently weaken missing-data coverage.

Did this help?

Your answer helps us improve this guide. We save only the page and your choice for 30 days.

No name, email, or incident details are requested.

Sources

Vendor facts change. Each source below shows the date this page last checked it.

  1. Handle missing data Grafana Labs. Checked 12 September 2026.
  2. PromQL functions Prometheus. Checked 12 September 2026.
  3. No Data and Error states Grafana Labs. Checked 12 September 2026.

Related

One practical idea, occasionally

The On-Call Brief: short field notes, templates, and operational lessons.

Follow the field guide

Email subscriptions are not open yet. Read new guides in your feed reader — no email address needed.

Subscribe with RSS