fritzbox-cloudflare-dyndns icon indicating copy to clipboard operation
fritzbox-cloudflare-dyndns copied to clipboard

feature: Add health check endpoint

Open matthiasschoger opened this issue 1 year ago • 1 comments

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.

matthiasschoger avatar Jan 30 '24 11:01 matthiasschoger

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

cromefire avatar Jan 30 '24 11:01 cromefire

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).

cromefire avatar Oct 24 '24 23:10 cromefire

Released in v1.3.0

cromefire avatar Oct 25 '24 19:10 cromefire