-
Notifications
You must be signed in to change notification settings - Fork 917
Complex attributes incubating implementation #7814
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
f91ab1f to
6e1c6e7
Compare
Codecov Report❌ Patch coverage is ❌ 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. 🚀 New features to boost your workflow:
|
cbdcc32 to
2b69000
Compare
4da140a to
26a3413
Compare
api/all/src/main/java/io/opentelemetry/api/common/ArrayBackedAttributesBuilder.java
Outdated
Show resolved
Hide resolved
jkwatson
left a comment
There was a problem hiding this 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!
|
I was kinda hoping we could merge this right into the stable |
|
we can't merge it into stable until Jan 15 (6 months after the OTEP was merged) |
|
TODO: implement attribute limits |
Is there consensus on how to do this? |
|
f27638a to
4386c8c
Compare
| return asValue(currentKey.getType(), value); | ||
| } | ||
| } | ||
| return null; |
There was a problem hiding this comment.
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?
...rc/main/java/io/opentelemetry/api/incubator/common/ArrayBackedExtendedAttributesBuilder.java
Outdated
Show resolved
Hide resolved
...rc/main/java/io/opentelemetry/api/incubator/common/ArrayBackedExtendedAttributesBuilder.java
Outdated
Show resolved
Hide resolved
...bator/src/main/java/io/opentelemetry/api/incubator/common/ArrayBackedExtendedAttributes.java
Show resolved
Hide resolved
...rc/main/java/io/opentelemetry/api/incubator/common/ArrayBackedExtendedAttributesBuilder.java
Show resolved
Hide resolved
| buffer.get(truncated); | ||
| return Value.of(truncated); | ||
| } else if (type == ValueType.ARRAY) { | ||
| List<Value<?>> array = (List<Value<?>>) value.getValue(); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sdk/common/src/main/java/io/opentelemetry/sdk/internal/ExtendedAttributesMap.java
Show resolved
Hide resolved
...incubator/src/main/java/io/opentelemetry/api/incubator/common/ExtendedAttributesBuilder.java
Outdated
Show resolved
Hide resolved
| AttributeKey<List<Double>> doubleArrKey = AttributeKey.doubleArrayKey("acme.double_array"); | ||
|
|
||
| // Extended keys | ||
| @SuppressWarnings("deprecation") // Supporting deprecated EXTENDED_ATTRIBUTES until removed |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
codecov 😭
88ecb20 to
587e7e3
Compare
Based on prototype option C (#7813)