docs(monitoring): add GPU metrics reference and monitoring guide - #2374
docs(monitoring): add GPU metrics reference and monitoring guide#2374imantaba wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: imantaba The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe pull request adds a monitoring guide for HAMi. It documents metric sources, Prometheus collection, metric names, legacy compatibility, PromQL queries, Grafana dashboards, and optional PrometheusRule alerts. ChangesMonitoring documentation
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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/monitoring.md`:
- Around line 108-109: Update the Prometheus query comment and expression so
they agree: either add an explicit usage threshold such as >80 to return only
containers near their vGPU memory limit, or rename the comment to describe that
the query calculates usage percentages for all containers with positive limits.
- Around line 11-16: Update the Prometheus scrape configuration guidance in
docs/monitoring.md to include the vGPU monitor’s /metrics target alongside the
scheduler endpoint, specifying how non-Operator Prometheus discovers or reaches
the monitor on port 9394. Ensure the documented target uses the actual vGPU
monitor service or pod discovery method rather than implying port 9394 is
directly accessible through a NodePort.
- Around line 91-99: Update the monitoring documentation around the example
PromQL query to remove the claim that `and on (device_uuid)` attaches or copies
the `node` label. Describe the query only as filtering host GPU series by
matching scheduler metrics, or replace it with a label-preserving arithmetic
join if the example must support downstream grouping by `node`.
🪄 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: 414df542-1c81-4ba8-80eb-3d4c040b3812
📒 Files selected for processing (1)
docs/monitoring.md
Add docs/monitoring.md describing HAMi's Prometheus metrics and how to operate them. It covers: - Which component emits what: the scheduler's allocation view (per node, device, container) and the vGPU monitor's runtime usage view (host GPU and per-container usage), including their metrics endpoints and ports. - A full reference of the current hami_-prefixed metrics with labels and descriptions, verified against the scheduler and vGPU-monitor metric definitions, plus a note that *_ratio metrics use a 0-100 scale. - Enabling scraping via prometheus.enabled (ServiceMonitors) or a plain Prometheus against the /metrics endpoints. - The legacy metric names and how to re-enable them. - Example PromQL, including a device_uuid join between the allocation and usage views, and pointers to the Grafana dashboard and the opt-in PrometheusRule alerts. Signed-off-by: imantaba <itn.taba@gmail.com>
8aa1485 to
e55bf30
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
|
docs/ now will only accept design document, for user-guide, please submit PR to the hami-website monitoring section, link: https://project-hami.io/docs/userguide/monitoring/device-allocation let me know if you submit the PR in website |
Thanks @archlitchi . I've opened the website PR: (https://github.com/Project-HAMi/website/pull/730). |
What type of PR is this?
/kind documentation
What this PR does / why we need it:
Adds
docs/monitoring.md, a reference for HAMi's Prometheus metrics and how tooperate them. Today the metrics exist but are only discoverable by reading the
scheduler and vGPU-monitor source, so operators have no single place to learn the
names, labels, and scales.
The doc covers:
container; always carries
node) versus the vGPU monitor's runtime usage view(host GPU and per-container usage), with each component's
/metricsendpoint andport.
hami_-prefixed metric with itslabels and description, split into the allocation and usage tables. All names and
label sets were verified against the metric definitions in
cmd/schedulerandcmd/vGPUmonitor.*_ratiometrics are reported on a 0-100 (percent) scale,not 0-1.
prometheus.enabled(renders ServiceMonitors) or aplain Prometheus pointed at the endpoints.
device_uuidjoin between the allocation andusage views.
Which issue(s) this PR fixes:
Special notes for your reviewer:
This is the documentation piece of a small observability series:
dashboards/PrometheusRulealerts (prometheus.alerts.*)This doc's "Dashboards" and "Alerting" sections link to
dashboards/and theprometheus.alertsvalues added by those two PRs, so it reads best merged afterthem. The metric reference, scraping, and query sections are self-contained and
accurate against the current
master.This change was prepared with AI assistance (per CONTRIBUTING.md); all changes were
reviewed and verified by me.
Does this PR introduce a user-facing change?:
Summary by CodeRabbit