Readiness checks, backup freshness, and uptime monitors #85
Labels
No Label
area:auth
area:docs
area:export
area:ops
area:storage
area:supply-chain
auth
backend
blocked
collab
deployment
docs
effort:L
effort:M
effort:S
frontend
plugins
qa
vs-nfd
vs-nfd:blocker
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: stwaidele/dorfteich#85
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
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?
Context
Pragmatic monitoring (kickoff): the readyz endpoint is the single integration point for external uptime checks (operations.md).
Scope
Extend
/readyzper operations.md: DB, migrations, converter reachability (warning), backup freshness from status.json (< 26 h, degraded state distinct from hard failure); add collab/healthzdepth (DB ping); define the Uptime-Kuma monitor set (web, api readyz, collab WebSocket connect) as documented configuration indeploy/monitoring.mdand set the monitors up for Test/Int/Prod with the repo owner; degraded-vs-down semantics documented (degraded alerts, but does not restart containers — compose healthcheck uses liveness, not readyz).Acceptance criteria
Technical notes
Dependencies
Depends on #83.
Size: ~1 day
Conventions: English code/comments, clear human-readable code, no hard-coded UI strings (ADR 0012, add
deanden), permission checks only via the shared guard (docs/architecture/permissions.md). Read the referenced ADRs before starting.Implemented in
0ef9614(pipeline green, 8/8 contexts; live on Test + Int).readyz with a degraded level (api)
GET /api/v1/readyznow enumerates five checks:databaseandmigrationsare the hard failures (HTTP 503, overallunready);converter,renderer, and the newbackupcheck are warning-level and turn the overall status todegradedwhile staying HTTP 200 — users are served, monitors alert on the body.backupcheck reads the #83 sidecar'sstatus.jsonfrom a new read-onlybackupsmount in the api (BACKUPS_DIR, baked into the image like the other data dirs) and warns when the last successful backup is older than 26 h (BACKUP_FRESH_MAX_AGE_HOURS), when no backup ever succeeded (with the last run's error), or when the file is missing/unreadable. A fresh success with a newer failed run staysokbut surfaces the error in the detail.status.jsonshape moved to@dorfteich/shared(backup-status.ts) as the explicit contract between the sidecar (writer) and the api (#85) / admin panel (#86) as readers.collab
/healthzdepth — already carried the DB probe since #33; verified live through the proxy (/collab/healthz, the documented fallback monitor target).Docker healthchecks = liveness only (verified config) — api image
HEALTHCHECK→/api/v1/healthz, web → static/healthz, collab →/healthz; none touch readyz. Compose'srestart: unless-stoppedrestarts on process exit only, so a degraded (or evenunhealthy) instance is never restart-looped — documented in monitoring.md.Monitor definitions — new
deploy/monitoring.md: the down-vs-degraded table, and a four-monitor set per stage for Uptime-Kuma (web healthz; api readyz for down; a keyword monitor on"status":"ok"that catches degraded despite HTTP 200; collab WebSocket with the/collab/healthzfallback). Prod alerting verification is referenced as a #89 go-live checklist item as the AC intends.Acceptance criteria
unready; verified by tests and live (degraded→ 200 observed locally with dead sidecars).status.json→{"status":"degraded", …"backup":"warn","detail":"last successful backup … is 40 h old (max 26 h)"}.deploy/monitoring.md; setting the monitors up in Uptime-Kuma is the operator step that remains open (definitions ready to click through; Prod at go-live per #89).Robustness fixes that fell out of review: the api image now pre-creates
/data/backupsnode-owned, so the sharedbackupsvolume stays writable for the sidecar no matter which container initializes it on a fresh stack; and the sidecar's scheduler survives a run that cannot even writestatus.json(logs instead of crash-looping — the missed run then shows up through this freshness check).Stages: composes updated (
*.bak-pre85) with the api's ro-mount; both stages now report readyz"ok"including the backup check end-to-end (fed by real #83 backups).