Skip to content

feat(monitoring): send a Watchdog alert to an outside heartbeat #4999

Open

Description

@dan-petty

Update 2026-11-26 (infra move): The rule, route, mount and Secret row move out of this item.

k8s/monitoring/ and the cluster Secret table are in dan-petty/homelab, and dan-petty/homelab#378 holds that work. This item keeps only the product part of the design below: the keyring credential healthchecks.ping_url and its loader test.


Problem or Motivation

All alerts go to Mattermost in the same cluster, and Alertmanager and the Mattermost files volume share one node. When the cluster, Prometheus, Alertmanager or Mattermost stops, no alert reaches a person. #1390 (closed) named an outside watchdog as a later item, but nobody filed it. This item is rank 8 of the cluster integration plan #4989.

Proposed Solution & Architectural Design

  1. Add a Watchdog rule (vector(1)) that always fires.
  2. Add an Alertmanager route with a short repeat interval to a webhook_config that reads its URL with url_file from a mounted Secret, as the Mattermost URL does.
  3. The receiver is an outside Healthchecks check (BSD-3-Clause). When the pings stop, Healthchecks tells the owner by its own channel.
  4. Add a promtool case and a SECURITY.md egress row. The monitoring NetworkPolicy already allows egress on TCP 443.

Owner decision

Choose hosted Healthchecks.io or a self-hosted Healthchecks outside the cluster. The recommended answer on #4989 is the hosted free tier. The owner makes the account, the check and its notify channel, and puts the ping URL in the keyring. devops k8s push-secrets writes it into a Secret. No secret goes into git. Agents write the rule, the route and the tests; the owner does the account and secret steps.

Target Subsystem

