Fix LongExemplarAssert hasFilteredAttributesSatisfyingExactly to enforce exact attribute matching#8518
Merged
jack-berg merged 2 commits intoJul 13, 2026
Conversation
…rce exact attribute matching
thswlsqls
force-pushed
the
fix/long-exemplar-assert-filtered-attributes-exactly
branch
from
June 22, 2026 08:27
cdf0841 to
d95bcba
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8518 +/- ##
============================================
+ Coverage 91.60% 91.61% +0.01%
- Complexity 10312 10313 +1
============================================
Files 1013 1013
Lines 27274 27274
Branches 3202 3202
============================================
+ Hits 24983 24986 +3
+ Misses 1563 1561 -2
+ Partials 728 727 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
|
This has been automatically marked as stale because it has been marked as needing author feedback and has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment. |
jack-berg
approved these changes
Jul 13, 2026
jack-berg
marked this pull request as ready for review
July 13, 2026 20:32
Contributor
|
Thank you for your contribution @thswlsqls! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this survey. |
thswlsqls
deleted the
fix/long-exemplar-assert-filtered-attributes-exactly
branch
July 17, 2026 02:31
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.
Fixes #8517
Description
LongExemplarAssert.hasFilteredAttributesSatisfyingExactly(AttributeAssertion...)delegated tohasFilteredAttributesSatisfying(the non-exact helper), so it did not reject extra filtered attributes.Iterableoverload (AssertUtil.assertAttributesExactly), matchingDoubleExemplarAssert.hasFilteredAttributesSatisfyingExactlyand the same-classIterableoverload.longGaugeFailurecases threw for other reasons and never exercised the exactness path.Testing done
MetricAssertionsTest.longGaugeFailureasserting a single filtered attribute on an exemplar that has nine; it must raiseAssertionError. Fails before the fix, passes after../gradlew :sdk:testing:check— passed (16 tests inMetricAssertionsTest).docs/apidiffsupdate.## Unreleased#### Testingentry inCHANGELOG.md(assertion now stricter; previously lax tests may newly fail).