HDDS-15312. Improve VolumeInfoMetrics to include MinFreeSpace and Non-Ozone used space#10304
HDDS-15312. Improve VolumeInfoMetrics to include MinFreeSpace and Non-Ozone used space#10304priyeshkaratha wants to merge 3 commits into
Conversation
…-Ozone used space
There was a problem hiding this comment.
Pull request overview
This PR updates DataNode per-volume JMX metrics (VolumeInfoMetrics) to better reflect filesystem usage by (1) exposing the min-free-space threshold and (2) exposing non-Ozone-used space, while also removing a redundant total-capacity metric.
Changes:
- Add new JMX gauges:
MinFreeSpace(soft limit reported to SCM) andNonOzoneUsed(filesystem usage not attributable to Ozone/HDDS). - Change
FilesystemUsedto be computed asFilesystemCapacity - FilesystemAvailable(instead of reporting the DU/HDDS-used value). - Remove the
TotalCapacitygauge (previously duplicative withFilesystemCapacity).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/volume/VolumeInfoMetrics.java | Adds MinFreeSpace / NonOzoneUsed, changes filesystem-used calculation, removes redundant TotalCapacity metric. |
| hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestVolumeInfoMetrics.java | Updates the unit test assertions/mocks to cover the new/changed metrics. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Thanks @priyeshkaratha for the patch. Some observations:
|
yandrey321
left a comment
There was a problem hiding this comment.
Are these metrics available from /prom endpoint as well?
|
@devmadhuu Thanks for the review. I have addressed all the three points in latest changes
Yes, verified this.
I will handle this in followup Jira
@yandrey321 Yes its reflecting prom as well. |
devmadhuu
left a comment
There was a problem hiding this comment.
Thanks @priyeshkaratha for improving the patch. Changes LGTM. Just a minor nit. Please take care, however I have approved the PR.
| when(volume.getCommittedBytes()).thenReturn(10L); | ||
| when(volume.getContainers()).thenReturn(3L); | ||
| when(volume.getReportedFreeSpaceToSpare(anyLong())).thenReturn(20L); | ||
| when(volume.getFreeSpaceToSpare(anyLong())).thenReturn(10L); |
There was a problem hiding this comment.
This stub may not be necessary, The code only calls getReportedFreeSpaceToSpare (the soft limit). Nothing reads getFreeSpaceToSpare
What changes were proposed in this pull request?
Min Free Space and Non-Ozone Used Space metrics are not available in JMX. Also, Total Capacity and Filesystem Capacity calculated value is same, so there is no need to expose both fields separately since it always shares same value. Therefore, we are removing the Total Capacity field and added Min Free Space and Non-Ozone Used Space metrics.
What is the link to the Apache JIRA
HDDS-15312
How was this patch tested?
Updated unit testcase.
Also tested manually