Skip to content

Conversation

@trask
Copy link
Member

@trask trask commented Nov 5, 2025

Based on prototype option C (#7813)

@trask trask force-pushed the complex-attrs-c-impl branch from f91ab1f to 6e1c6e7 Compare November 5, 2025 21:34
@codecov
Copy link

codecov bot commented Nov 6, 2025

Codecov Report

❌ Patch coverage is 79.23497% with 38 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.13%. Comparing base (683a447) to head (9b9ea16).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...a/io/opentelemetry/sdk/internal/AttributeUtil.java 62.26% 13 Missing and 7 partials ⚠️
...r/common/ArrayBackedExtendedAttributesBuilder.java 84.61% 6 Missing and 4 partials ⚠️
...ncubator/common/ArrayBackedExtendedAttributes.java 86.20% 3 Missing and 5 partials ⚠️

❌ Your patch status has failed because the patch coverage (79.23%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #7814      +/-   ##
============================================
+ Coverage     90.10%   90.13%   +0.02%     
- Complexity     7240     7322      +82     
============================================
  Files           825      825              
  Lines         21850    22032     +182     
  Branches       2136     2177      +41     
============================================
+ Hits          19688    19858     +170     
- Misses         1496     1497       +1     
- Partials        666      677      +11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@trask trask force-pushed the complex-attrs-c-impl branch from 4da140a to 26a3413 Compare November 13, 2025 19:32
@trask trask marked this pull request as ready for review November 13, 2025 23:23
@trask trask requested a review from a team as a code owner November 13, 2025 23:23
Copy link
Contributor

@jkwatson jkwatson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyone who wants to use the Value type should be scared off by looking at the complexity of the implementation. 😂 Thanks!

@jack-berg
Copy link
Member

I was kinda hoping we could merge this right into the stable Attributes to reduce churn. After all, ExtendedAttributes served its job and helped provide feedback to the spec. What feedback might we get from iterating again on ExtendedAttributes? Should we weigh the probability of feedback against the cost / inconvenience of churn?

@trask
Copy link
Member Author

trask commented Nov 18, 2025

we can't merge it into stable until Jan 15 (6 months after the OTEP was merged)

@trask
Copy link
Member Author

trask commented Nov 18, 2025

TODO: implement attribute limits

@jack-berg
Copy link
Member

TODO: implement attribute limits

Is there consensus on how to do this?

@trask
Copy link
Member Author

trask commented Nov 18, 2025

@trask trask force-pushed the complex-attrs-c-impl branch from f27638a to 4386c8c Compare November 18, 2025 22:27
return asValue(currentKey.getType(), value);
}
}
return null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this implementation benefit from #7076?

buffer.get(truncated);
return Value.of(truncated);
} else if (type == ValueType.ARRAY) {
List<Value<?>> array = (List<Value<?>>) value.getValue();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The AttributeUtil.applyAttributesLimit function takes an approach of first checking if any any attribute is invalid before paying the price to create a new AttributeBuilder and rebuilding, with the limits applied to each entry.

Could take the same approach here to avoid unnecessary reconstruction of the Value if all the entries are valid. Applies to KEY_VALUE_LIST as well.

Don't necessarily need to solve it now, but let's at least leave a TODO.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AttributeKey<List<Double>> doubleArrKey = AttributeKey.doubleArrayKey("acme.double_array");

// Extended keys
@SuppressWarnings("deprecation") // Supporting deprecated EXTENDED_ATTRIBUTES until removed
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to demonstrate deprecate feature. Not sure anyone will see it, but let's go ahead on delete the usages in here of EXTENDED_ATTRIBUTES.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

codecov 😭

@trask trask force-pushed the complex-attrs-c-impl branch from 88ecb20 to 587e7e3 Compare November 25, 2025 04:22
@jack-berg jack-berg merged commit 7c5255f into open-telemetry:main Nov 25, 2025
27 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants