3 ms·
I basically add a /global-health endpoint on my server. It executes a bunch of checks programmatically - e.g. database connection, rendering working, etc. It wo
by philip1209 8y ago
I basically add a /global-health endpoint on my server. It executes a bunch of checks programmatically - e.g. database connection, rendering working, etc. It would be easy to add in "fail if cert expires in next month".
Then, I monitor just that one endpoint with Stackdriver (because it's easy). If any of the checks fail, it logs it, prints details, and sets a 500 header code. Adding new checks is just a code change.
- Spivak 8y agoAre you worried about that endpoint being used for DoS or is it light enough?
- iw0 8y agoThe way i do it is running the checks in a background every x minutes and add the result in a json file. It’s fast and safe.
- petecoop 8y agoI'd guess you'd then also want to return a timestamp in the response and then fail if the timestamp is older than x minutes too
- philip1209 8y agoIt's rate-limited and behind Cloudflare. But, the checks are like "can I connect to Redis", so it is pretty lightweight.