Deep Ping
Method
REST method is adopted.
HTTP Method
GET: Comprehensive health check (with database connection test)
Naming Convention
To unify the naming of query parameters and nodes and improve readability, snake_case is used for URIs and JSON nodes in requests.
Request and Response
Headers
Meta information is set in HTTP headers, not in the response body.
Request Headers
AcceptAccept-language
Response Headers
Content-Type
Comprehensive Health Check
URI
Response
The response is JSON.
Response Fields
| Name | Type | Description |
|---|---|---|
| message | string | Database connection success message |
Authentication
This endpoint does not require authentication.
Error Handling
The status codes for error handling are as follows.
| Description | Status Code | Status Name |
|---|---|---|
| Internal server error | 500 | Internal Server Error |
| Database unavailable | 503 | Service Unavailable |
Processing Flow
- Execute a test database query
- Verify connection and response
- Return success message if query succeeds
- Return error if database is unreachable
Database Check
- Executes a lightweight SELECT query
- Verifies connection pool health
- Tests database responsiveness
- Catches connection errors
Use Cases
- Kubernetes readiness probes
- Deployment verification
- Database health monitoring
- Connection issue troubleshooting
Health Check Strategy
Shallow Check (/v1/ping)
- Fast, no dependencies
- Confirms the application is running
- Suitable for liveness checks
- Response time: < 10ms
Deep Check (/v1/ping/deep)
- Tests critical dependencies
- Verifies overall system health
- Suitable for readiness checks
- Response time: < 100ms
Detailed Flowchart
flowchart TD
Start([GET /ping/deep]) --> TestQuery[Execute Test DB Query]
TestQuery --> QueryOK{Successful?}
QueryOK -->|NG| Err500[500 Internal Error<br/>DB connection failed]
QueryOK -->|OK| Success[200 OK<br/>DB healthy]