Interface ExtendedAttributes


@Immutable public interface ExtendedAttributes
An immutable container for extended attributes.

"extended" refers an extended set of allowed value types compared to standard Attributes. Notably, ExtendedAttributes values can be of type ExtendedAttributeType.EXTENDED_ATTRIBUTES, allowing nested ExtendedAttributes of arbitrary depth.

Where standard Attributes are accepted everyone that OpenTelemetry represents key / value pairs, ExtendedAttributes are only accepted in select places, such as log records (e.g. ExtendedLogRecordBuilder.setAttribute(ExtendedAttributeKey, Object)).

The keys are ExtendedAttributeKeys and the values are Object instances that match the type of the provided key.

Null keys will be silently dropped.

Note: The behavior of null-valued attributes is undefined, and hence strongly discouraged.

Implementations of this interface *must* be immutable and have well-defined value-based equals/hashCode implementations. If an implementation does not strictly conform to these requirements, behavior of the OpenTelemetry APIs and default SDK cannot be guaranteed.

For this reason, it is strongly suggested that you use the implementation that is provided here via the factory methods and the ExtendedAttributesBuilder.

Convenience methods are provided for translating to / from Attributes: