Get updates on the health of your origin where you need them

Darius Jankauskas
13 min readintermediate
--
View Original

Overview

The article discusses the introduction of Health Checks in the Cloudflare Dashboard's Notifications tab, aimed at enhancing server health monitoring for Pro, Business, and Enterprise customers. It highlights the new capabilities for receiving alerts, integrating with webhooks, and streamlining notification management to improve response times to server health issues.

What You'll Learn

1

How to set up Health Checks notifications in the Cloudflare Dashboard

2

How to integrate Health Checks with webhooks for real-time alerts

3

How to create a status page using Cloudflare Workers and Durable Objects

4

How to authenticate webhook requests to secure your notifications

Prerequisites & Requirements

  • Basic understanding of webhooks and server health monitoring concepts
  • Familiarity with Cloudflare Dashboard and Cloudflare Workers(optional)

Key Questions Answered

What are Health Checks in Cloudflare and how do they work?
Health Checks in Cloudflare allow users to monitor the availability and responsiveness of their origins by checking criteria such as reachability, HTTP status codes, and content. Users can receive alerts when their origin is deemed unhealthy based on custom criteria, enhancing server reliability.
How can I set up notifications for Health Checks?
Users can set up notifications for Health Checks through the Cloudflare Notifications dashboard. This integration allows for various notification methods, including email alerts and webhooks, to ensure timely updates on origin health.
What are the benefits of using webhooks with Health Checks?
Webhooks provide flexibility by allowing Health Check notifications to be sent to various external services, such as Slack or internal APIs. This ensures that critical updates are delivered in real-time, improving incident response times.
How do I authenticate webhook requests for security?
To authenticate webhook requests, users can generate a secret and include it in the request headers. The Cloudflare Worker can then verify this secret to ensure that the incoming notifications are legitimate, preventing unauthorized access.

Technologies & Tools

Backend
Cloudflare Workers
Used to create a status page that updates based on Health Check notifications.
Backend
Durable Objects
Used to store and manage the health status of origins in the status page application.

Key Actionable Insights

1
Integrate Health Checks with your existing monitoring systems using webhooks to enhance alerting capabilities.
By utilizing webhooks, you can receive real-time notifications in your preferred communication channels, such as Slack or Microsoft Teams, ensuring that your team is promptly informed of any server health issues.
2
Create a centralized status page using Cloudflare Workers to display the health of your origins.
This status page can provide transparency to your users about the operational status of your services, improving user trust and communication during outages or maintenance.
3
Regularly review and update your Health Checks configuration to adapt to changing application requirements.
As your application evolves, the criteria for what constitutes a healthy origin may change. Keeping your Health Checks up to date ensures that you are alerted to relevant issues.

Common Pitfalls

1
Failing to authenticate webhook requests can expose your status page to unauthorized updates.
Without proper authentication, anyone with the webhook URL could send arbitrary data to your status page. Implementing a secret verification mechanism is essential to secure your notifications.

Related Concepts

Webhooks
Cloudflare Workers
Server Health Monitoring
Real-time Notifications