Our tracking page was down for fifty one minutes and the blackbox alert never fired because it was watching up

2026-11-26来源 dev.toEnglish

We check our public parcel tracking page from outside our own network with Prometheus and the blackbox exporter. The exporter runs on a small virtual machine with another cloud provider. Prometheus scrapes its /probe endpoint with the tracking page's URL as a parameter, the exporter requests the page, and it returns the result as metrics.

When we set it up, the alert was copied from our node alerts: up{job="blackbox-tracking"} == 0 for two minutes.

On a Sunday at the start of November a change to the CDN's origin settings left the tracking page answering 503 for fifty one minutes. Nobody was paged. We heard about it on Monday from customer service, who had spent Sunday evening answering emails about parcels that could not be found.

up does not describe the target. Prometheus records it for every scrape to say whether the scrape itself worked: whether it reached the thing it scrapes and got metrics back. With the blackbox exporter, that thing is the exporter, and the exporter answers /probe with 200 and a full set of metrics whether the probe passed or failed. The failure is inside the metrics. probe_success went to 0, and probe_http_status_code said 503 for the whole fifty one minutes. up stayed at 1, because the exporter was healthy and was reporting, accurately, that our site was not.

The rule had been reviewed. It looked like every other availability alert we had, and in all of those, up and the thing we care about are the same, because the exporter runs on the machine it describes.

The alert is now probe_success == 0 for two minutes. A separate alert at lower priority fires on up == 0 for the blackbox job, because an exporter we cannot reach means we have stopped looking, which is a different problem from the site being down. Both rules have tests run by promtool test rules, and one of them feeds in a series where up is 1 and probe_success is 0 and expects a page. We also searched every rule file for up used on a job that probes something else. There were two more: one for our SFTP endpoint and one for a carrier's API.

up answers whether Prometheus could talk to the thing it scraped. When an exporter sits in between, the exporter can be in perfect health while it reports a failure in full detail to an alert that is not reading it.

– Sergey Shinder

原文:https://www.a8q9.cn/en/article/our-tracking-page-was-down-for-fifty-one-minutes-and-the-blackbox-alert-never-fi-19d1af.html

相关文章