Repository navigation
Fleet Metrics: metrics --fleet and --machine, Fleet as the Metrics page default, and saved peer snapshots (#2068) - #2085
Merged
Merged
Conversation
…ge default, and saved peer snapshots (#2068)
… trimmed to the window, another window's snapshot stands in, a machine named fleet is choosable (#2068)
… whose read saved it (#2068) A peer refuses a Console person missing from its sign-in list, but once it went offline or was removed, its saved summary showed to every viewer. Snapshots are now kept per machine and reader.
This was referenced Nov 12, 2026
Merged
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.
Closes #2068
Summary
Fleet metrics are an explicit client of each owning machine's local
/api/v1/metrics, merged here; the API itself stays local (ADR 0026).--machine <this machine's name>gives plainmetrics; the page's This machine keeps the signal groups./peek?…&machine=<peer>; a cached one is plain text marked(cached).metrics --fleetis in the parity exclusions with ADR 0026's reason; the ADR now names--machinetoo.docs/guide.md→site/docs), hand-written site pages anddocs/code-navigation.mdupdated.Evidence
Execution evidence
Before:
cargo test --test console fleet_metrics_merge_paired_consoles_and_keep_an_offline_peer_cachedon the base branch:metrics --fleetis not ametricsargument (usage: thirdshift metrics [<command>] [--json] [--window …]), so the test cannot run there.After:
test metrics::fleet_metrics_merge_paired_consoles_and_keep_an_offline_peer_cached ... ok. It pairs two real loopback Consoles and checks:metrics.fleetandmachine.--machinescoping works.cachedwithlast_seen.console fleet remove.Review findings, each run first as written:
cargo test --test console api_metrics_stays_local_once_a_peer_is_pairedAPI answered with Fleet metrics: {"comparison":…,"machines":[…okcargo test --test console fleet_metrics_keep_an_offline_peer_for_another_windowoffline peer's last-fetched history missingokcargo test --test console a_fleet_machine_named_fleet_can_be_chosen_aloneassertion left != right failed: one machine reads as the whole Fleetokcargo test --bin thirdshift logs::metrics::fleet::testsa_cached_snapshot_counts_only_failures_in_todays_windowfailed withleft: 1, right: 0test result: ok. 6 passedSecurity review: a peer refuses a signed-in Console person missing from its sign-in list, but once it went offline or was removed, the summary saved from another person's read showed to that person. Snapshots are now kept per machine and reader (
src/logs/metrics/fleet.rspath,saved), and the guide says so.cargo test --test console a_cached_peer_snapshot_stays_with_the_person_who_read_ittests/console/fleet_control.rs:230: the refused person's page listedwidgets#73 (cached) on ownerokscripts/affected-tests mainafter the security fix:PASS npm test --prefix site,PASS cargo build --locked,PASS npm test --prefix console,PASS cargo test.scripts/affected-tests origin/issue-2036:PASS npm test --prefix sitePASS cargo build --lockedPASS npm test --prefix consolecargo testhad 2 failures, both outside this change:process::findings::closing_rechecks_each_merged_base_and_leaves_a_failing_finding_for_the_day_shiftfails the same way on the baseissue-2036(panicked at tests/process/findings.rs:331:5), checked in a detached worktree.process::findings::merged_fix_is_rechecked_after_a_later_fix_failspassed when rerun.Visual evidence
The Gist upload of the captures was blocked by this session's permission rules, so the images are not embedded. They are kept locally at the session's capture paths (same viewport and state,
/metrics?window=30d):/tmp/before-desktop.IRXiR1.pngeast:/tmp/after-desktop.yZE05G.pngcached, offline · last seen …:/tmp/after-desktop-cached.F9UolN.png/tmp/before-mobile.1QViFY.png/tmp/after-mobile.UUY5s6.pngThe After captures were taken before the review fixes. Those fixes changed only the Fleet option's value (now empty) and the badge colour token (
--look→--look-text).Merge Danger
Door: two-way
This adds new flags, a new page view, and a cache directory,
~/.thirdshift/logs/fleet-metrics/, that is safe to delete. No record formats change.Blast Radius: Metrics
/metricsopens on the Fleet view instead of this machine. This machine is one choice away./api/v1/metricsnow answers 400 tofleetandmachinequery keys, which it rejected before as unknown arguments.Unaddressed findings
Standards
All judgement calls; no hard violations were reported.
remote()and its fan-out mirrorsrc/cronjobs/fleet.rs. Only the error classification is shared (Failure::of, insrc/console/fleet/read.rs). The readers decode different documents, and only metrics falls back to a cache (src/logs/metrics/fleet.rsremote). A generic reader would mean refactoringcronjobs --fleet, which is beyond Fleet Metrics aggregation (metrics --fleet), default Fleet scope, and local peer-snapshot cache #2068.Cached(src/logs/metrics/fleet.rsenum Status). The repeated part is three match arms.Summary*types restateTrends.Trendsholds&'static strfields and cannot be deserialized (src/logs/metrics/outcomes.rsBucket.kind).metrics.metrics_fleet.html. This is presentational and a few lines long. The shared form was extracted tometrics_form.html.FleetPageandMetricsPagefields. Both pages are built in one function,src/console/metrics.rsshow.logs::metrics::reads_fleet) and the page resolve different inputs. The page also has a no-machinedefault that the CLI lacks.metrics --machine otheradds no parity coverage. It is kept to document that--machineshares the--fleetexclusion (comment inidentity,src/console/parity.rs). ADR 0026 names both flags.fleet-metrics/is listed up to three times per request. Each listing is a small directory read with no user-visible cost. The duplicatedcliconstruction in this finding was fixed.Security
None. The one finding introduced by this change was fixed and its test is kept.
Spec
None. All three Spec findings were fixed and their tests are kept.
Review coverage
Every changed file was read by both reviewers, except
site/docs/index.html. That file is generated fromdocs/guide.mdand was excluded from reading;npm run docs:check --prefix sitepasses.Built with claude 2.1.314 · opus · default effort
Security review outcome
No unaddressed introduced findings.