๐ Heartbeat monitor (dead man's switch)
This feature is part of kwatch Pro, which is free during early access. See Community vs Pro.
This is an optional watch-the-watcher check. An external service expects a regular ping from kwatch; if the pings stop, that service alerts you.
Sends periodic HTTP GET pings to an external health-check URL. If kwatch stops or crashes, the external monitor stops receiving pings and pages you.
This is useful for detecting when kwatch itself is down โ a "watch the watcher" pattern.
How it worksโ
kwatch โโ GET https://hc-ping.com/your-uuid โโโบ Healthchecks.io
(every 300 seconds)
If kwatch crashes:
Healthchecks.io stops receiving pings
After grace period โ sends you an alert (email, SMS, etc.)
Configurationโ
| Parameter | Type | Default | Description |
|---|---|---|---|
heartbeatMonitor.enabled | bool | false | Enable heartbeat pings. |
heartbeatMonitor.interval | int (sec) | 300 | Seconds between pings (min: 1). |
heartbeatMonitor.url | string | "" | Secret-backed ${file:/absolute/path} URL to ping. |
Example with Healthchecks.ioโ
Healthchecks.io is a free dead-man's switch service.
apiVersion: v1
kind: Secret
metadata:
name: kwatch
namespace: kwatch
stringData:
heartbeat-url: "replace-me"
Add the monitor settings through the kwatch.sh installer's Configure settings flow:
heartbeatMonitor:
enabled: true
interval: 300
url: "${file:/config/heartbeat-url}"
- Sign up at Healthchecks.io
- Create a new check
- Copy the ping URL
- Configure kwatch as shown above
- In Healthchecks.io, set the period and grace as described in Pick a period and grace
How kwatch pingsโ
- Each ping is an HTTP
GETto the configured URL. A2xxresponse counts as accepted; anything else is counted as a failed ping (heartbeat_failedin health reasons). - Redirects are not followed, so use the final ping URL your provider shows.
- A ping times out after 10 seconds.
- kwatch pings as soon as it starts monitoring, then every
intervalseconds. A ping is sent only while monitoring is ready, so a kwatch that is running but not monitoring stops pinging, and the external monitor alerts you. - The URL often contains a token. Keep it in the Secret as shown above; kwatch does not log it.
Pick a period and graceโ
Set the provider's expected period to kwatch's interval (default 300 seconds), and the grace to at least two intervals. One missed or slow ping then does not page you, while a real outage still does within a few minutes. If you lower interval to 60, lower the period and grace with it.
Point the heartbeat at an external serviceโ
kwatch needs a ping URL that accepts a plain GET with no headers. Healthchecks.io does, and so can other dead-man's-switch services. Use the period and grace from the section above.
- Create a check in Healthchecks.io and set its period and grace as described above.
- Copy the check's ping URL into the Secret (
heartbeat-url). - Enable
heartbeatMonitoras shown above.
See the Healthchecks.io documentation.
Paging through PagerDuty or Opsgenieโ
Do not point kwatch at PagerDuty or Opsgenie directly. Opsgenie heartbeat pings need an API key header, which kwatch does not send, and Atlassian is retiring Opsgenie. Instead, let the dead-man's switch send the alert: add PagerDuty or Opsgenie as an integration of your Healthchecks.io project, so a missed ping pages your on-call there. See the Healthchecks.io integrations documentation for the current list and setup steps.
Relatedโ
- Kubernetes failure coverage: every detector and its edition
- General configuration and the generated configuration reference
- Community vs Pro
- Troubleshoot missing or delayed alerts