opentelemetry-go
opentelemetry-go copied to clipboard
[Prototype] attribute: add complex value types
Prototype for https://github.com/open-telemetry/opentelemetry-specification/pull/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.
@open-telemetry/go-maintainers, do you think that there anything more that I should add/check in order to validate the https://github.com/open-telemetry/opentelemetry-specification/pull/4485?
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".