From d906e9a770f0898866744abd464dcc96121bcb34 Mon Sep 17 00:00:00 2001 From: Abhimanyu Saharan Date: Sun, 15 Feb 2026 02:22:28 +0530 Subject: [PATCH] feat(api): add health check endpoints with appropriate tags for service monitoring --- backend/app/main.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/backend/app/main.py b/backend/app/main.py index 8de746cf..70119db1 100644 --- a/backend/app/main.py +++ b/backend/app/main.py @@ -41,6 +41,12 @@ if TYPE_CHECKING: configure_logging() logger = get_logger(__name__) OPENAPI_TAGS = [ + { + "name": "health", + "description": ( + "Service liveness/readiness probes used by infrastructure and runtime checks." + ), + }, { "name": "agent", "description": ( @@ -112,19 +118,19 @@ else: install_error_handling(app) -@app.get("/health") +@app.get("/health", tags=["health"]) def health() -> dict[str, bool]: """Lightweight liveness probe endpoint.""" return {"ok": True} -@app.get("/healthz") +@app.get("/healthz", tags=["health"]) def healthz() -> dict[str, bool]: """Alias liveness probe endpoint for platform compatibility.""" return {"ok": True} -@app.get("/readyz") +@app.get("/readyz", tags=["health"]) def readyz() -> dict[str, bool]: """Readiness probe endpoint for service orchestration checks.""" return {"ok": True}