Repository navigation
testutil/promlint: fix "mibi" unit prefix to "mebi" - #2135
Merged
Merged
Conversation
The unit prefix list had "mibi" instead of the IEC prefix "mebi", so LintMetricUnits never flagged names such as x_mebibytes, while the sibling prefixes (kibi, gibi, tebi, pebi) worked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: ZainnQureshii <43629888+ZainnQureshii@users.noreply.github.com>
ZainnQureshii
requested review from
bwplotka,
kakkoyun and
vesari
as code owners
September 25, 2026 08:51
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.
unitPrefixesinprometheus/testutil/promlint/validations/units.go:70lists"mibi"; the IEC prefix is"mebi". Its siblings (kibi,gibi,tebi,pebi) are spelled right, so only the mebi case was missed.Effect:
metricUnitschecksstrings.HasPrefix(s, p)for each prefix, and"mebibytes"never starts with"mibi", soLintMetricUnitssaid nothing about a metric likex_mebibyteswhile it does flagx_gigabyteswithuse base unit "bytes" instead of "gigabytes".Change:
"mibi"->"mebi", plus amebibytescase in the existingTestLintMetricUnitstable.Behaviour note: after this,
testutil.GatherAndLint/CollectAndLintreport a problem for_mebibytesmetrics, as they already do for_kibibytesand_gibibytes. Happy to add an Unreleased CHANGELOG line if you'd like one.Verified:
main:want: [{x_mebibytes use base unit "bytes" instead of "mebibytes"}] got: [], passes with the fix.go test ./...passes (go1.27.1, darwin/arm64).make lint: 0 issues.Prepared with AI assistance (Claude Code) and reviewed with GitHub Copilot. Copilot's title-prefix suggestion (
testutil/promlint:) was applied.🤖 Generated with Claude Code