Skip to content

feat(dwctl): resolve demand model names to serving leaves in /monitoring/demand - #1496

Draft
rushilbhat wants to merge 1 commit into
mainfrom
feat/demand-alias-resolution
Draft

feat(dwctl): resolve demand model names to serving leaves in /monitoring/demand#1496
rushilbhat wants to merge 1 commit into
mainfrom
feat/demand-alias-resolution

Conversation

@rushilbhat

Copy link
Copy Markdown
Contributor

What

COR-611 part B. /admin/api/v1/monitoring/demand now folds queue demand onto serving names before returning: each requested model name is resolved through the catalog — composite → primary enabled component (lowest sort_order, ties by weight/created_at), recursively (bounded, though nesting is catalog-forbidden today) — down to a non-composite entry, and reported under that entry's model_name. Counts merge when multiple aliases share a leaf. Unknown names and component-less composites pass through unchanged.

Why

Fusillade queues under the requested name (customer alias); scouter plans in serving names. During the 2026-08-14 incident (COR-610), 370 queued detail-zai/glm-5.2 requests exerted zero scale pressure on the healthy custom-zai/glm-5.2 pool because scouter classed the alias demand "unmanaged" and dropped it. After this change the same backlog is reported as custom-zai/glm-5.2 demand — scouter's existing planner just works, no scouter changes needed on this path. This is also the prerequisite for ever moving the GLM node entries off scaling: mode: fixed, which is currently load-bearing.

Deployability

Safe to land independently of the other COR-611 PRs: non-alias names fold to themselves (identity), so existing behaviour is unchanged except that alias demand — previously dropped on the floor — now reaches the pool that serves it.

Tests

Five new #[sqlx::test] integration tests (composite→leaf fold incl. trailing windows, alias merge in flat + grouped shapes, disabled-primary skip, unknown-name pass-through, plain alias→model_name). Full suite: 2,889 passed. fmt/clippy/ZDR guard clean. The one sqlx prepare --check mismatch (query-aabf6640…) is the known local-PG17-vs-CI drift, present on pristine main; the committed file is untouched.

…ing/demand

The /admin/api/v1/monitoring/demand endpoint keyed queue demand by the
requested model name, so demand arriving under a customer alias or a
composite (virtual) model never matched a serving-pool name in scouter
and exerted no scale pressure. Resolve every reported name to its
serving leaf before returning: composites follow their primary enabled
component (lowest sort_order, recursively, bounded depth) to a
non-composite entry whose model_name is the serving name; plain entries
fold to their own model_name; names outside the catalog pass through
unchanged. Counts from aliases folding to the same leaf are merged.

COR-611 part B.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying control-layer with  Cloudflare Pages  Cloudflare Pages

Latest commit: aa02426
Status: ✅  Deploy successful!
Preview URL: https://23a2141c.control-layer.pages.dev
Branch Preview URL: https://feat-demand-alias-resolution.control-layer.pages.dev

View logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant