feat(health): add health checks and maintenance page #12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/health-maintenance"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
feat/api-coverage).Changes
healthCheckon every service. Validation (Resources.HealthCheck) is shared by the changeset and the renderer, which drops invalid stored settings.onanswers every request for the host with the page (503,Retry-After) and renders no backend, access control or headers;autorenders the resource as usual with anerrorsmiddleware (502 to 504, including "no healthy server") in front. Without a usable control addressonserves nothing (never exposes the backend) andautoleaves the page out.GET /maintenance/:id: public, any HTTP method and Accept, no session, no layout and no assets (Traefik answers every path of the host with it, so/assets/app.csswould be the page again), CSPdefault-src 'none', escaped message. It shows only the host and the message, never the resource's name. Anything else is a plain 404.POST /api/traefik/v1/metricswith its node token.traefik_service_server_upis decoded straight from the OTLP wire format, so no protobuf dependency; the decoder is tested against a real gzip capture from Traefik 3.7 (host details scrubbed), hand-built edge cases and a fuzz run. Limits: 2 MB body, 16 MB inflated (bounded, with an incomplete-stream check), 5000 data points; a report that cannot be read is refused whole.service_health); a target isdownif any node that reported in the last 5 minutes says so,upif all do,unknownotherwise.metrics.otlpsnippet), API (health_check_*,maintenance_*,healthon targets), blueprints (health_check,maintenancesections; exported only when non-default), audit fields. Dev Traefik now reports to the dev app.resources;service_health), portable.Verification
mix format --check-formatted,mix compile --warnings-as-errors,mix credo --strict(no issues),mix dialyzer(0 errors).mix test: 963 passed on SQLite and on PostgreSQL.up; stopping thewhoamicontainer makes the API showdownwithin seconds and the visitor gets the automatic page (503, any path, any method); restarting recovers it. In the browser: "On" mode through the form, the visitor sees the real page, the resource page shows the badge, health check andup. Dev database restored afterwards.Notes
Health.ingest/3already returns (down, back up, first seen down).