News for hackers. Stuff that matters.
Re:Ask HN: How do you monitor your websites? by philip1209 on Wednesday October 24, 2018 @12:12PM (#18293716)
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.

Re:Ask HN: How do you monitor your websites? by Spivak on Wednesday October 24, 2018 @12:27PM (#18293870)
Are you worried about that endpoint being used for DoS or is it light enough?
Re:Ask HN: How do you monitor your websites? by iw0 on Wednesday October 24, 2018 @12:34PM (#18293946)
The 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.
Re:Ask HN: How do you monitor your websites? by petecoop on Thursday October 25, 2018 @09:09AM (#18300581)
I'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
Re:Ask HN: How do you monitor your websites? by philip1209 on Wednesday October 24, 2018 @12:37PM (#18293980)
It's rate-limited and behind Cloudflare. But, the checks are like "can I connect to Redis", so it is pretty lightweight.