Files
Heimdall/skills/server-healthchecks/SKILL.md
T
arnaud.dartois 04b3279d1f
Heimdall Gitea / Detect CI scope (push) Successful in 5s
Heimdall Gitea / Build and tests (push) Skipped
Heimdall Gitea / Build and scan server image (push) Skipped
Heimdall Gitea / Build and scan agent image (push) Skipped
Heimdall Gitea / Build and scan NVIDIA Agent image (push) Skipped
Heimdall Gitea / Publish versioned installer release (push) Skipped
Heimdall Gitea / CI policy (push) Successful in 2s
docs: qualify optional Ollama integration status (#410)
Co-authored-by: Arnaud Dartois <admin@tordais.cc>
2026-11-13 12:47:01 +01:00

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 /healthz on port 8080 (the development Agent may bind its host-mapped port). ASP.NET maps this route for GET; a HEAD request 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 /healthz is liveness (200), /readyz checks the ready PostgreSQL and selected-storage dependencies (200 only when healthy, otherwise 503), and /health/live selects the live PostgreSQL and optional configured AI backend check (503 when degraded). Agent /healthz runs its registered checks (Degraded maps to 200, Unhealthy to 503); /health/live selects only the Agent pipeline-degradation check (503 when 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 AiHealthCheck probes /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 wget with -O /dev/null to 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 and docker/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 with down --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.