Maintenance fan-out: one Gandalf maintenance also opens a Kuma window and a Grafana silence #67

Open
opened 2026-11-25 19:34:56 -05:00 by jared · 0 comments
Owner

Decided in the thor#1 planning session (2026-11-25): Gandalf is the one place to declare maintenance. Starting it should also cover Uptime Kuma and Grafana, so nothing else ever needs silencing by hand. Thor reads the same suppression (with its history) through Gandalf's API (gandalf#66). Full plan on LotusGuild/thor#1.

Why

On the evening of 2026-11-24 (rack maintenance, 03:10 to 03:35 UTC on 11-25) only Gandalf was silenced. Kuma had no maintenance window and Grafana had no silence, so both were free to alert about a planned outage.

Precedent

kuma.py already switches Kuma window #7 on and off around a modem restart, with the Kuma session token (uptime_kuma.token).

Proposed behaviour

  1. Start: a global (all) maintenance in Gandalf also
    • opens an Uptime Kuma maintenance window (one-off, with an end time) over the configured monitors, and
    • creates a Grafana silence (endsAt = the maintenance's end), comment naming the Gandalf suppression id and who started it.
  2. Every downstream silence carries its own end time. If Gandalf dies mid-window, nothing stays silenced forever. Extending or ending early in Gandalf updates both (Kuma: update the window's end or end it now; Grafana: update endsAt or expire the silence).
  3. Scope, v1: only global maintenance fans out. Host-scoped suppressions stay inside Gandalf (Thor still reads them). Kuma monitors have no host mapping and guests move with HA, so per-host fan-out needs more thought later.
  4. Never-silence list (optional): config list of Grafana rule UIDs and Kuma monitor ids that stay live during maintenance, for example the ones that watch Gandalf, Thor and Kuma themselves. Empty by default; operator decides.
  5. Failures never block. Maintenance always starts in Gandalf even if Kuma or Grafana refuse. Needs attention shows which downstream failed; the monitor retries each cycle, for start and for end. Every downstream object is tagged with the Gandalf suppression id, so retries never create duplicates and Gandalf can always find and close its own.
  6. Credentials: a Grafana service account limited to alerting silences (read/write); the existing Kuma session token. Both in Gandalf's config, never in the repo.
  7. History: keep start, end, who, scope and the downstream ids (Kuma window id, Grafana silence id) for every maintenance, including ended ones. Thor's grouping depends on it.

Fits with

  • The Gandalf MCP being planned in its own session: a start/end maintenance tool there is the same single entry point.
  • Thor treats the window as planned; Ceph pause, nut_ups_on_battery, UniFi firmware events and logind lines are only backup signals.

Check against 2026-11-25

With this in place, the 11-24 Gandalf silence would also have opened a Kuma window and a Grafana silence ending when the Gandalf one did.

Decided in the thor#1 planning session (2026-11-25): **Gandalf is the one place to declare maintenance.** Starting it should also cover Uptime Kuma and Grafana, so nothing else ever needs silencing by hand. Thor reads the same suppression (with its history) through Gandalf's API (gandalf#66). Full plan on LotusGuild/thor#1. ## Why On the evening of 2026-11-24 (rack maintenance, 03:10 to 03:35 UTC on 11-25) only Gandalf was silenced. Kuma had no maintenance window and Grafana had no silence, so both were free to alert about a planned outage. ## Precedent `kuma.py` already switches Kuma window #7 on and off around a modem restart, with the Kuma session token (`uptime_kuma.token`). ## Proposed behaviour 1. **Start:** a global (`all`) maintenance in Gandalf also - opens an Uptime Kuma maintenance window (one-off, with an end time) over the configured monitors, and - creates a Grafana silence (`endsAt` = the maintenance's end), comment naming the Gandalf suppression id and who started it. 2. **Every downstream silence carries its own end time.** If Gandalf dies mid-window, nothing stays silenced forever. Extending or ending early in Gandalf updates both (Kuma: update the window's end or end it now; Grafana: update `endsAt` or expire the silence). 3. **Scope, v1:** only global maintenance fans out. Host-scoped suppressions stay inside Gandalf (Thor still reads them). Kuma monitors have no host mapping and guests move with HA, so per-host fan-out needs more thought later. 4. **Never-silence list (optional):** config list of Grafana rule UIDs and Kuma monitor ids that stay live during maintenance, for example the ones that watch Gandalf, Thor and Kuma themselves. Empty by default; operator decides. 5. **Failures never block.** Maintenance always starts in Gandalf even if Kuma or Grafana refuse. Needs attention shows which downstream failed; the monitor retries each cycle, for start and for end. Every downstream object is tagged with the Gandalf suppression id, so retries never create duplicates and Gandalf can always find and close its own. 6. **Credentials:** a Grafana service account limited to alerting silences (read/write); the existing Kuma session token. Both in Gandalf's config, never in the repo. 7. **History:** keep start, end, who, scope and the downstream ids (Kuma window id, Grafana silence id) for every maintenance, including ended ones. Thor's grouping depends on it. ## Fits with - The Gandalf MCP being planned in its own session: a start/end maintenance tool there is the same single entry point. - Thor treats the window as planned; Ceph `pause`, `nut_ups_on_battery`, UniFi firmware events and logind lines are only backup signals. ## Check against 2026-11-25 With this in place, the 11-24 Gandalf silence would also have opened a Kuma window and a Grafana silence ending when the Gandalf one did.
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/gandalf#67