Skip to content

docs: document Prometheus metrics exposed by vGPU monitor - #2361

Closed
khanskr wants to merge 2 commits into
Project-HAMi:masterfrom
khanskr:docs/vgpu-monitor-metrics
Closed

docs: document Prometheus metrics exposed by vGPU monitor#2361
khanskr wants to merge 2 commits into
Project-HAMi:masterfrom
khanskr:docs/vgpu-monitor-metrics

Conversation

@khanskr

@khanskr khanskr commented Aug 4, 2026

Copy link
Copy Markdown

What type of PR is this?
/kind documentation

What this PR does / why we need it:
Adds docs/metrics.md documenting the Prometheus metrics exposed by the vGPU monitor (vGPUmonitor), including a description of each metric and example PromQL queries, as requested in issue #2356.

Which issue(s) this PR fixes:
Fixes #2356

Special notes for your reviewer:
Metric names, types, labels and value semantics were verified against the descriptors and collection code in cmd/vGPUmonitor/metrics.go and pkg/metrics/metrics.go. The bind address and legacy-metrics flags are documented from cmd/vGPUmonitor/main.go, and the scrape service configuration from the helm chart.

AI assistance disclosure:
The PR description was generated with AI assistance. No other part of this PR was generated with AI. I reviewed the change and take responsibility for it.

Does this PR introduce a user-facing change?:
NONE

Summary by CodeRabbit

  • Documentation
    • Added comprehensive guidance for the HAMi vGPU monitor.
    • Documented deployment behavior, metrics endpoint configuration, Helm access, and Prometheus scraping.
    • Explained per-node scraping considerations, metric labels, and metric semantics.
    • Documented legacy metric compatibility and provided example PromQL queries for monitoring and analysis.

Signed-off-by: khanskr <294885327+khanskr@users.noreply.github.com>
@hami-robot hami-robot Bot added the kind/documentation Improvements or additions to documentation label Aug 4, 2026
@hami-robot
hami-robot Bot requested a review from archlitchi August 4, 2026 18:05
@hami-robot
hami-robot Bot requested a review from ouyangluwei163 August 4, 2026 18:05
@hami-robot

hami-robot Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: khanskr
Once this PR has been reviewed and has the lgtm label, please assign archlitchi for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@hami-robot

hami-robot Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Welcome @khanskr! It looks like this is your first PR to Project-HAMi/HAMi 🎉

@hami-robot hami-robot Bot added the size/L label Aug 4, 2026
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1e4e992b-b13b-40df-ba6f-97eee0ed52a8

📥 Commits

Reviewing files that changed from the base of the PR and between 46a80e5 and a4ac385.

📒 Files selected for processing (1)
  • docs/metrics.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/metrics.md

📝 Walkthrough

Walkthrough

Added docs/metrics.md with vGPU monitor access instructions, metric definitions, legacy compatibility details, and PromQL examples.

Changes

vGPU monitor metrics documentation

Layer / File(s) Summary
Monitor access and scraping
docs/metrics.md
Documents DaemonSet deployment, data sources, endpoint configuration, Helm access, Prometheus scraping, per-node behavior, and metric labels.
Metric reference and queries
docs/metrics.md
Describes GPU, vGPU, MIG, unified-memory, kernel, and legacy metrics. Adds PromQL examples for monitoring queries.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

Suggested reviewers: archlitchi, ouyangluwei163

Poem

A rabbit reads the metrics bright,
PromQL hops from left to right.
GPU labels now align,
MIG and vGPU metrics shine.
The monitor charts the night.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the added documentation for Prometheus metrics exposed by the vGPU monitor.
Linked Issues check ✅ Passed The documentation covers the vGPU monitor metrics, descriptions, labels, semantics, and example PromQL queries required by issue [#2356].
Out of Scope Changes check ✅ Passed The changes are limited to documentation for vGPU monitor metrics, scraping configuration, compatibility, and related usage guidance.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/metrics.md`:
- Around line 28-35: Update the Prometheus scraping example in the metrics
documentation to use the chart-generated ServiceMonitor instead of directly
scraping the NodePort address, or explicitly document that the NodePort Service
must use externalTrafficPolicy: Local for per-node scraping.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d1a362a4-7de1-4a66-9df2-0cda55568b4a

📥 Commits

Reviewing files that changed from the base of the PR and between 2cabe29 and 46a80e5.

📒 Files selected for processing (1)
  • docs/metrics.md

Comment thread docs/metrics.md Outdated
Signed-off-by: khanskr <294885327+khanskr@users.noreply.github.com>
@archlitchi

Copy link
Copy Markdown
Member

docs/ only contains design document, for user-guide, you need to change the hami-website:https://github.com/Project-HAMi/website

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

Labels

dco-signoff: yes kind/documentation Improvements or additions to documentation size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: document Prometheus metrics exposed by vGPU monitor

2 participants