feat(worker-manager): time-range filtering for worker pool error stats by nitishagar · Pull Request #8757 · taskcluster/taskcluster · GitHub
Skip to content

feat(worker-manager): time-range filtering for worker pool error stats#8757

Open
nitishagar wants to merge 4 commits into
taskcluster:mainfrom
nitishagar:feat/8695-wm-error-stats-time-range
Open

feat(worker-manager): time-range filtering for worker pool error stats#8757
nitishagar wants to merge 4 commits into
taskcluster:mainfrom
nitishagar:feat/8695-wm-error-stats-time-range

Conversation

@nitishagar

Copy link
Copy Markdown
Contributor

Summary

  • Adds optional from and to ISO-8601 query parameters to the workerPoolErrorStats API so callers can query error statistics over an arbitrary time window (defaults preserve the existing last-24-hours / last-7-days behavior)
  • New parameterized DB functions (get_worker_pool_error_stats_hourly, get_worker_pool_error_stats_daily, and _2 variants of all breakdown functions) replace the hardcoded-interval originals with NULL-default backwards compatibility; old functions deprecated per the 2-major-version rule
  • Worker-manager errors UI page gets two DatePicker controls (From / To) above the summary charts; "Last 7 days" / "Last 24 hours" labels update to "Selected range (daily/hourly)" when a custom range is active; a "Clear range" button resets to defaults
  • Hourly breakdown is omitted (hourly: {}) when the custom range exceeds 31 days to bound response size

Design decisions

  • @lotas endorsed adding from/to to the stats endpoint (not the paginated errors list — that's a possible follow-up)
  • Old DB functions are deprecated (not removed) so existing callers and any older deployed service version continue to work
  • total remains the sum over the daily series regardless of the range
  • yarn generate partially succeeded locally (db/fns.md, db-schema.json, @types/fns.d.ts updated); generated/references.json and client libraries will be regenerated cleanly in CI (web-server reference generation requires @as-integrations/express4 which is not installed in this dev environment)

UI note

The UI change was verified by code inspection and biome lint. The dev server couldn't be started in this environment (CI will verify rendering). The DatePicker component is the existing reusable ui/src/components/DatePicker/index.jsx.

Test plan

  • cd db && yarn test (worker_manager fns tests) — 75 passing
  • cd ui && biome check src — 345 files, no errors
  • cd ui && jest --no-coverage — pre-existing AuthConsent snapshot failure only (unrelated to this PR)
  • cd services/worker-manager && yarn test — blocked by pre-existing p-queue v6/v9 mismatch in dev node_modules; CI will validate
  • cd services/web-server && yarn test — blocked by same environment issue
  • yarn generate full clean run — requires go ≥ 1.26.4 and @as-integrations/express4; CI will run it

Follow-up

Filtering the paginated errors list endpoint (listWorkerPoolErrors) by time range was explicitly out of scope per lotas's direction. It can be tracked as a follow-up.

Fixes #8695

@nitishagar nitishagar requested a review from a team as a code owner June 12, 2026 15:44
@nitishagar nitishagar requested review from Eijebong, lotas and petemoore and removed request for a team June 12, 2026 15:44
@github-project-automation github-project-automation Bot moved this to Backlog / Inbox in TC intake board Jun 12, 2026
@petemoore

Copy link
Copy Markdown
Member

@nitishagar

Copy link
Copy Markdown
Contributor Author

…askcluster#8695)

Add optional `from` and `to` ISO-8601 query parameters to the
`workerPoolErrorStats` API endpoint. Parameterized DB functions
(get_worker_pool_error_stats_hourly, _daily, and *_2 breakdown
variants) replace the hardcoded-interval functions with NULL-default
backwards compatibility. The UI errors page gains two DatePicker
controls to select the range; the "Last 7 days"/"Last 24 hours" labels
update when a custom range is active. Old functions are deprecated per
the 2-major-version rule. Hourly breakdown is omitted for ranges > 31
days to bound response size.

Fixes taskcluster#8695
Run `yarn generate` after adding `from` and `to` query parameters to the
workerPoolErrorStats API endpoint. Updates all generated client libraries
(JS, Python, Rust, Go, Shell) and generated/references.json.
…config error fn

`get_worker_pool_error_launch_configs` was deprecated in db/versions/0127.yml
in favour of the parameterised `get_worker_pool_error_launch_configs_2`. Update
the provisioner to call the new function with an explicit from/to window
(last hour / no upper bound) to match the prior behaviour.
@nitishagar nitishagar force-pushed the feat/8695-wm-error-stats-time-range branch from c1bc72a to 013bc73 Compare June 19, 2026 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog / Inbox

Development

Successfully merging this pull request may close these issues.

(feat) Support narrowing list of errors on worker-manager errors page to just the past 24 hours

2 participants