Skip to content

[Prototype] attribute: add complex value types #6809

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

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

pellared
Copy link
Member

@pellared pellared commented May 22, 2025

Prototype for open-telemetry/opentelemetry-specification#4485

This PR is to validate that it is possible to extend attributes with complex attributes without making breaking changes and making sure that Value is still comparable.

It does not implement everything. I was just focused how we are able to handle the following new attribute value types in a backwards compatible way:

  • empty value
  • heterogeneous array
  • (heterogeneous) map
  • I was too lazy to implement bytes

This PR does not update the code dependent on attributes package. Exporters do not export complex attributes and the Logs API do not use this package. Nothing prevents doing it and I think this is not necessary to validate the OTEP.

@pellared pellared added the Skip Changelog PRs that do not require a CHANGELOG.md entry label May 22, 2025
@pellared
Copy link
Member Author

pellared commented May 22, 2025

@open-telemetry/go-maintainers, do you think that there anything more that I should add/check in order to validate the open-telemetry/opentelemetry-specification#4485?

@pellared pellared changed the title [Prototype] attribute: add complex attributes [DO NOT MERGE] [Prototype] attribute: add complex attributes May 22, 2025
@pellared pellared marked this pull request as ready for review May 22, 2025 12:17
@pellared pellared changed the title [DO NOT MERGE] [Prototype] attribute: add complex attributes [DO NOT MERGE] [Prototype] attribute: add complex value types May 22, 2025
@pellared
Copy link
Member Author

SIG meeting:
Looks good for the Go SIG.
The only feedback was that it would be safer to have EMPTY a new type (distinct from INVALID) and creating empty values would require "factory functions".

@pellared pellared changed the title [DO NOT MERGE] [Prototype] attribute: add complex value types [Prototype] attribute: add complex value types May 22, 2025
@pellared pellared marked this pull request as draft May 22, 2025 17:35
}

// MapValue creates a MAP Value.
// v is sorted by key.
Copy link
Member Author

Choose a reason for hiding this comment

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

We should also deduplicate keys, but this is an implementation detail not relevant for the prototype.

This was referenced May 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Skip Changelog PRs that do not require a CHANGELOG.md entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant