Skip to content

Add /_mgmt/health endpoint #824

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
vincentsarago opened this issue Apr 17, 2025 · 0 comments · Fixed by #825
Closed

Add /_mgmt/health endpoint #824

vincentsarago opened this issue Apr 17, 2025 · 0 comments · Fixed by #825

Comments

@vincentsarago
Copy link
Member

Right now when we create an application we register a /_mgmt/ping endpoint to enable check for liveliness. This if fine but usually system (e.g Kubernetes) would want to check for readiness (a.k.a make sure database connection works, ...)

def add_health_check(self) -> None:
"""Add a health check."""
mgmt_router = APIRouter(prefix=self.app.state.router_prefix)
@mgmt_router.get("/_mgmt/ping")
async def ping():
"""Liveliness/readiness probe."""
return {"message": "PONG"}
self.app.include_router(mgmt_router, tags=["Liveliness/Readiness"])

I propose we register another health endpoint /_mgmt/health which can return more information about the application readiness.

ref: stac-utils/stac-fastapi-pgstac#229

cc @emmanuelmathot

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 a pull request may close this issue.

1 participant