* Make setting null-valued attributes a no-op, and document that their behavior is undefined.
* also have the span itself ignore null attribute values
* Update api/src/main/java/io/opentelemetry/common/Attributes.java
Co-authored-by: Giovanni Liva <giovanni.liva@dynatrace.com>
* Set the non-null-by-default annotation on the package level for the common code.
* add no-op validating tests with a caveat
Co-authored-by: Giovanni Liva <giovanni.liva@dynatrace.com>
* Reverse the precedence on Labels and Attributes to prefer the last one added, rather than the first.
Note: this necessitated changing the way Resources were merged, and the way recordException was implemented.
Added an addAll method to the builder to support efficiently addition of attributes from existing attributes.
* run the formatter
* revert 2 unneeded assertion changes
* Update from rebase
* Add a generic type for the key on the ImmutableKeyValuePairs.
This necessitated changing the `get` to `getValue` to avoid clashing with the java.util.Map interface.
Also introduced convenience sub-interfaces for consuming labels and attributes, so consumers don't have to worry about the types if they don't want to.
* Make AttributesMap not extend map, and restore the get method name for Attributes.
* key class and implementation
* key class and implementation
* The code compiles
* little tweaks
* some cleanup, tests are passing
* remove AttributeValue and clean up misc. references to it.
* clean up some unused bits
* add a TODO
* a bit of cleanup; fix a todo
* update for changes from the main branch
* Change method to get the underlying key.
Move the key creators to a AttributesKeys class.
Hide the implementation classes and replace with interface use.
* use autovalue for the key implementations
* fix javadoc issues
* update benchmark keys, and a few tweaks from PR review
* Add javadoc notes to encourage using the lower-overhead attribute options.
* Add javadoc clarifying subclass responsibilities around empty keys.
* make the compareTo on AttributeKeyImpl null-safe, for extra safety
* fix formatting
* Add a generic type for the key on the ImmutableKeyValuePairs.
This necessitated changing the `get` to `getValue` to avoid clashing with the java.util.Map interface.
Also introduced convenience sub-interfaces for consuming labels and attributes, so consumers don't have to worry about the types if they don't want to.
* Add some javadoc to the new interfaces.
* Make AttributesMap not extend map, and restore the get method name for Attributes.
* make ImmutableKeyValuePairs also have a parameterized key type
* Introduce an Attributes interface and have ImmutableAttributes and the AttributesMap implement it.
* make the attribute limiting a little clearer.
* tiny javadoc fix
* Rework to restore the Attributes class, and introduce a ReadableAttributes interface
* polish the javadoc a bit
* fix some broken javadoc
* revert example change; revert test name change
* javadoc de-escalation
* fix bad merge
* prototype for class to replace Map<String, AttributeValue)
* safely copy the builder's data
* add the empty constant
* optimization for attributes with a single key/value
* Add an iterator/iterable and some simple tests
* fix animalsniffer complaint
* tests for de-duping and order-independent equality, plus removal of possibly unneeded access methods.
* clean up the sort&filter method a tad
* replace the iterator with a foreach method
* Make the Attributes parameterized by the value type.
* Add basic javadoc
* remove helper class; add a simple test for the builder; make the tests more robust
* Add a varargs method for creating an arbitrary number of key/value pairs.
* static import the check method, for consistency
* Refactor to have an interface and two implementations, with some shared logic.
* fix an accidental rename
* really fix it for real
* add a few more tests
* preserve the `setAttribute` names from existing Span API
* Replace the treemap sorting and filtering with a quicksort and post-filter.
* remove an unneeded list.
* switch to an abstract base class to remove some code duplication
* Updated docs based on feedback.
* Small change to use the builder for the empty implementations.