Skip to content

fix(v1): decode array, key-value list and bytes attribute values - #426

Closed
Leiyks wants to merge 1 commit into
masterfrom
leiyks/v1-attribute-types
Closed

Leiyks wants to merge 1 commit into
masterfrom
leiyks/v1-attribute-types

Conversation

@Leiyks

@Leiyks Leiyks commented Sep 30, 2026

Copy link
Copy Markdown

What

V1 (/v1.0/traces) attribute values of type ARRAY, KEY_VALUE_LIST and BYTES raised NotImplementedError. Because /test/session/traces re-decodes every stored request, a single such span made the whole session return 400.

  • Arrays and key-value lists are now flattened into dotted keys (key.0, key.member, recursively), with each leaf mapped like a scalar of its type (string → meta, int/double → metrics, bool → metrics 1/0). This applies to span, chunk and payload attributes. Span links get the same flattening with string leaves. Span events keep arrays as type: 4 and flatten KV lists. This matches libdatadog's V1→v0.4 downgrade and the key.N shape that system-tests already asserts (for example test_otel_set_attributes_different_types_with_array_encoding and test_otel_span_link_attribute_handling).
  • BYTES go to meta_struct on spans (msgpack-decoded, falling back to UTF-8 text). On links and events they become text.
  • Payload-level attributes: _dd.git.commit.sha and _dd.git.repository_url now go only on each chunk's local root, and _dd.tags.process only on each chunk's first span. Previously they went on every span. This is where v0.4 carried them, and where dd-trace-go's own V1 decoder puts process tags. Other payload attributes still apply to every span.

Testing

Flatten v1 ARRAY and KEY_VALUE_LIST attribute values into dotted keys
(key.0, key.member) on spans, span links and chunk/payload attributes, as
the v0.4 format does, and map BYTES to meta_struct. Previously they raised
NotImplementedError, failing every /test/session/traces call of the session.

Also apply the payload-level git metadata to the chunk's local root only and
process tags to its first span only, instead of to every span.
@Leiyks Leiyks closed this Sep 30, 2026
@Leiyks

Leiyks commented Sep 30, 2026

Copy link
Copy Markdown
Author

Already handled by that PR: #422

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.

1 participant