dx: projection lag health endpoint #233

Closed
opened 2026-03-10 10:14:05 +00:00 by ash · 0 comments
Owner

Problem

subscription/lag_monitor.go exists for tracking projection lag, but there is no HTTP handler to expose this. Production apps need a health endpoint to answer: "Are my projections caught up?"

Currently operators must build this themselves every time.

Solution

Add eskit.ProjectionHealthHandler(monitors ...LagMonitor) http.Handler that returns:

{
  "status": "ok",
  "projections": {
    "order-list": { "lag": 0, "lastProcessed": "2026-03-10T07:00:00Z" },
    "invoice-totals": { "lag": 142, "lastProcessed": "2026-03-10T06:58:12Z" }
  }
}
  • status: ok when all lags < threshold (configurable)
  • status: degraded when any lag > threshold
  • HTTP 200 for ok, 503 for degraded (useful for load balancer health checks)

Pillar: Developer Experience, Production Readiness

## Problem `subscription/lag_monitor.go` exists for tracking projection lag, but there is no HTTP handler to expose this. Production apps need a health endpoint to answer: "Are my projections caught up?" Currently operators must build this themselves every time. ## Solution Add `eskit.ProjectionHealthHandler(monitors ...LagMonitor) http.Handler` that returns: ```json { "status": "ok", "projections": { "order-list": { "lag": 0, "lastProcessed": "2026-03-10T07:00:00Z" }, "invoice-totals": { "lag": 142, "lastProcessed": "2026-03-10T06:58:12Z" } } } ``` - `status: ok` when all lags < threshold (configurable) - `status: degraded` when any lag > threshold - HTTP 200 for ok, 503 for degraded (useful for load balancer health checks) ## Pillar: Developer Experience, Production Readiness
ash closed this issue 2026-03-10 12:42:05 +00:00
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
ash/eskit#233
No description provided.