Design: Health Check Endpoints
Design health check endpoints for a microservice or web service. Out of scope: full monitoring system, alerting, or remediation automation.
Functional Requirements
FR1: Provide a simple HTTP endpoint to report the health status of the service
FR2: Support basic liveness check to confirm the service is running
FR3: Support readiness check to confirm the service is ready to handle requests
FR4: Include dependency checks such as database connectivity and external API availability
FR5: Return clear status codes and messages for monitoring systems
FR6: Allow configurable thresholds for health criteria
FR7: Ensure minimal performance impact on the main service
FR8: Support integration with container orchestration systems like Kubernetes
Non-Functional Requirements
NFR1: Must respond within 100ms under normal load
NFR2: Availability target of 99.9% uptime for health endpoints
NFR3: Handle up to 1000 health check requests per second
NFR4: Endpoints must be secure and not expose sensitive information
NFR5: Health checks should not cause side effects or modify data