Probe the services of all guests with the blackbox exporter #9

Merged
kevinheyer merged 1 commit from service-probes into main 2026-11-27 23:03:41 +01:00
Member

Mit provisioner_url fragt Prometheus den Provisioner nach den offenen TCP-Ports und Health-URLs der Gäste (/prometheus/probes) und prüft sie mit dem blackbox_exporter aus Debian (nur localhost, sandboxed, ohne Capabilities): Jobs probe-tcp und probe-http, Alarm ServiceDown nach 5 Minuten, Dashboard „Services“ (up/down, Verfügbarkeit 24 h, Antwortzeit). Aufbewahrung 40 statt 30 Tage. https-Health-URLs bekommen keinen HTTP-Test (kein Prüfen ohne Zertifikatsprüfung), deshalb entfällt CertificateExpiring.

Reihenfolge: iac-website, iac-provisioner, dann dieser PR. Danach update auf dem Provisioner- und dem Monitoring-Gast.

Getestet: check-app.sh (lint, zwei Läufe, Smoke-Test, idempotent); im Container mit Test-Provisioner beide Jobs up, probe_success 1/0, ServiceDown firing nach 5 Minuten, Dashboard-Abfragen über Grafana. Der Template-Vergleich schlug fehl (älterer iac-core-Checkout), unabhängig von dieser Änderung. Nicht getestet: echter Provisioner/NetBox, Alarm-Mail, die Tabelle im Browser.

Refs #2

Mit `provisioner_url` fragt Prometheus den Provisioner nach den offenen TCP-Ports und Health-URLs der Gäste (`/prometheus/probes`) und prüft sie mit dem `blackbox_exporter` aus Debian (nur localhost, sandboxed, ohne Capabilities): Jobs `probe-tcp` und `probe-http`, Alarm `ServiceDown` nach 5 Minuten, Dashboard „Services“ (up/down, Verfügbarkeit 24 h, Antwortzeit). Aufbewahrung 40 statt 30 Tage. `https`-Health-URLs bekommen keinen HTTP-Test (kein Prüfen ohne Zertifikatsprüfung), deshalb entfällt `CertificateExpiring`. Reihenfolge: iac-website, iac-provisioner, dann dieser PR. Danach `update` auf dem Provisioner- und dem Monitoring-Gast. Getestet: `check-app.sh` (lint, zwei Läufe, Smoke-Test, idempotent); im Container mit Test-Provisioner beide Jobs `up`, `probe_success` 1/0, `ServiceDown` firing nach 5 Minuten, Dashboard-Abfragen über Grafana. Der Template-Vergleich schlug fehl (älterer iac-core-Checkout), unabhängig von dieser Änderung. Nicht getestet: echter Provisioner/NetBox, Alarm-Mail, die Tabelle im Browser. Refs #2
Probe the services of all guests with the blackbox exporter
All checks were successful
/ lint (pull_request) Successful in 2m21s
/ lint (push) Successful in 11s
a6b338d1d1
With provisioner_url Prometheus asks iac-provisioner for the open TCP
ports and health URLs of the guests (/prometheus/probes) and probes them
through the blackbox exporter from Debian (localhost only, sandboxed,
no capabilities): jobs probe-tcp and probe-http, the alert ServiceDown
after 5 minutes, and a Grafana dashboard "Services" with up/down, the
availability of the last 24 hours and the response time per service.

Prometheus keeps its data 40 instead of 30 days (monthly availability
for iac-compliance); a guest with its own ExecStart= drop-in keeps it.
https health URLs get no HTTP probe, because TLS is never taken
unchecked.

Tested: tools/check-app.sh (lint, two dev container runs with smoke test,
idempotent); with a fake provisioner serving the real output of
probe_groups in the container: both jobs up, probe_success 1 for open
port and health URL, 0 for a closed port, ServiceDown pending and after 5 minutes firing, dashboard
queries answer through Grafana, second run changed=1. The template check
failed against an iac-core checkout older than the template, unrelated to
this change. Not tested: against the real provisioner and NetBox, the mail
of the alert, the table in a browser.

Refs #2
Sign in to join this conversation.
No description provided.