Repository navigation
test(textparse): follow OM 2.0 composite field order in test inputs - #19890
Merged
Merged
Conversation
The OpenMetrics 2.0 specification requires the fields of a histogram composite value to appear in a fixed order: count, sum, schema, zero_threshold, zero_count, negative_spans, negative_buckets, positive_spans, positive_buckets and finally bucket. Some test inputs listed the negative spans after the positive ones, or the classic buckets before the native fields. The parser does not currently enforce the order, so the tests passed regardless. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: György Krajcsovits <[email protected]>
Contributor
|
lgtm |
dashpole
approved these changes
Oct 2, 2026
dashpole
left a comment
Contributor
There was a problem hiding this comment.
Nice. This addresses number 14 in #19745 (comment). It required #19747, IIRC.
bwplotka
approved these changes
Oct 2, 2026
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.
The OpenMetrics 2.0 specification requires the fields of a histogram composite value to appear in a fixed order (see the
native-bucketsandhistogram-bucketsABNF rules in the spec):Four inputs in
openmetrics2parse_test.godid not follow this order:TestOpenMetrics2ParseNativeHistogram,TestOpenMetrics2ParseFloatHistogramandTestOpenMetrics2ParseCompositeGaugeHistogramlistednegative_spans/negative_bucketsafter the positive fields.TestOpenMetrics2ParseIgnoreNativeHistograms("dual classic and native histogram emits classic series only") listedbucketbefore the native fields.The parser does not currently enforce field order, so the tests passed regardless and the expected results are unchanged. The intentionally invalid
count:1,count:99input in the spec validation test is left as is. Summary inputs already follow the requiredcount,sum,quantileorder.🤖 Generated with Claude Code