Maybe add the key/val attribute to the given attributes.
"Maybe" because this ensures the key is valid (the string is not empty),
the val is an accepted spec AnyValue type (see isAnyValue below),
and the attribute does not need to be dropped because of a count limit.
Note that the TypeScript AnyValue type is looser than the spec
AnyValue.
This also applies attribute count and value length limits.
This returns an AddAttributeDecision enum value indicating whether,
why, and how the attribute was added. This can be relevant for the
caller updating metrics (e.g. droppedAttributesCount).
Maybe add the
key/valattribute to the givenattributes.keyis valid (the string is not empty), thevalis an accepted spec AnyValue type (seeisAnyValuebelow), and the attribute does not need to be dropped because of a count limit. Note that the TypeScriptAnyValuetype is looser than the specAnyValue.AddAttributeDecisionenum value indicating whether, why, and how the attribute was added. This can be relevant for the caller updating metrics (e.g.droppedAttributesCount).