Skip to content

Conversation

gggritso
Copy link
Member

@gggritso gggritso commented Jul 10, 2025

OTLP supports array attributes, and there are many common semantic attributes that are expected to be arrays. Right now, we discard this information because we don't have system-level handling for arrays at all, and a proper solution is very hard.

For now, let's hack around this, and serialize array types to a JSON string, which is a common recommended approach by OTel when a protocol cannot support every data type.

Convert array attributes very early to strings, and then sends them along.

@gggritso gggritso requested a review from loewenheim July 10, 2025 19:57
@gggritso gggritso marked this pull request as ready for review July 10, 2025 19:57
@gggritso gggritso requested a review from a team as a code owner July 10, 2025 19:57
@loewenheim
Copy link
Contributor

Both OTLP and SpanV2 support array attributes

Is this specified somewhere for Spans V2?

@gggritso gggritso changed the title feat(otlp): Serialize array attributes to JSON feat(otlp): Serialize standalone span array attributes to JSON Jul 11, 2025
@gggritso gggritso changed the title feat(otlp): Serialize standalone span array attributes to JSON feat(otlp): Serialize OTEL span array attributes to JSON Jul 11, 2025
@gggritso
Copy link
Member Author

@loewenheim whoa, I guess not! I made that assumption, but I guess we never actually discussed this. Since this PR deals exclusively with converting OTEL spans, I left mentions of SpanV2 out of it

Co-authored-by: Sebastian Zivota <[email protected]>
@gggritso gggritso added this pull request to the merge queue Jul 14, 2025
Merged via the queue into master with commit abd9f43 Jul 14, 2025
28 checks passed
@gggritso gggritso deleted the georgegritsouk/ope-29-write-array-attributes-to-eap branch July 14, 2025 14:40
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.

2 participants