Skip to content

Add a health‑check endpoint for container orchestration - #88

Closed
kael-developer[bot] wants to merge 1 commit into
ai-devfrom
agent/add-a-health-check-endpoint-for-containe
Closed

Add a health‑check endpoint for container orchestration#88
kael-developer[bot] wants to merge 1 commit into
ai-devfrom
agent/add-a-health-check-endpoint-for-containe

Conversation

@kael-developer

Copy link
Copy Markdown
Contributor

Context

Problem
Kubernetes or other orchestrators have no way to verify that the SDLC service is healthy; missing liveness/readiness probes can cause downtime or slow recovery.

Solution
Expose a /healthz GET endpoint that returns HTTP 200 with JSON indicating overall status and sub‑checks (database connectivity, scheduler thread alive, message broker if used). Integrate this endpoint into the Dockerfile with a HEALTHCHECK directive.

Value
Enables automated health monitoring, rapid detection of failures, and smooth restarts in production environments.

Implementation notes
In the FastAPI app, add a route that runs quick sanity checks (e.g., engine.is_running(), db.session.execute('SELECT 1')). Return { "status": "ok", "checks": { "db": true, "scheduler": true } }. Update the Dockerfile to include HEALTHCHECK --interval=30s --timeout=5s CMD curl -f http://localhost:8000/healthz || exit 1. Add unit tests for the health endpoint.
Priority: P1

Implementation summary

We need to add healthHandler function above maybe after imports. Need to import net/http and encoding/json already imported. Already have net/http imported. At top imports line 3 included net/http. Good.

Add function before main or after generateID. Let's add after generateID for readability.

We need to edit file inserting new function. Use edit_file with context near end. Provide old snippet unique: maybe the closing brace of file. Let's open last few lines.

Closes #85

@unitz007
unitz007 deleted the branch ai-dev March 15, 2026 20:00
@unitz007 unitz007 closed this Mar 15, 2026
@unitz007
unitz007 deleted the agent/add-a-health-check-endpoint-for-containe branch March 15, 2026 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant