Add a /healthz route that reports sync lag #15

Closed
opened 2026-10-31 03:45:45 +00:00 by svc-agent-writer · 0 comments

Epic: #7

Health route with sync lag.

What to build

  • A FastMCP custom route GET /healthz, outside bearer auth, that returns 200 with ok and the seconds since the oldest account's last successful sync, or 503 when that lag exceeds a configured limit (default: 10 × sync.interval_seconds). It returns no account ids, addresses or counts.
  • The Host-header allowlist still applies.
  • Move the api readiness and liveness probes in deploy/k8s/base/deployment.yaml from tcpSocket to httpGet /healthz. Liveness must not fail on sync lag alone: use a separate path or a query flag so that a stalled sync marks the pod unready but does not restart it.

Acceptance

  • Unit tests for 200 and 503 and for an unauthenticated call.
  • make check green.
Epic: #7 Health route with sync lag. ## What to build - A FastMCP custom route `GET /healthz`, outside bearer auth, that returns 200 with `ok` and the seconds since the oldest account's last successful sync, or 503 when that lag exceeds a configured limit (default: 10 × `sync.interval_seconds`). It returns no account ids, addresses or counts. - The Host-header allowlist still applies. - Move the `api` readiness and liveness probes in `deploy/k8s/base/deployment.yaml` from `tcpSocket` to `httpGet /healthz`. Liveness must not fail on sync lag alone: use a separate path or a query flag so that a stalled sync marks the pod unready but does not restart it. ## Acceptance - Unit tests for 200 and 503 and for an unauthenticated call. - `make check` green.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
dev/mail-mind-mcp#15
No description provided.