We want to know immediately when the servers are not functioning or API servers break down. We can do this easily by setting up the healthchecks in CloudFlare.
It alows us to send health checks pings to the destination URLs and you can also specify the expected HTTP code, or the target response text. This is a quick way to write a test – also known as the Canaries.
Then from server logs, you can see:
[27/Mar/2021:19:03:01 +0000] “GET /api/merger/query/ HTTP/1.1” 200 372 “-” “Mozilla/5.0 (compatible;Cloudflare-Healthchecks/1.0;+https://www.cloudflare.com/; healthcheck-id: 2f2501de83eeaf85)”
You will be notified by email (sent from email@example.com) in case of any errors:
Health check status changed
2021-03-25 08:10:25 +0000 UTC | Down | Response code mismatch error | helloacm-api
Expected code: 
Received code: 522
To unsubscribe, please edit your Cloudflare Healthchecks notification settings.
Cloudflare, Inc. · 101 Townsend Street · San Francisco, CA 94107 · USA
- Make Your WordPress Fast Again! This WordPress is accelerated by WP Rocket Plugin!
- Free $10 Credit, when you sign up with Vultr Cloud VPS (4 Months Giveaway!)
- Free $10 Credit, when you sign up with Digital Ocean Cloud VPS (2 Months Giveaway!)
- Free $20 Credit, when you sign up with Linode Cloud VPS (4 Months Giveaway!) - (Coupon: PodCastInit2018)
- The easiest way to Buy and Sell Bitcoins/Litecoins via Wirex Visa Debit Card!
- Buy and Sell Bitcoins/Litecoins via Local Bitcoins