[OTLP EXPORTER] Support setting byte arrays in all attribute collections and reject null keys#4226
Open
dbarker wants to merge 3 commits into
Open
Conversation
…p populate attribute utils
3 tasks
dbarker
commented
Jul 8, 2026
| // overloads above. | ||
| OPENTELEMETRY_DEPRECATED_MESSAGE( | ||
| "allow_bytes is unused; use the AttributeValueMaxLength overload instead") | ||
| static void PopulateAnyValue(opentelemetry::proto::common::v1::AnyValue *proto_value, |
Member
Author
There was a problem hiding this comment.
Decided to deprecate these methods that take bool allow_bytes since allow_bytes is no longer needed, but we still need the max_length arg which will be new in version 1.28.
dbarker
commented
Jul 8, 2026
|
|
||
| // Test that updating a duplicate key does not consume an attribute slot or increment | ||
| // the dropped-attributes counter, even when the attribute limit is already reached. | ||
| TEST(OtlpRecordable, DISABLED_SetAttributeDeduplicateDoesNotIncrementDropped) |
Member
Author
There was a problem hiding this comment.
These tests for duplicate attribute keys are added but disabled since OtlpRecordable will duplicate keys now.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4226 +/- ##
==========================================
+ Coverage 82.79% 82.81% +0.03%
==========================================
Files 415 415
Lines 17452 17486 +34
==========================================
+ Hits 14447 14480 +33
- Misses 3005 3006 +1
🚀 New features to boost your workflow:
|
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 # (issue)
Fixes a few non-compliant areas of the otlp attribute spec:
See:
https://opentelemetry.io/docs/specs/otel/common/#attribute
https://opentelemetry.io/docs/specs/otel/common/#attribute-collections
All attribute collections then must accept a byte array.
Resources, Instrumentation Scopes, Metric points, Spans, Span Events, Span Links and Log Records, contain a collection of attributes.
Changes
allow_bytesboolean as a third arg.For significant contributions please make sure you have completed the following items:
CHANGELOG.mdupdated for non-trivial changes