fritzbox-cloudflare-dyndns
fritzbox-cloudflare-dyndns copied to clipboard
feature: Add health check endpoint
First of all, great project! This enhancement request should be pretty easy to implement.
For added resiliency, add a health check endpoint to validate that the updater is actually running. Proposed endpoints could be /health or /alive, with a simple HTTP 200 as the response code. Maybe add an "ok" in the body.
Bonus points: A JSON response which lists if the last communication attempts to the Fritz!Box and Cloudflare were successful. Still keep the 200 response code, even if these connections were not successful.
Would definitely take a PR, not sure when I have time to implement that, pretty busy right now... Ideally it'd also expose some Prometheus metrics with failures and such I think so you can set up alerting
I created a draft PR for that feature that I'll be able to merge soon hopefully. I decided to do it a little differently though:
- The health endpoint will return a json status and return 503 if there's an issue
- The liveness endpoint returns 204, always
- Theres also a metrics endpoint with prometheus metrics
If you want the json content, but don't care whether it's healthy, you could just ignore the status code in what ever you use, but the way it's built now, it's kinda loosely compatible to the Kubernetes standards (without a dedicated readiness endpoint, you could probably use the health endpoint for that).
Released in v1.3.0