Skip to content

fix(server-metrics): parse OpenMetrics exposition for the vLLM Rust frontend#13

Merged
cquil11 merged 1 commit into
SemiAnalysisAI:cquil11/aiperf-agentx-v1.0from
ajcasagrande:ajc/agentx-v1-vllm-openmetrics
Jul 2, 2026
Merged

fix(server-metrics): parse OpenMetrics exposition for the vLLM Rust frontend#13
cquil11 merged 1 commit into
SemiAnalysisAI:cquil11/aiperf-agentx-v1.0from
ajcasagrande:ajc/agentx-v1-vllm-openmetrics

Conversation

@ajcasagrande

Copy link
Copy Markdown

Cherry-pick of upstream ai-dynamo#1060 (commit 8ba75f9a9e06377c0569f36f6d0a966d5307135a, authored by @majunze2001 — authorship preserved on the commit) onto cquil11/aiperf-agentx-v1.0.

What it does

vLLM's Rust frontend serves /metrics as application/openmetrics-text. The classic Prometheus parser mistypes OpenMetrics counters (family becomes an unknown named foo_total), and OpenMetrics _created samples share the _total labels so the creation timestamp overwrites the real counter value in the last-value de-dup.

  • FetchResult now carries the response Content-Type; the collector routes application/openmetrics-text bodies to the OpenMetrics parser, falling back to the classic parser if the stricter parser rejects the body (e.g. missing # EOF).
  • _created samples are skipped in simple-family processing so they can't clobber _total values.

Adaptations for this branch (semantic merge)

The source commit's context includes code this branch doesn't have; conflicts were resolved to take only the OpenMetrics change:

  • Did not import the source branch's lazy create_tcp_connector __getattr__ machinery (unrelated circular-import fix); this branch's eager import stays.
  • Dropped _warn_dropped_non_finite/_warn_construction_failures (warn-once infra that doesn't exist on this branch); kept _parse_families.
  • Grafted the _created skip onto this branch's simpler None/non-finite sample filter.
  • Dropped the tools/ergonomics_baseline.json hunk: data_collector.py is 427 lines here (< 500 threshold), so the file-size allowlist entry would only mask a future real violation.

Verification

  • Full unit suite: 11,894 passed; the 11 failures are pre-existing weka/mmap-cache drift on the base branch (files untouched by this change).
  • All pre-commit hooks passed on the commit.
  • Live end-to-end check driving _fetch_metrics_text() -> _parse_metrics_to_records() against a local HTTP server: OpenMetrics content-type routes to the OpenMetrics parser (counter typed correctly, _created skipped), classic text/plain parsing unchanged.

🤖 Generated with Claude Code

…rontend (ai-dynamo#1060)

Signed-off-by: Jeff Ma <jeffjma@umich.edu>
(cherry picked from commit 8ba75f9)
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

Try out this PR

Quick install:

pip install --upgrade --force-reinstall git+https://github.com/ai-dynamo/aiperf.git@5f55d1719db64234c0d69e4dad99d46b01a27a0d

Recommended with virtual environment (using uv):

uv venv --python 3.12 && source .venv/bin/activate
uv pip install --upgrade --force-reinstall git+https://github.com/ai-dynamo/aiperf.git@5f55d1719db64234c0d69e4dad99d46b01a27a0d

Last updated for commit: 5f55d17Browse code

@ajcasagrande

Copy link
Copy Markdown
Author

@majunze2001 Please confirm this cherry-pick is faithful to original

@cquil11 cquil11 merged commit 0d2aa05 into SemiAnalysisAI:cquil11/aiperf-agentx-v1.0 Jul 2, 2026
1 of 2 checks passed
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.

3 participants