Repository navigation
feat(scanner): add ExcessiveVersionObjects to ScannerMetrics - #592
Merged
Merged
Conversation
Add ExcessiveVersionObjects []string to ScannerMetrics so that objects exceeding the version count or cumulative size threshold are surfaced via the realtime metrics API alongside the existing ExcessivePrefixes field. Each node populates both lists from its local scanner state; the realtime metrics API collects per-node reports and merges them cluster-wide via ScannerMetrics.Merge(). Update Merge() to handle both excess slices with setof.String for deduplication and a 100-entry cap per merge. Entries dropped beyond the cap are counted in the new DiscardedExcessEntries field, which accumulates across cross-node merges.
klauspost
reviewed
May 7, 2026
Signed-off-by: Shubhendu Ram Tripathi <shubhendu@minio.io>
Signed-off-by: Shubhendu Ram Tripathi <shubhendu@minio.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
ScannerMetricsalready exposesExcessivePrefixes(folders with toomany sub-entries) via the realtime metrics API, which collects per-node
reports and merges them cluster-wide. This PR does the same for the
version-excess side: add
ExcessiveVersionObjects []stringso objectsexceeding the version count or cumulative size threshold are visible in
mc admin top scannerand Prometheus scrapes across all nodes.A
DiscardedExcessEntries uint64counter tracks entries dropped whenthe merged list is capped at 100 entries, letting operators know the
list is incomplete without polluting the payload.
Changes
ScannerMetrics: two new fieldsExcessiveVersionObjects []string(json:"excessive_versions")DiscardedExcessEntries uint64(json:"discarded_excess_entries")ScannerMetrics.Merge(): replaces the unboundedExcessivePrefixesdedup map with asetof.String-based helperthat caps both excess slices at 100 entries and accumulates
DiscardedExcessEntriesmetrics_gen.go: regeneratedTesting
New test cases in
TestScannerMetricsMerge:ExcessiveVersionObjectsdedup and sortDiscardedExcessEntriescount (110unique → 100 kept, 10 discarded)
DiscardedExcessEntriesacross successive merges