fix(daemon): decouple vLLM Prometheus scraping from enable_docker - #104
Conversation
VllmPrometheusCollector was constructed only when opts.enable_docker && !opts.disable_vllm_metrics, but the scraper is a plain HTTP GET against a vLLM instance's /metrics endpoint with no Docker dependency. Managed (native) instances are already discovered independently of Docker via services_dir. apps/rocm/src/dash.rs::maybe_spawn_embedded_daemon always calls runner_options(config, paths, false), hardcoding enable_docker=false, which made the scraper permanently dead for the embedded daemon - the common no-Docker / managed-vLLM path. Gate vllm construction on !opts.disable_vllm_metrics alone; enable_docker continues to gate only DockerDiscovery. Relates to EAI-7359 Signed-off-by: Michael Roy <michael.roy@amd.com>
… shipped flag Adversarial-review follow-up for EAI-7359 (wording only, no behavior change): disable_vllm_metrics is hardcoded false and not wired to any CLI flag or config field, so it is not user-reachable today. Soften the field doc and test comments to describe it as the internal seam a future opt-out would flip, rather than implying a live off-switch. Relates to EAI-7359 Signed-off-by: Michael Roy <michael.roy@amd.com>
rominf
left a comment
There was a problem hiding this comment.
LGTM. The gating change is correct: enable_docker && !disable_vllm_metrics → !disable_vllm_metrics (not inverted), so the embedded-daemon path — which always passes enable_docker = false — now constructs the vLLM collector as intended.
No wasted per-tick work or error spam when nothing is configured: the scrape block is still guarded by !instances.is_empty() and parallel_scrape early-returns on empty targets, so a no-Docker host with an empty services_dir issues zero scrape requests; constructing the collector when idle is just a cheap reqwest::Client build, and a 1.5s timeout is present. enable_docker now gates only DockerDiscovery; grep confirms nothing else relied on the old coupling, and the empty-instances guard (not enable_docker) is the real invariant preventing pointless scraping. Tests match the shipped logic.
Approving.
|
🔴 Automated review · pr-review-watcher · 8018fe4 Summary
What the fix does and why it's correct
Verified in context:
Verification performed
Non-blocking suggestions
Tradeoffs (deliberate choice, noted for visibility)
Coverage gap (informational, not a defect)No test exercises Positive signals
Deployment notesNone. No schema/migration/config changes; no breaking changes; no new dependencies. Behavior change is purely additive: vLLM metrics now scrape on the embedded (no-Docker) daemon path where they were previously silently absent. |
Final refresh: main advanced 9830e57 -> 8308450 via #104 (decouple vLLM Prometheus scraping from enable_docker) and #97 (discover served model for configured chat endpoint). Clean auto-merge (runner.rs only), no conflicts. Preserves the startup-phase / Ready composition (InstanceStatus::Starting { phase }, PROTOCOL_VERSION = 2, phase-aware registry mapping, and the Starting -> Ready scrape-success promotion in runner.rs) alongside #104's scraping-decouple changes, plus the CodeQL test-path fix (rocmd tests use the CARGO_MANIFEST_DIR-rooted unique_test_root helper, not env::temp_dir()). Signed-off-by: Michael Roy <michael.roy@amd.com>
Final refresh: bring PR #92 up to main 8308450 (adds #104 decouple vLLM Prometheus scraping from enable_docker, and #97 discover served model for the configured chat endpoint). Clean auto-merge with no conflicts — merge-tree predicted clean and only crates/rocm-dash-tui/src/app/mod.rs was auto-merged (the #97 chat-endpoint change; scrollbar hit-testing code untouched). The scrollbar + braille spinner feature is unchanged: job_console.rs, ui/panel.rs and ui/spinner.rs are byte-identical to the prior branch head. Signed-off-by: Michael Roy <michael.roy@amd.com>
Summary
VllmPrometheusCollector(the vLLM/metricsHTTP scraper) was only constructed whenopts.enable_docker && !opts.disable_vllm_metrics, even though the scraper has zero Docker dependency — it's a plain HTTP GET against a vLLM instance's/metricsendpoint.apps/rocm/src/dash.rs::maybe_spawn_embedded_daemonalways callsrunner_options(config, paths, false), hardcodingenable_docker = false. Combined with the gate above, this made the vLLM Prometheus scraper permanently dead for the embedded daemon — the common no-Docker / managed-vLLM path.vllmconstruction inrun_loopon!opts.disable_vllm_metricsalone.enable_dockercontinues to gate onlyDockerDiscovery, which is the only genuinely Docker-dependent piece.Root cause
Managed (native) vLLM instances are already discovered independently of Docker via
services_dir, so the scraper never neededenable_dockeras a precondition. The original gate conflated "Docker discovery is enabled" with "scrape metrics from any known vLLM instance," silently disabling metrics for every embedded-daemon deployment.Relates to EAI-7359
Test Plan
cargo buildcleancargo clippy --all-targets --all-features -- -D warningscleancargo test -p rocm-dash-daemon runner::— 11 passed, including newvllm_metrics_enabled_is_independent_of_dockerregression testcargo test -p rocm dash:: -- --test-threads=1— 8 passed, including newrunner_options_keeps_vllm_metrics_enabled_without_dockerregression test