Repository navigation
fix(monitoring): bound state-age query in metrics endpoints - #313
Merged
Merged
Conversation
added 5 commits
November 6, 2026 19:52
Reviewed recent deploy-file changes (Nov 3-4) as the likely broken-build source; SCP upload failure is at the SSH layer.
The v2.93.0 state-age gauge (06f86d3) made /api/monitoring/metrics query deployments and cici_runs with the unbounded request context. The admin dashboard awaits that endpoint before clearing its loading state, so a slow or locked DB left it showing 'Loading dashboard...' forever (the 'page not loading' regression). Apply the existing 2s stateAgeQueryTimeout to the metrics endpoints too (rename stateAgeReportForAlerts to stateAgeReportTimed and use it in handleMetrics and handlePrometheusMetrics). Adds a regression test that blocks QueryContext and asserts the report returns bounded.
Preflight green baseline; no active registry bugs; one code work item (BUG-2026-11-06-dashboard-metrics-hang, already fixed with a regression test) and one external item (deploy SCP failure, VPS-side).
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.
User description
Summary
Fixes BUG-2026-11-06-dashboard-metrics-hang — the v2.93.0 regression that left the admin dashboard stuck on "Loading dashboard..." ("the page wasn't loading") and forced the earlier rollback.
Root cause
06f86d39dmade/api/monitoring/metricsrun the new state-age report againstdeployments+cici_runsusing the unbounded request context. TheDashboardPageawaits that endpoint beforesetLoading(false), so a slow or write-locked DB left the page loading forever.Fix
Apply the existing
stateAgeQueryTimeout(2s) to both metrics endpoints — renamestateAgeReportForAlerts→stateAgeReportTimedand use it inhandleMetricsandhandlePrometheusMetrics.Test plan
go test -run TestStateAgeReportTimedBoundsBlockedQuery ./components/monitoring— PASS (blocksQueryContext, asserts bounded return)go test ./components/monitoring— PASSgo test -race ./components/monitoring— PASSgo test ./...— PASStrace-stories --strict— exit 0; 24 gate-script tests passNote
Merging is a
fix:commit, so big-release will publish a patch (v2.94.1) and the Deploy workflow will fire. That deploy is still blocked by the separate VPS-side SCP issue (see #312), tracked independently of this fix.PR Type
Bug fix, Tests
Description
Bound state-age DB queries in metrics endpoints with 2s timeout
Replace unbounded request-context call with
stateAgeReportTimedAdd regression test blocking
QueryContextto assert bounded returnPrevent admin dashboard hang caused by v2.93.0 regression
Diagram Walkthrough
File Walkthrough
monitoring.go
Switch metrics endpoints to timed state-age reportcomponents/monitoring/monitoring.go
handleMetricsto callm.stateAgeReportTimed()instead ofm.stateAgeReport(r.Context())handlePrometheusMetricsto callm.stateAgeReportTimed()inwriteStateAgeGaugesstate_age.go
Rename and document bounded state-age reportcomponents/monitoring/state_age.go
stateAgeReportForAlertstostateAgeReportTimedstateAgeMetricValueto call renamed functionstate_age_test.go
Add regression test for blocked state-age querycomponents/monitoring/state_age_test.go
blockingDBertest double that blocksQueryContextuntil contextcancellation
TestStateAgeReportTimedBoundsBlockedQueryto verify bounded queryin blocked scenario
unavailable