Enhance Healthchecks with up/down livestats - #1027
Conversation
Show check up/down counts on the tile via the Management API, matching other uptime-style enhanced apps.
The Management API returns 401 with a { "error": ... } body when the
API key is missing or revoked, and execute() is configured with
http_errors => false, so that body reaches livestats() as a stdClass
with no "checks" property. Reading it directly raised an undefined
property warning, which Laravel promotes to an ErrorException, so
get_stats returned a 500 and the tile broke instead of falling back to
zeroed counts.
Coalesce the property to null so a malformed or error response leaves
the tile inactive, and flip the status to active only when a real
checks array came back - matching the KuvaszUptime pattern this app
follows.
|
Reviewed and merging — thanks for this, the Kuvasz pattern was the right one to follow here. I pushed one fix onto the branch before merge. The fix coalesces to null ( |
Summary
Add enhanced support to the existing Healthchecks app so the tile shows Up / Down check counts, similar to Uptime Kuma and Kuvasz Uptime. Implementation follows the Kuvasz Uptime pattern closely (JSON list endpoint, API-key header, Up/Down livestats,
dataonlyrefresh).status)GET /api/v3/checks/for both Test and livestatsX-Api-Keyheader (read-only keys work)dataonly=1— up/down counts refresh on the 30s intervalupanddownonly (new/grace/pausedare ignored)Test plan
Tested against my self-hosted Healthchecks and Heimdall instances:
GET /api/v3/checks/