Skip to content

Add health check endpoint#205

Open
devin-ai-integration[bot] wants to merge 2 commits intomasterfrom
devin/1777652426-add-health-check-endpoint
Open

Add health check endpoint#205
devin-ai-integration[bot] wants to merge 2 commits intomasterfrom
devin/1777652426-add-health-check-endpoint

Conversation

@devin-ai-integration
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot commented May 1, 2026

Summary

Adds a /health endpoint that reports application and database health status. Also configures Spring Boot Actuator to expose its built-in /actuator/health and /actuator/info endpoints.

Custom /health endpoint:

  • Returns 200 OK with {"status": "UP", "db": {"status": "UP", "database": "..."}} when healthy
  • Returns 503 Service Unavailable with {"status": "DOWN", ...} when the database is unreachable or the connection is invalid
  • Validates database connectivity via Connection.isValid() with a 2-second timeout

Actuator configuration:

  • Exposes health and info management endpoints via /actuator/health and /actuator/info
  • Configures show-details=always for full health indicator details

Review & Testing Checklist for Human

  • Start the app with Docker Compose (docker-compose up) and verify GET /health returns {"status": "UP", "db": {"status": "UP", "database": "MySQL"}} with HTTP 200
  • Stop the MySQL container and verify GET /health returns {"status": "DOWN", ...} with HTTP 503
  • Verify GET /actuator/health also returns health information via Actuator

Notes

  • The project already had spring-boot-starter-actuator as a dependency but no endpoints were exposed — this PR enables them.
  • Fixed a bug caught by Devin Review where conn.isValid() returning false would still result in a 200 response with "status": "UP".

Link to Devin session: https://app.devin.ai/sessions/43ca43537c32478387c4ea63928cc90a
Requested by: @WesternConcrete


Devin Review

Status Commit
⚪ Not started

Run Devin Review

💡 Connect your GitHub account to enable automatic code reviews.

Open in Devin Review (Staging)
Open in Devin Review

- 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>
@devin-ai-integration
Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

devin-ai-integration[bot]

This comment was marked as resolved.

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>
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 this pull request may close these issues.

1 participant