Repository navigation
Conversation
|
|
Welcome @atiasadir! |
|
Hi @atiasadir. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: atiasadir 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 |
Summary
The disk collector currently returns before recording disk-space metrics whenever
disk/bytes_usedis disabled. Consequently, configuringdisk/percent_usedalone silently produces no percentage metric.Allow either disk-space metric to be enabled independently. Preserve the existing labels, partition deduplication, usage retrieval and error logging. Move the existing disk-space recording block into a private method so regression tests can supply a temporary-directory partition without depending on host partition discovery.
Add table-driven regression coverage for bytes-only, percent-only, both and neither, verifying emitted metrics and their label shapes. Document independent percentage-metric configuration.
Reproduction and validation
On upstream HEAD
0370ee485aedc5de21e052e968044e40a39d25cd, the regression test's percent-only case fails becausedisk_percent_usedis absent. It passes with this fix.go test -race ./pkg/systemstatsmonitor -count=1go vet ./pkg/systemstatsmonitorgit diff --checkCGO_ENABLED=0Tests were executed on macOS; Linux and Windows checks were compile-only. Full repository tests and golangci-lint were not run.
Special notes for reviewers
This PR was written in part with the assistance of generative AI. The commit message was supplied by the contributor.
This is a locally reproduced configuration defect, not a claim about a production incident. No changes to default metric configuration or exported label schemas are intended.