Health and Monitoring

The DataMind Installer exposes a small, deliberate HTTP surface: one public health endpoint, and authenticated endpoints that report the running build and the state of the DataMind OS stack it manages.

Use the health endpoint

GET /api/health is public — it needs no token — and is both the liveness and the readiness probe. It runs SELECT 1 against the Installer's database and answers:

json
{ "status": "ok", "db": "up" }

If the database is unreachable it returns 503 Service Unavailable with the message Database connection failed, and logs Health check failed — DB unreachable: <reason>.

bash
curl -s http://localhost:${NEST_PORT:-8000}/api/health

The Installer's own container healthcheck calls exactly this endpoint, so the same signal drives Docker's health status:

yaml
test: ['CMD-SHELL', 'wget -qO- http://localhost:${NEST_PORT:-8000}/api/health || exit 1']
interval: 10s
timeout: 5s
retries: 5
start_period: 20s

docker compose up --wait blocks on that healthcheck, which is why the self-update helper can verify a switch without polling. The same healthcheck exists on delamain-postgres (pg_isready) and delamain-backend-init runs as a one-shot to completion.

Note

/api/health says nothing about the DataMind OS stack. It proves the Installer process and its database are alive. Use GET /api/deployment/status for the managed services.

Identify the running build

GET /api/version (authenticated) returns the image reference the container was created from and the registry digest of the image actually running:

json
{ "image": "unistream.azurecr.io/delamain:prod-latest", "digest": "sha256:9f3c1a…" }

The digest is the exact identity and is resolved from the running container, not from the tag, because a tag moves while an old container keeps serving. It is null when the Installer is not running in a container or the image has no registry digest.

bash
curl -s "http://localhost:${NEST_PORT:-8000}/api/version" \
  -H "Authorization: Bearer <token>"

Read the deployment status

GET /api/deployment/status (authenticated) is the Installer's own view of the deployment, in two parts.

prerequisites — the deployment files the Installer needs:

FieldMeaning
envFile.existsThe generated .env is present
envFile.lineCountNon-empty lines in it
composeFile.existsThe downloaded DataMind OS docker-compose.yml is present
allReadyBoth files exist

containers — the DataMind OS containers, selected by the label com.docker.compose.project=unistream:

FieldMeaning
total, running, stoppedCounts
conditionsA tally per condition, below
items[]Per container: service, containerName, lifecycle, condition, state, status, exitCode, error, restartCount, startedAt, uptimeSeconds

Container conditions:

ConditionMeaning
UPRunning, healthy or no healthcheck defined
STARTINGRunning, healthcheck still in its start period
UNHEALTHYRunning, healthcheck reporting unhealthy
FLAPPINGRestarting repeatedly
DOWNCreated but not started, or exited cleanly (exit 0, or 143/137 without an OOM kill)
FAILEDDead, or exited non-cleanly (for example OOM-killed)
IN_PROGRESSA one-shot init container still running
COMPLETED_OKA one-shot init container that exited 0
UNKNOWNAnything else
Tip

Services with no healthcheck cannot be judged by --wait. For those, the Installer re-checks 5 seconds after recreation and fails the job if the container is DOWN or FLAPPING.

What the Installer exposes for monitoring

The DataMind OS stack it manages

Confirm a healthy installation

#CheckCommandExpected
1Backend answerscurl -s http://localhost:${NEST_PORT:-8000}/api/health{"status":"ok","db":"up"}
2Installer containers runningdocker ps --filter name=delamain-delamain-backend and delamain-postgres up
3Database healthydocker inspect --format '{{.State.Health.Status}}' delamain-postgreshealthy
4Migrations finisheddocker inspect --format '{{.State.ExitCode}}' delamain-backend-init0
5Build recordedGET /api/versionnon-null digest
6Deployment files presentGET /api/deployment/statusprerequisites.allReady: true
7No failing servicesGET /api/deployment/statusconditions has no FAILED, UNHEALTHY or FLAPPING
8No update stuckGET /api/system/self-update-checklastUpdate.status is completed or null, never left at started
9DataMind OS containers updocker ps --filter label=com.docker.compose.project=unistreamThe stack's services are up

If several checks fail together, start with Troubleshooting and collect the output listed in Logs.