Lesson 7 of 13 · 15m
Blackbox Checks: Monitoring From the Outside
up==1 and users still down — probes for HTTP, DNS, and TLS expiry see the path your internal metrics cannot.
Your dashboards are green. Every pod is up, error rate at zero, saturation comfortable. Users in Frankfurt are getting TLS errors. Everything internal can be healthy while the outside path — DNS, the CDN edge, the load balancer's certificate, the WAF rule someone added Tuesday — is broken. Prometheus calls this the difference between whitebox and blackbox monitoring, and the blackbox side is the part most stacks skip until their first "works for us, broken for users" incident.
The blackbox exporter
The blackbox_exporter is a probe service: you hand it a module and a target, and it reports probe_success, probe_duration_seconds, probe_http_status_code, and probe_ssl_earliest_cert_expiry. You scrape it like any other target, with the probe target passed as a parameter:
- job_name: blackbox-http
metrics_path: /probe
params: {module: [http_2xx]}
static_configs: [{targets: ["https://app.example.com/health"]}]
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: blackbox-exporter:9115The relabel dance looks ugly because it is: __address__ becomes the exporter while the real probe target becomes the instance label. You write it once and forget it.
Modules are stanzas in the exporter's blackbox.yml. The shipped example defines http_2xx, tcp_connect, icmp, grpc — a DNS prober is one you write yourself:
modules:
dns:
prober: dns
timeout: 5s
dns:
query_name: "example.com"
query_type: "A"
valid_rcodes: [NOERROR]What probes catch that internals never will
- TLS expiry.
probe_ssl_earliest_cert_expiry - time() < 14*24*3600is the alert that saves you from the most embarrassing outage class in the industry. Expired certificates have taken down pieces of major providers and a long list of banks — always at organizations whose monitoring watched CPU. - DNS. The
dnsmodule above resolves a name and validates the answer — it catches delegation rot, stale records, and split-horizon mistakes that internalupcannot see. - TCP services.
tcp_connectanswers "can a client open this port" for databases, mail listeners, and anything that does not speak HTTP. - The outside path. Probe from outside your cluster and VPC. A probe from inside proves the app answers; a probe from the internet proves users can reach it. Those fail independently — that is the point.
- SLI truth. The availability SLI is what the probe sees at the edge, not what the service thinks it did. A handler returning 200 on
/healthproves the health endpoint works.
A probe-failure sequence is worth reading once before it happens at 3am: probe_success drops to 0 and probe_duration_seconds collapses to a few milliseconds — that is a connection refused or a fast DNS failure. probe_success at 0 with probe_duration_seconds at the timeout is a blackhole — packets dying mid-path, a WAF dropping you, an upstream hanging. probe_http_status_code tells you where in the stack the answer changed: a 403 is a WAF/rule decision, a 502 is your LB's upstream down, a 301 you forgot is a redirect the probe did not follow. The triage reads off three series before anyone SSHes anywhere.
Where probes lie
A 30s probe interval misses a 20s outage and sees nothing regional unless you probe from several places — run a second exporter in another region or pair with an external uptime service (Healthchecks.io, Better Stack, your cloud's health checks) precisely because your vantage point is not your users'. Probe latency is the path's latency, not the app's — it includes DNS, TLS handshake, and the CDN edge, which is either a feature or a caveat depending on the question. An uptime-check SaaS and your own exporter will disagree sometimes; the answer is usually DNS or geography, exactly the class of problem internal metrics never show you.
Concrete practice
http_2xxprobes on every public origin, cert-expiry warning at 14 days, DNS probes on the zones you own.- Probe from more than one vantage point.
uptells you the target exists.probe_successtells you a user can exist. You need both.
Was this lesson helpful?
Keep reading
Related articles from the SudoSecurity blog.
Your Container Is Running SerialGC and Nobody Told You
You tuned G1 flags for a week. Your pod has one CPU, which means the JVM quietly picked a single-threaded collector at startup and ignored every flag you set. Here is the OpenJDK source that made that decision.
PostgreSQL 19 Is Out. REPACK Kept My Writes Running. The Docker Upgrade Will Stop Your App.
PostgreSQL 19 shipped on November 19 with REPACK (CONCURRENTLY), which removes table bloat without blocking writes. I measured it against VACUUM FULL, ran the upgrade from 18, and checked what breaks for self-hosters: Docker tags that refuse to start, a config setting that stops the server, and...
AWS Emulator Puts AWS on Your Laptop. Keep Your IAM Tests Off It.
AWS released AWS Emulator on November 11, a free local server that answers AWS API calls on 127.0.0.1 with per-run keys and fresh certificates.
Your npm Install Just Ran Someone Else's Code: Why Dependency Security Has to Start Before CI
A pull request checkout, a poisoned GitHub Actions cache, and an OIDC token pulled straight out of runner memory. That's how 84 malicious versions of TanStack's packages hit npm in six minutes.