Repository navigation
docs: Document the PD Prefill admission metrics (per-worker inflight, queue depth, wait, rejections) - #86
Closed
github-actions[bot] wants to merge 1 commit into
Closed
docs: Document the PD Prefill admission metrics (per-worker inflight, queue depth, wait, rejections)#86github-actions[bot] wants to merge 1 commit into
github-actions[bot] wants to merge 1 commit into
Conversation
Signed-off-by: XinyueZhang369 <zoeyzhang369@gmail.com>
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
2 of 3 tasks
This was referenced Oct 3, 2026
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.
What this PR does
Which Prometheus metrics expose the per-worker PD Prefill admission gate — how many prefill requests SMG has admitted per worker, how many requests are waiting for Prefill admission, how long they waited, and why they were rejected?
Why we need it
Source change: smg-project/smg@da9f4d0
Commit 6 (#1961, da9f4d06, 2026-09-29) added a per-worker PD Prefill admission gate with four new metrics, verified in current source: model_gateway/src/observability/metrics.rs:280-295 declares smg_pd_prefill_admission_inflight (gauge, 'Prefill requests admitted by SMG per worker'), smg_pd_prefill_admission_queued (gauge, router-wide queue depth), smg_pd_prefill_admission_wait_seconds (histogram, time waiting in the queue), and smg_pd_prefill_admission_rejections_total (counter, 'by reason'); metrics.rs:1222-1249 records them (inflight labeled worker=, rejections labeled reason). Reasons are exactly unavailable, queue_full, queue_timeout (model_gateway/src/worker/prefill_admission.rs:305-401); the queue gauge is set on every push/pop and the wait histogram is recorded whenever a request leaves the queue, admitted or timed out. The gate exists only when --prefill-max-inflight-requests-per-worker is positive (default -1, disabled; app_context.rs:390-400) with queue defaults 100 slots/60 s, and it gates the prefill leg on both the HTTP PD router (routers/http/pd_router.rs:100-113, 282-283) and the gRPC PD/EPD pipelines (routers/grpc/common/stages/worker_selection.rs:415-433); queue rejections answer 429 with codes pd_prefill_queue_full/pd_prefill_queue_timeout (routers/mod.rs:45-60). src/lib/content/reference/metrics.md's 'PD Disaggregation Metrics' section (lines 443-522) documents only the decode-side smg_pd_admission_waits_total/smg_pd_admission_sheds_total and no page mentions prefill admission (repo-wide grep finds nothing). Two same-page consistency notes belong to this one concern: the 'Removed workers' list (metrics.md line 61) omits that smg_pd_prefill_admission_inflight is reset to 0 when a worker is removed (metrics.rs:1752, test prefill_worker_removal_resets_admission_gauge at metrics.rs:1909), and the 'Histogram Buckets' section (metrics.md line 1245) says only smg_worker_retry_backoff_seconds and smg_scheduler_queue_wait_seconds render as Prometheus summaries, while smg_pd_prefill_admission_wait_seconds matches none of the bucket matchers (duration_seconds/ttft_seconds/tpot_seconds suffixes or the two full-name matchers, metrics.rs:554-596) and therefore also renders as a summary. The commit landed after the v1.11.0 bump (ID 23, 3be823a7, 2026-09-24), so the edit must present these series as on main (smg-project/smg#1961) without promising a release, keeping v1.11.0-scoped statements true. This is one independent concern: one commit introduced one observable mechanism whose metric family is enumerated on the one canonical metrics page; the gate's runtime behavior belongs to the routing-workers scan and its CLI flags to deploy-config.
Scope: observability / pd-prefill-admission-metrics. Other concerns are deferred.
How to test
git diff --checkandpnpm checkand the productionpnpm build.Checklist