The managed credentials in src/devops_cli/config/env.py. The monitoring files are in dan-petty/homelab (#7163).

Existing Tool Considered

Healthchecks (BSD-3-Clause), hosted or self-hosted, with the standard Alertmanager webhook receiver. Nothing is built.

Acceptance Criteria

  • A promtool case shows that Watchdog always fires.
  • The route sends Watchdog to the heartbeat receiver only.
  • With the Secret in place, the Healthchecks check shows a ping at each repeat interval. When Alertmanager stops, the check goes down and the owner gets a notice.

Dependencies

Owner decision 1 on #4989: the account, the check and the ping URL in the keyring.

Source: #4989

Alternatives check of 2026-11-27: covers.
Tool: healthchecks/healthchecks (https://github.com/healthchecks/healthchecks), BSD-3-Clause, last activity 2026-11-23, maintained.
Reason: The repository page and searches show Healthchecks is an open heartbeat monitor: it accepts HTTP pings and alerts the owner when pings stop or run late, so it covers the outside heartbeat; the Watchdog rule, route and credential stay in the project.

Covers:

  • Accepts HTTP pings from an Alertmanager webhook receiver
  • Sends alerts when a ping does not arrive on time
  • Period and grace time set the repeat interval and down threshold
  • Hosted service keeps the check outside the cluster and its node
  • 25+ notification integrations for the owner's channel

Lacks:

  • No Watchdog rule or Alertmanager route; that config lives in homelab
  • No keyring credential or Secret row for the ping URL
  • No promtool case proving Watchdog always fires
  • No egress row for the monitoring NetworkPolicy

Proposed design

Problem statement

All alerts go to Mattermost in the same cluster. An outage of the cluster, Prometheus, Alertmanager or Mattermost sends no alert to a person. An outside Healthchecks check reports a stopped alert path. This item declares the keyring credential healthchecks.ping_url in the managed credentials of this repository and proves the row shape. The environment tree of dan-petty/homelab holds the Watchdog rule, the Alertmanager route, the Secret mount and the cluster-secrets.toml row, and dan-petty/homelab#378 holds that work.

Acceptance criteria

Requirement: Heartbeat ping URL is a managed credential

The managed credentials SHALL declare healthchecks.ping_url as an optional keyring credential.

Scenario: The credential table holds the heartbeat key

  • WHEN uv run pytest tests/k8s/test_cluster_secret_healthchecks.py -k credential runs.
  • THEN The command exits 0, and its case reports healthchecks.ping_url as an optional managed credential.

Requirement: The loader builds the heartbeat row

The cluster Secret loader MUST build row monitoring/alertmanager-healthchecks from a cluster-secrets.toml that holds it, under stack infra, with one optional url entry from healthchecks.ping_url.

Scenario: A cluster-secrets file holds the heartbeat row

  • WHEN uv run pytest tests/k8s/test_cluster_secret_healthchecks.py -k row runs over a cluster-secrets.toml that holds the heartbeat row.
  • THEN The command exits 0, and its case reports the row under stack infra with one optional url entry from healthchecks.ping_url.

Requirement: A missing ping URL skips the row

A push with no healthchecks.ping_url in the keyring MUST skip row monitoring/alertmanager-healthchecks.

Scenario: The keyring holds no ping URL

  • WHEN uv run pytest tests/k8s/test_cluster_secret_healthchecks.py -k skip runs with no healthchecks.ping_url in the keyring.
  • THEN The command exits 0, and its case reports the row as skipped and no Secret for it.

Existing Tool Considered

The alternatives check of 2026-11-21 in the issue body gives the verdict covers for healthchecks/healthchecks (BSD-3-Clause, maintained). That block lists what the tool covers and what it lacks. This item builds no monitor and no ping service. It declares keyring credential healthchecks.ping_url in src/devops_cli/config/env.py and proves the row shape, which fills the keyring part of the block's Lacks: list. The environment tree of dan-petty/homelab fills the rule, route and egress part, and dan-petty/homelab#378 holds it.

Key questions

  • The alternatives check found that https://github.com/healthchecks/healthchecks covers this item. Adopt the tool, or keep the item and give the reason.: Adopt healthchecks/healthchecks. A person replied to the alternatives check with this decision. AGENTS.md rule 3 requires an open tool before the project builds code, and this item builds no monitor. (best practice) [sources: AGENTS.md]
    • Chosen: Adopt healthchecks/healthchecks. The person's reply adopts it, and the check of 2026-11-21 gives the verdict covers for a maintained BSD-3-Clause tool.
    • Rejected: Keep the item with a reason. No reason remains. The tool covers the outside heartbeat, and the item adds no monitor.
  • Which repository holds the Watchdog rule, the Alertmanager route and the Secret mount?: dan-petty/homelab. Step 11 of docs/HOMELAB_REPO_SWITCH.md switched Argo CD to that repository. tests/gate/k8s_checks/environment_freeze.py treats k8s/monitoring/prometheus-values.yaml as an environment path, and the k8s row refuses an edit to that file in this repository. [sources: docs/HOMELAB_REPO_SWITCH.md, tests/gate/k8s_checks/environment_freeze.py, CONTEXT.md]
  • Which files hold the managed credentials and the cluster Secret push table now?: src/devops_cli/config/env.py holds the managed credentials. src/devops_cli/k8s/cluster_secrets.py loads the push rows from cluster-secrets.toml in the environment tree, and tests/fixtures/cluster-secrets.toml holds the rows that the tests read. [sources: src/devops_cli/config/env.py, src/devops_cli/k8s/cluster_secrets.py, tests/fixtures/cluster-secrets.toml, openspec/specs/cluster-secrets-loader/spec.md]
  • Where does the heartbeat row go, now that src/ holds no stack="infra" row?: The row goes into cluster-secrets.toml of the environment tree in dan-petty/homelab, with the rule, route and mount of dan-petty/homelab#378. This repository declares only the keyring credential and proves the row shape with a test. (best practice) [sources: src/devops_cli/k8s/cluster_secrets.py, tests/k8s/test_cluster_secret_source.py, openspec/specs/cluster-secrets-loader/spec.md]
    • Chosen: Row in the environment tree cluster-secrets.toml. The loader reads cluster-secrets.toml from the environment tree, and the invariant test forbids an infra row in src/.
    • Rejected: Row in src/devops_cli/k8s/cluster_secrets.py. refactor(k8s): read the environment Secret rows from homelab #6685 moved the rows out, and test_no_moved_stack_rows_remain fails the build on an infra row in src/.
    • Rejected: Row in tests/fixtures/cluster-secrets.toml only. The fixture is test data. It writes no Secret in the cluster.
  • How does the ping URL reach the Secret without a secret in git?: Use keyring credential healthchecks.ping_url and row monitoring/alertmanager-healthchecks with key url under stack infra. devops k8s push-secrets writes the Secret from the keyring. The owner puts the ping URL in the keyring. (best practice) [sources: SECURITY.md, src/devops_cli/config/env.py, src/devops_cli/k8s/cluster_secrets.py]
    • Chosen: Keyring credential and environment row. It follows the Mattermost hook and rule 1 of SECURITY.md, and it keeps the URL out of git.
    • Rejected: Literal URL in the row file. It puts a secret in a committed file, against rule 1 of SECURITY.md.
    • Rejected: The owner writes the Secret by hand. It is not repeatable, and the project writes each platform Secret with devops k8s push-secrets.
  • Is the heartbeat credential optional?: Yes. The managed credentials mark healthchecks.ping_url as optional, as the Mattermost hook is. A push with no value skips the row, so the owner can push before the account exists. (best practice) [sources: src/devops_cli/config/env.py, SECURITY.md]
    • Chosen: Optional credential. A push succeeds before the owner creates the Healthchecks check, and no other Secret depends on it.
    • Rejected: Required credential. Every push fails for a person who has no Healthchecks account, and the owner's account step comes later.
  • Which Healthchecks deployment does the heartbeat use, and who does the account step?: Hosted Healthchecks.io on the free tier. It adds no service or host for the project to run and keep. The owner creates the account, the check and the notify channel, and puts the ping URL in the keyring after the merge. Agents write no secret. (best practice) [sources: AGENTS.md]
    • Chosen: Hosted Healthchecks.io free tier. It covers the outside heartbeat and adds no service or host for the owner to run and keep.
    • Rejected: Self-hosted Healthchecks outside the cluster. It covers the same need but adds a service and a host for the owner to run and keep.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Moved to new items

dan-petty/homelab#374, dan-petty/homelab#378

Activity

  1. added
    source/agent
    on Nov 12, 2026
  2. added
    type/feature
    scope/monitoring
    status/new
    value/medium
    effort/low
    on Nov 12, 2026
  3. dan-petty commented on Nov 12, 2026

    @dan-petty
    OwnerAuthor
  4. added
    priority/p2-medium
    on Nov 12, 2026
  5. devops-cli-service commented on Nov 15, 2026

    @devops-cli-service
    Contributor

    Alternatives check: covers

    Reason: Healthchecks is exactly the outside dead-man's-switch the issue describes: a check with a ping URL that an Alertmanager webhook_config posts to at each repeat interval, and that notifies the owner through its own channels when the pings stop. It is available hosted (Healthchecks.io) or self-hosted outside the cluster under BSD-3-Clause, so the only remaining work is the project's own rule, route, test and egress row.

    Tool: healthchecks/healthchecks (https://github.com/healthchecks/healthchecks)

    • License: BSD-3-Clause
    • Last activity: 2026-11-13
    • Maintained: yes

    Covers:

    • A check with a ping URL that an Alertmanager webhook_config can POST to at a short repeat interval
    • Notifies the owner through its own channels (email, chat, webhooks) when the pings stop
    • Runs hosted (Healthchecks.io free tier) or self-hosted outside the cluster, so an in-cluster outage does not stop the notice
    • A grace period / schedule that turns a missed ping into a down state and an alert

    Lacks:

    • Does not provide the in-cluster Watchdog recording rule or the Alertmanager route in k8s/monitoring/
    • Does not provide the promtool test case or the SECURITY.md egress row
    • The owner still has to create the account, the check and its notify channel, and put the ping URL in the keyring

    Tools considered:

    Searches run:

    • Healthchecks.io Alertmanager Watchdog heartbeat integration, results: 5
    • dead man's switch cron monitoring self-hosted Alertmanager webhook receiver, results: 5
    • healthchecks/healthchecks GitHub self-hosted, results: 5
    • Healthchecks.io ping URL cron job monitoring dead man's switch, results: 5
    • healthchecks.io documentation alerting integrations, results: 5
    • Healthchecks ping URL "when the pings stop" notify, results: 5
    • Prometheus Alertmanager Watchdog heartbeat dead man's switch external service, results: 5

    Sources:

    Checked on 2026-11-15. A person decides what this means for the item. The check changes no label and closes no issue.

  6. devops-cli-service commented on Nov 16, 2026

    @devops-cli-service
    Contributor

    Owner question: Which Healthchecks deployment and owner setup should the heartbeat use? (a person decides)

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

  7. devops-cli-service commented on Nov 21, 2026

    @devops-cli-service
    Contributor

    Owner question: See the first point of Open questions in the section Proposed design of the body.

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

  8. dan-petty commented on Nov 24, 2026

    @dan-petty
    OwnerAuthor

    Adopt the tool: healthchecks/healthchecks. AGENTS.md rule 3 requires using an open tool before building.

  9. added
    status/ready
    and removed
    status/new
    on Nov 24, 2026
  10. devops-cli-service commented on Nov 24, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See Moved to new items in the section Proposed design of the body.

  11. dan-petty commented on Nov 25, 2026

    @dan-petty
    OwnerAuthor

    Returning #4999 to New with evidence. The proposed design requires modifying k8s/monitoring/prometheus-values.yaml to add the watchdog rule group, the healthchecks Alertmanager receiver, the Watchdog child route, and the alertmanager-healthchecks secret mount. Since step 11 of docs/HOMELAB_REPO_SWITCH.md switched Argo CD to dan-petty/homelab, tests/gate/k8s_checks/environment_freeze.py:38-75 (is_environment_path("k8s/monitoring/prometheus-values.yaml") == True) rejects edits to that file in uv run devops ci --check --only k8s. Re-refine #4999 or move the monitoring rule and Alertmanager route change to dan-petty/homelab before implementing.

  12. added
    status/new
    and removed
    status/ready
    on Nov 25, 2026
  13. added
    status/ready
    and removed
    status/new
    on Nov 25, 2026
  14. devops-cli-service commented on Nov 25, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See Moved to new items in the section Proposed design of the body.

  15. dan-petty commented on Nov 25, 2026

    @dan-petty
    OwnerAuthor

    Returning #4999 because its Proposed design (checked-at: sha=3dbcbd0bd22c50b8d0c19f57851efae77a640193) cannot be built as written on origin/main:

    1. Moved Secret table (#6685): The design instructs adding the monitoring/alertmanager-healthchecks row (stack="infra") to src/devops_cli/k8s/cluster_secrets.py, citing monitoring/alertmanager-mattermost at src/devops_cli/k8s/cluster_secrets.py:567 as the model. On origin/main, #6685 removed all chat, gitea, infra, and base rows from src/devops_cli/k8s/cluster_secrets.py (line 567 is now inside devops/crawl4ai), and moved monitoring/alertmanager-mattermost into data (tests/fixtures/cluster-secrets.toml:179-193) loaded from k8s_dir / "cluster-secrets.toml" (src/devops_cli/k8s/cluster_secrets.py:472-494).
    2. Invariant test forbids stack="infra" in src/: tests/k8s/test_cluster_secret_source.py::test_no_moved_stack_rows_remain (openspec/specs/cluster-secrets-loader/spec.md:22-27) asserts git grep -n -E 'stack=(BASE_STACK|"(chat|gitea|infra)")' src/ returns exit code 1 with empty output. Adding an infra row to src/devops_cli/k8s/cluster_secrets.py fails this invariant check.
    3. Homelab cluster-secrets.toml is outside this repository: dan-petty/homelab does not yet hold cluster-secrets.toml (repos/dan-petty/homelab/git/trees/main?recursive=1 returned zero cluster-secrets files, and repos/dan-petty/homelab/contents/k8s/cluster-secrets.toml returned HTTP 404).

    Please re-scope #4999 (or move the Secret row to #7163 / dan-petty/homelab) so devops-cli only declares keyring credential healthchecks.ping_url in src/devops_cli/config/env.py (or tests fixture support cleanly alongside cluster-secrets.toml schema/fixture expectations) without placing stack="infra" rows in src/devops_cli/k8s/cluster_secrets.py.

  16. added
    status/new
    and removed
    status/ready
    on Nov 25, 2026
  17. added
    status/ready
    and removed
    status/new
    on Nov 26, 2026
  18. devops-cli-service commented on Nov 26, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See Moved to new items in the section Proposed design of the body.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p2-mediumscope/monitoringsource/agentstatus/readytype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions