Thor contract: [gandalf] title tag, machine-key read API for Thor, pre-check Thor before host/cluster tickets, dedup_key #66

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

Gandalf's side of the ticket contract decided in the thor#1 planning session (2026-11-25). Full plan on LotusGuild/thor#1. Tinker side: LotusGuild/tinker_tickets#123.

Contract in one paragraph

Each app tickets only its own evidence domain. The root cause owns the ticket, whichever app found it; symptoms become "Also seen" comments. Thor is the only correlator. Thor owns corosync link loss, quorum loss, fencing and monitoring-source-down tickets unless Gandalf has an active network incident covering those hosts (switch down, UniFi firmware update, link-down on the host's port): then Gandalf's ticket owns it and Thor comments (gandalf#57's rule, mirrored). Nobody closes tickets automatically.

Changes

  1. Title format with an app tag. New wiki standard: [source][auto][app][area] Summary [scope][environment][type].
    • Today: [monitor-01][auto][production][issue][network][single-node] Interface enp3s0 link-down
    • New: [monitor-01][auto][gandalf][network] Interface enp3s0 link-down [single-node][production][issue]
    • Checked against Tinker's TicketHash.php: the tag and the reorder change no existing hash (first tag, env tags and the network heading slug are unaffected), so this can ship before dedup_key.
    • Description footer keeps naming Gandalf (already does).
  2. Read API for Thor with a machine key. Thor won't probe hosts itself; it uses Gandalf's data. Add key auth (read-only scope, key in config, never in the repo) on:
    • /api/status, /api/events, /api/attention
    • /api/suppressions, including ended ones with start, end, who and scope. Thor decides from history: in the 2026-11-25 maintenance the only record that the window was planned was Gandalf's suppression (no Kuma window, no Grafana silence), and Ceph pause had already been cleared by the time Thor would have come back.
    • The cluster_hosts_stalled warning (with the OOM host names) is the natural handoff to Thor; make sure it's in the API output.
  3. Pre-check Thor before opening a host-, cluster- or source-level ticket. GET http://<thor>/api/incidents/covering?host=X (or scope=cluster, scope=source:prometheus). If covered, comment on Thor's ticket instead. If Thor is down or slow (short timeout), open the ticket as normal: fail open, never lose a ticket. The same answer says when a known condition covers it (e.g. compute-storage-02 reboots -> 693930698).
  4. "Gandalf has no Prometheus data" moves to Thor. Keep pausing host/interface alerting while Prometheus is blind, but pre-check Thor (scope=source:prometheus) before ticketing; if Thor is also unreachable, Gandalf opens it.
  5. Send dedup_key once tinker_tickets#123 ships, with Gandalf's own key scheme (e.g. host:<host>:iface_down:<iface>, device:<name>:offline, site:wan:down), and run the per-app backfill for open Gandalf tickets at the same time.
  6. Recurrence: once Tinker's reopen window ships (closed under 7 days: reopen; older: new linked ticket with history), drop any Gandalf-side workaround that conflicts with it (e.g. the 24 h recurrence_noted retry in TicketClient), so all three apps behave the same.
  7. Take over hwmonDaemon's network reachability checks ("Management network is unreachable", "Ceph network is unreachable", seen 2026-09-28). By the routing rule network is Gandalf's; Gandalf already has link state, switch ports, and Pulse for checks run from a host (e.g. Ceph VLAN 10.10.90.x reachability). hwmonDaemon switches its versions off once Gandalf covers them.

Not in this issue

  • Maintenance fan-out to Kuma and Grafana: separate issue (linked from thor#1).
  • Gandalf MCP: being planned in its own session.

Test cases Thor's replays use (Gandalf's expected part)

  • 2026-11-23 OOM: no Gandalf ticket (stalled hosts, links up, covered by Thor).
  • 2026-11-25 planned maintenance: Gandalf's suppression is what tells Thor it was planned.
  • 2026-11-04 cluster partition: if Gandalf had network evidence at the time, the ticket is Gandalf's and Thor comments; otherwise it's Thor's.
Gandalf's side of the ticket contract decided in the thor#1 planning session (2026-11-25). Full plan on LotusGuild/thor#1. Tinker side: LotusGuild/tinker_tickets#123. ## Contract in one paragraph Each app tickets only its own evidence domain. The root cause owns the ticket, whichever app found it; symptoms become "Also seen" comments. Thor is the only correlator. Thor owns corosync link loss, quorum loss, fencing and monitoring-source-down tickets **unless Gandalf has an active network incident covering those hosts** (switch down, UniFi firmware update, link-down on the host's port): then Gandalf's ticket owns it and Thor comments (gandalf#57's rule, mirrored). Nobody closes tickets automatically. ## Changes 1. **Title format with an app tag.** New wiki standard: `[source][auto][app][area] Summary [scope][environment][type]`. - Today: `[monitor-01][auto][production][issue][network][single-node] Interface enp3s0 link-down` - New: `[monitor-01][auto][gandalf][network] Interface enp3s0 link-down [single-node][production][issue]` - Checked against Tinker's `TicketHash.php`: the tag and the reorder change no existing hash (first tag, env tags and the network heading slug are unaffected), so this can ship before `dedup_key`. - Description footer keeps naming Gandalf (already does). 2. **Read API for Thor with a machine key.** Thor won't probe hosts itself; it uses Gandalf's data. Add key auth (read-only scope, key in config, never in the repo) on: - `/api/status`, `/api/events`, `/api/attention` - `/api/suppressions`, **including ended ones** with start, end, who and scope. Thor decides from history: in the 2026-11-25 maintenance the only record that the window was planned was Gandalf's suppression (no Kuma window, no Grafana silence), and Ceph `pause` had already been cleared by the time Thor would have come back. - The `cluster_hosts_stalled` warning (with the OOM host names) is the natural handoff to Thor; make sure it's in the API output. 3. **Pre-check Thor before opening a host-, cluster- or source-level ticket.** `GET http://<thor>/api/incidents/covering?host=X` (or `scope=cluster`, `scope=source:prometheus`). If covered, comment on Thor's ticket instead. If Thor is down or slow (short timeout), open the ticket as normal: **fail open, never lose a ticket.** The same answer says when a known condition covers it (e.g. compute-storage-02 reboots -> 693930698). 4. **"Gandalf has no Prometheus data" moves to Thor.** Keep pausing host/interface alerting while Prometheus is blind, but pre-check Thor (`scope=source:prometheus`) before ticketing; if Thor is also unreachable, Gandalf opens it. 5. **Send `dedup_key`** once tinker_tickets#123 ships, with Gandalf's own key scheme (e.g. `host:<host>:iface_down:<iface>`, `device:<name>:offline`, `site:wan:down`), and run the per-app backfill for open Gandalf tickets at the same time. 6. **Recurrence:** once Tinker's reopen window ships (closed under 7 days: reopen; older: new linked ticket with history), drop any Gandalf-side workaround that conflicts with it (e.g. the 24 h `recurrence_noted` retry in `TicketClient`), so all three apps behave the same. 7. **Take over hwmonDaemon's network reachability checks** ("Management network is unreachable", "Ceph network is unreachable", seen 2026-09-28). By the routing rule network is Gandalf's; Gandalf already has link state, switch ports, and Pulse for checks run from a host (e.g. Ceph VLAN 10.10.90.x reachability). hwmonDaemon switches its versions off once Gandalf covers them. ## Not in this issue - Maintenance fan-out to Kuma and Grafana: separate issue (linked from thor#1). - Gandalf MCP: being planned in its own session. ## Test cases Thor's replays use (Gandalf's expected part) - 2026-11-23 OOM: no Gandalf ticket (stalled hosts, links up, covered by Thor). - 2026-11-25 planned maintenance: Gandalf's suppression is what tells Thor it was planned. - 2026-11-04 cluster partition: if Gandalf had network evidence at the time, the ticket is Gandalf's and Thor comments; otherwise it's Thor's.
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/gandalf#66