fix(metrics): add device_type label to node memory ratio metrics (#2370) - #2554
Conversation
…ject-HAMi#2370) Signed-off-by: Prabal Poddar <prabalpoddar73@gmail.com>
📝 WalkthroughWalkthroughThe scheduler now adds a ChangesGPU memory metric labels
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
Codecov Report❌ Patch coverage is
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 5 files with indirect coverage changes 🚀 New features to boost your workflow:
|
…yPercentage Signed-off-by: Prabal Poddar <prabalpoddar73@gmail.com>
|
legacyMemoryPercentage (metrics.go:190, sendLegacyMetric call at 277) still has no device_type. pr body says both got fixed, only the new metric did. |
|
as per your suggestion, to preserve backward compatibility for legacy dashboards which expect a fixed label set...i removed the changes from legacyMemoryPercentage while keeping the new metric changes as it is. I have updated the outdated PR body |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: archlitchi, princexpoddar The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind bug
What this PR does / why we need it:
In the scheduler's Prometheus metrics in cmd/scheduler/metrics.go, hami_node_gpu_memory_allocated_ratio did not have the device_type label that every other device metric in the file carries....On running the scheduler on a node with different devices(lets say NVIDIA and Ascend) sharing the same device_index...scraping /metrics produced metric series for hami_node_gpu_memory_allocated_ratio where we cannot tell the NVIDIA and Ascend apart without already knowing which device_uuid belonged to which one.
Added device_type to nodeGPUMemoryPercentage in cmd/scheduler/metrics to be consistent with all other sibling metrics....also updated the corresponding tests in cmd/scheduler/metrics_test.go
Which issue(s) this PR fixes:
Fixes #2370
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
N/A
Summary by CodeRabbit
device_typelabel to node-level and legacy GPU memory utilization metrics.