Add health check endpoint#205
Open
devin-ai-integration[bot] wants to merge 2 commits intomasterfrom
Open
Conversation
- Add /health endpoint with database connectivity check - Enable Spring Boot Actuator health and info endpoints - Configure actuator to show health details Co-Authored-By: Wes Convery <2wconvery@gmail.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Previously the endpoint would return 200 with status UP even when the database connection was invalid. Now it correctly returns 503 with status DOWN in both the invalid-connection and exception cases. Co-Authored-By: Wes Convery <2wconvery@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
/healthendpoint that reports application and database health status. Also configures Spring Boot Actuator to expose its built-in/actuator/healthand/actuator/infoendpoints.Custom
/healthendpoint:200 OKwith{"status": "UP", "db": {"status": "UP", "database": "..."}}when healthy503 Service Unavailablewith{"status": "DOWN", ...}when the database is unreachable or the connection is invalidConnection.isValid()with a 2-second timeoutActuator configuration:
healthandinfomanagement endpoints via/actuator/healthand/actuator/infoshow-details=alwaysfor full health indicator detailsReview & Testing Checklist for Human
docker-compose up) and verifyGET /healthreturns{"status": "UP", "db": {"status": "UP", "database": "MySQL"}}with HTTP 200GET /healthreturns{"status": "DOWN", ...}with HTTP 503GET /actuator/healthalso returns health information via ActuatorNotes
spring-boot-starter-actuatoras a dependency but no endpoints were exposed — this PR enables them.conn.isValid()returningfalsewould still result in a 200 response with"status": "UP".Link to Devin session: https://app.devin.ai/sessions/43ca43537c32478387c4ea63928cc90a
Requested by: @WesternConcrete
Devin Review