Repository navigation
feat(admin): Monitoring page to view and set a cluster's page/notify policy - #1989
Merged
Merged
Conversation
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
dawsontoth
approved these changes
Oct 21, 2026
dawsontoth
left a comment
Contributor
There was a problem hiding this comment.
We will want to integrate this more into the existing search and navigation among clusters with staff only features. Plus, we are getting too deep into Studio PRs that require CM PRs to merge. We need to start knocking those out.
github-merge-queue
Bot
removed this pull request from the merge queue due to a conflict with the base branch
Oct 21, 2026
Lists clusters on notify with whether their synthetic checks took the change, finds a cluster by name or id, and sets its policy with a reason and an apply mode (rolling only for accounts that may restart the cluster). Built on central manager's /Admin/ClusterMonitoringPolicy endpoint. Refs #1986 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Block every way out of the set dialog while a save is in flight, show a failed list as a failure, poll while a change is pending so a stuck one flips, tie errors to the change they were for, read the restart from the answer, and trim exports and comments. Refs #1986 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…stop polling a stuck row Refs #1986 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs #1986 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DavidCockerill
force-pushed
the
david/1986-admin-monitoring-policy
branch
from
October 21, 2026 19:41
9bb2abe to
a8c55c7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
⊙ Problem
Staff can stop paging for a cluster by setting its monitoring policy to
notify, but must hand-write a central manager request. Nothing shows which clusters are onnotify, who set them, or why.🤔 Is a Studio page warranted, rather than the API alone?
Yes: the fleet-wide list of
notifyclusters and their history need a page, and the main caller is support, who should not have to hand-write the request. The page is additive; removing it is one route.💡 Solution
A Monitoring page in admin (
/admin/monitoring) uses the central manager's/Admin/ClusterMonitoringPolicy(HarperFast/central-manager#984):notify: reason, who set it and when, and whether their synthetic checks reflect the change. It polls while a change is pending.clu-…id, then setspageornotifywith a required reason and an apply mode. The result shows what the save did, including a refused restart.⚖️ Alternatives
🤔 Offer the rolling restart from this dialog?
Yes, only to accounts that may restart the cluster, warned as undrained and off-peak. Without it, metric and log alerts follow only at each container's next recreate. Dropping the option is a one-line change.
🔧 Changes
The notify list: each badge says whether that cluster's synthetic checks carry its latest change (seeded scratch data, 1440px).
Set policy after picking a cluster from search: the other policy is preselected and a reason is required.
Product and architecture tour
Product and architecture tour
Setting a policy
What does a support engineer do to take a cluster off paging, and what can stop them?
From the rail to the result
monitoringPolicy:writesees Set policy and Change.clu-…id; each match shows its organization, status and current policy.Did the checks take the change
How does the list know whether a cluster's synthetic checks carry its latest policy?
The central manager re-stamps a cluster's synthetic checks in the background and records the outcome on the row. The Checks badge reads it, counting only an attempt that finished after the change and projected it (a skip, which keeps the old projected change, counts by its finish time), because the row keeps the previous attempt's outcome until the new one finishes. While a change is pending the list polls every 30 seconds; after 20 minutes, past the central manager's own retries, the badge reads Not confirmed and polling stops.
checkProjectionfrom a raw API response.Every file
src/features/admin/monitoring/index.tsx: the page. Write buttons wait for an in-flight save, a failed read shows as one, the check badge, and history newest first.src/features/admin/monitoring/SetPolicyDialog.tsx: the dialog stays open while saving; cluster search; the form's restart rights, required reason and disabled rolling option; and the result.src/features/admin/monitoring/checkStatus.ts: pending until an attempt finishes after the change, and only its own change's outcome.src/features/admin/monitoring/monitoringPolicyApi.ts: the hand-typed contract and queries; polling stops once stuck; the save's key; search; and every save refetches.src/features/admin/routes.ts,AdminShell.tsxandapi.patch.d.ts: the route, the rail item oncluster:read, and themonitoringPolicy:writepermission type.✅ Verification
pnpm test(all 571 files),pnpm lint,pnpm format,tsc -b: pass. One unrelated Monaco test (setValueHistory.test.ts) times out intermittently under full-suite load and passes alone.pagewithapply: rolling, and saw the refused restart in the result while the list refetched.What the new tests prove
src/features/admin/monitoring/index.test.tsx: list and check status, history order, read-only without the write permission, trimmed search, required reason,rollingoffered only with restart rights for the cluster's organization, a refused restart shown, a failed list never read as "every cluster pages", and Escape, Cancel, Change cluster and the page's Set policy button blocked while a save is in flight.src/features/admin/monitoring/checkStatus.test.ts: an attempt counts only once it finished after the change and, unless it was a skip, projected that change; errors only for the change they were for; stuck after 20 minutes.src/features/admin/monitoring/monitoringPolicyApi.test.ts: polls only while a change is pending and not yet stuck.adminRoutes.test.tsandadminShellVisibility.test.ts: the route resolves, and the rail item shows for every role that can read clusters.🤖 Generated by Claude Code (Claude Opus 5.5); posted via @DavidCockerill.
Refs #1986
Related PRs: #1975 overlaps (merged first; this branch is rebased on it and keeps both rail items, routes and visibility expectations)
Complexity: medium
Review-Coverage: authored=claude; ran=gemini,codex; adjudicated=domain; blocked=cursor-grok(lost); declined=cursor-composer,cursor-kimi,cursor-muse,muse; rounds=3; full=1 @ a8c55c7
Review-Attention: read ~8m (decisions: do-less-alternative, in-flight-guard-scope, check-status-inferred-client-side, monitoring-gated-on-cluster-read, rolling-restart-from-policy-dialog) @ a8c55c7