Co-authored-by: Arnaud Dartois <admin@tordais.cc>
4.5 KiB
name, description
| name | description |
|---|---|
| server-healthchecks | Keep Heimdall container health probes aligned with the HTTP methods accepted by its ASP.NET health endpoints. |
Heimdall server health checks
Use this workflow when changing Dockerfile health checks, Central Compose health checks, or Web health endpoint routing.
- Central and Agent containers probe
/healthzon port 8080 (the development Agent may bind its host-mapped port). ASP.NET maps this route forGET; aHEADrequest returns 405 and marks a live server unhealthy. - When documenting health status, compare each summary with the registered check names/tags, endpoint filters, and HTTP status mapping in Web and Agent. Web
/healthzis liveness (200),/readyzchecks thereadyPostgreSQL and selected-storage dependencies (200only when healthy, otherwise503), and/health/liveselects thelivePostgreSQL and optional configured AI backend check (503when degraded). Agent/healthzruns its registered checks (Degradedmaps to200,Unhealthyto503);/health/liveselects only the Agent pipeline-degradation check (503when degraded). Do not claim a Central broker health check unless one is registered. - Ollama is optional; its URL can be configured in Central settings, the admin connectivity action can ping it, and
AiHealthCheckprobes/api/tags. That endpoint check proves availability only, not model inference or summary generation. Do not document LLM-generated summaries until a production caller for a model generation/chat API is implemented. - In the Alpine image, use BusyBox
wgetwith-O /dev/nullto issue a GET and discard the body. Do not use--spider, because BusyBox implements it as HEAD. - Apply this to both
docker/Dockerfile/Central Compose anddocker/Dockerfile.agent/Agent development Compose. Keep the image and Compose probes consistent, with bounded timeout/retries and no published health endpoint required. - For acceptance, build the changed Central or Agent image from source under a project-unique tag in a unique Compose project with a generated
.env, synthetic credentials, a loopback-only unused port, and project-scoped volumes/network. Install an EXIT cleanup trap before build/start. Verify a GET health probe succeeds and an equivalent HEAD receives the endpoint's 405; then confirm the changed service reports healthy. In cleanup remove only that project withdown --volumes --remove-orphans, verify no labeled containers/volumes/networks remain, remove and inspect each exact local image tag even on failure, and retain shared base images. Preserve the test exit status and report cleanup failures.
Metrics scrape acceptance
For a Central scrape check, the source-built server image exposes GET /metrics as Prometheus text and includes ASP.NET Core instrumentation after a request. Use the same disposable Compose isolation and an explicitly empty Sentry DSN; scrape the host loopback port, assert HTTP 200 plus Prometheus # HELP/# TYPE and an ASP.NET request metric, then remove the project and verify zero containers, volumes, and networks. Remove and verify absence of that recipe's unique server image tag afterward.
When updating implementation-status documentation, verify both src/Heimdall.Web/Program.cs and src/Heimdall.Agent/Program.cs for exporter registration and /metrics mapping, then compare the documented signal inventory with docs/metrics.md and example alert rules with deploy/prometheus/heimdall-alerts.yml. Mark exporter implementation separately from an operator's Prometheus scrape, deployed alerting, or threshold validation; local or CI evidence does not establish those external states.
On 5 November 2026, project hmd-metrics-scrape-1793874584 reused the prior source-built OCR Central image (no code changes between that image and this scrape). It returned HTTP 200 with Prometheus exposition and ASP.NET metrics; Sentry DSN was empty and teardown verified 0/0/0. This is a partial Docker recipe result: it did not build a unique image for this scrape, so no exact-tag image removal was performed. Repeat the check with a fresh project-unique source-built tag before treating the Docker acceptance as complete. This local check does not validate a deployed Prometheus server or alert thresholds.
PostgreSQL readiness regression checks were also rerun locally on 5 November 2026: HealthControllerTests passed 5/5 with the disposable Testcontainers database. The Testcontainers reaper and database stopped after the run; unrelated labeled database services were left untouched.