feat: add /healthcheck endpoint for external monitoring#77
Open
feat: add /healthcheck endpoint for external monitoring#77
Conversation
Add HTTP endpoint at /healthcheck (no /api prefix) that: - Returns 200 OK when all enabled apps are healthy - Returns 503 Service Unavailable when any apps are expired - Includes expired app details in response for debugging This enables integration with healthchecks.io, Uptime-kuma, and other external monitoring services that can detect when sideloaded apps need refreshing. Relates to #75
- Add IsExpired() method to InstalledApp model for strict expiration check - Add HasExpiredApps() function in service layer - Simplify /healthcheck endpoint to use service function - Remove expired app details from response, only return status The expiration check now uses strict logic: ExpirationDate < now instead of NeedRefresh() which includes advance days buffer.
|
Great idea, I find this to be helpful as it allows us to further improve external monitoring 👍 |
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
This PR adds a health check endpoint at
/healthcheck(no/apiprefix) to enable integration with external monitoring services like healthchecks.io and Uptime-kuma.Changes
New Endpoint
GET /healthcheckImplementation Details
IsExpired()method toInstalledAppmodel for strict expiration check (ExpirationDate < now)HasExpiredApps()function in service layer to check for expired appsUse Cases
Users can now configure external monitoring services:
/healthcheckURLWhen sideloaded apps expire and need refreshing, the endpoint returns 503, triggering alerts from the monitoring service.
Related Issue
Closes #75 (Support success webhooks/alerts - enables watchdog heartbeat functionality)