revert(api): remove /health/ready — superseded by /api/readyz (GRO-2689)
CTO architectural ruling (PR #235 review): K8s readiness/liveness probes must remain DB-less to prevent transient DB blips from cycling pods. The /api/readyz endpoint (GRO-2687) is the canonical DB-health signal for the monitoring layer and satisfies the GRO-2678 detection-gap requirement. Removes: - GET /health/ready route from src/index.ts - src/__tests__/health-ready.test.ts Refs GRO-2689, GRO-2687, GRO-2678
This commit is contained in:
@@ -65,17 +65,6 @@ app.use(
|
||||
app.get("/health", (c) => c.json({ status: "ok" }));
|
||||
// /api/health: used by Gateway HTTPRoute (/api/* → API pod)
|
||||
app.get("/api/health", (c) => c.json({ status: "ok" }));
|
||||
// /health/ready: DB-touching readiness probe — K8s removes pod from endpoints when schema is dropped (GRO-2689)
|
||||
app.get("/health/ready", async (c) => {
|
||||
try {
|
||||
await getDb().select({ id: staff.id }).from(staff).limit(1);
|
||||
return c.json({ status: "ready" }, 200);
|
||||
} catch (err) {
|
||||
const pgCode = (err as Record<string, unknown>).code ?? "unknown";
|
||||
console.error("[health/ready] DB check failed:", pgCode);
|
||||
return c.json({ status: "degraded" }, 503);
|
||||
}
|
||||
});
|
||||
// /api/readyz: DB-touching deep health check consumed by monitoring (not K8s probes)
|
||||
// Distinct from /health so a dropped schema triggers an alert without cycling pods (GRO-2678)
|
||||
app.get("/api/readyz", async (c) => {
|
||||
|
||||
Reference in New Issue
Block a user