Skip to content

feat(vllm): add Prometheus /metrics-derived latency metrics (queue/prefill p50/p95)#274

Draft
atnair-amd wants to merge 1 commit into
dev/dtnifrom
atnair/vllm-prometheus-metrics
Draft

feat(vllm): add Prometheus /metrics-derived latency metrics (queue/prefill p50/p95)#274
atnair-amd wants to merge 1 commit into
dev/dtnifrom
atnair/vllm-prometheus-metrics

Conversation

@atnair-amd

Copy link
Copy Markdown
Collaborator

Summary

  • Scrapes vLLM's own /metrics Prometheus endpoint before/after each client run and diffs the queue-time/prefill-time histograms to isolate one sweep cell's observations from a reused server's cumulative counters.
  • Interpolates p50/p95 quantiles matching PromQL's histogram_quantile(), exposed as gated metrics: prom.queue_time_p50_ms, prom.queue_time_p95_ms, prom.prefill_time_p50_ms, prom.prefill_time_p95_ms.
  • Gating follows the existing GATED_GPU_METRICS precedent — a separate GATED_PROM_METRICS set, kept out of vllm_parsing.py's client.* tiering machinery (that partition is asserted exactly by a locked invariant test).
  • One-shot, synchronous, main-thread scrape bracket (mirrors capture_gpu_metrics), avoiding the SSH-session race the GPU poller previously hit.

Test plan

  • New pure-parser unit suite test_vllm_server_metrics.py (30 tests): bucket/sum/count parsing, before/after diffing, hand-computed interpolation math, end-to-end realistic scrape pairs, I/O-boundary scrape failure modes.
  • Extended test_vllm_config_loader.py with GATED_PROM_METRICS coverage tests (missing-metric-raises / warns / full-set assertions).
  • Adjacent-suite regression: test_vllm_report_preset.py, test_vllm_job_server_reuse.py, test_vllm_job_ray_backend.py all pass unchanged.
  • Full-repo run_all_unittests.py: 750 tests (34 new), same 2 failures + 3 errors as the unmodified base branch (pre-existing, in unrelated test_inferencing_config_loader.py/collection issues — confirmed via A/B stash comparison, not touched by this change).

…efill p50/p95)

Scrapes vLLM's own /metrics endpoint before/after each client run, diffs
the queue-time and prefill-time histograms to isolate one cell's
observations, and interpolates p50/p95 quantiles matching PromQL's
histogram_quantile(). Gated as prom.* metrics via a parallel
GATED_PROM_METRICS set (mirroring GATED_GPU_METRICS) to keep out of the
locked client.* tiering partition.
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