* Optimize Set.Filter for no filtered case
When all elements of the Set are kept during a call to Filter, do not
allocate a new Set and the dropped attributes slice. Instead, return the
immutable Set and nil.
To achieve this the functionality of filterSet is broken down into a
more generic filteredToFront function.
* Apply suggestions from code review
Co-authored-by: Robert Pająk <pellared@hotmail.com>
* Rename run to benchFn based on review feedback
---------
Co-authored-by: Robert Pająk <pellared@hotmail.com>
* Use gofumpt instead of gofmt in golangci-lint conf
* Run gofumpt fixes
* Format generated templates
---------
Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
* Add allow/deny attr filters
* Revert "Replace `Stream.AttributeFilter` with `AllowAttributeKeys` (#4288)"
This reverts commit 1633c74aea.
* Rename new attr filter funcs
Do not include the term "Attribute" in a creation function of the
"attribute" pkg.
* Update the AttributeFilter field documentation
* Add tests for filter creation funcs
* Add change to changelog
* Apply feedback
* Use NewDenyKeysFilter for allow-all and deny-list filters
* Remove links from field docs
These links do not render.
---------
Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
* Pool sortables used to create attribute sets
* Move sync pool to attribute pkg
* Add change to changelog
* Fix comment
* Apply suggestions from code review
Co-authored-by: Peter Liu <lpfvip2008@gmail.com>
* Update sdk/metric/instrument.go
Co-authored-by: Robert Pająk <pellared@hotmail.com>
* Update comment based on feedback
* Apply feedback
---------
Co-authored-by: Peter Liu <lpfvip2008@gmail.com>
Co-authored-by: Robert Pająk <pellared@hotmail.com>
* Replace use of old term label with attribute
The specification has unified on the term attribute to describe
key-value pairs. There exist still many hold-overs of the use of the
term label. This updates those uses or deprecates exported types and
functions in favor of renamed forms.
* fix infinite recursion
* Remove backticks from attribute set docs
* Remove LabelFilterSelector entirely
* Remove Metadata.Labels instead of deprecate
* Update changelog with public changes
* Revert OC err msg
* Update versions file for 1.0.0 release
* Prepare stable-v1 for version v1.0.0
* Update trace signal status in documentation
* Update changelog
* Update CHANGELOG.md
Co-authored-by: Robert Pająk <pellared@hotmail.com>
Co-authored-by: Robert Pająk <pellared@hotmail.com>
* Fix slice-valued attributes when used as map keys
Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
* store pointers to slice values to make them usable as map keys
Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
* Emit slice-typed attribute values as slices, not pointers to slices
Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
* Deprecate Array attribute in favor of *Slice types
* Use new attr types in Jaeger exporter
* Use slice attr types in otlpmetric
* Use slice attr types in otlptrace
* Use slice attr types in zipkin exporter
* Remove array attr test from deprectated oteltest func
* Use StringSlice for cmd arg resource attr
* Add changes to the changelog
* Remove use of deprecated Array func
Group benchmarks by type for easier understanding and filtering.
Save output of function calls in benchmarks to file level vars to ensure
the compiler does not optimize away the test.
Unify testing functionality for common benchmark tasks.
* Add Valid method to KeyValue
* Use KeyValue.Valid in attribute add on Span
* Resource StringDetector errors for invalid attribute
* Ignore invalid attr in NewWithAttributes
The OpenTelemetry specification requires attributes conform to a
standard evaluated and returned by attribute.KeyValue.Valid. To comply
with the specification, Resources created from NewWithAttributes need to
only contain valid attributes. This adds a check to ensure this and
drops invalid attributes passed as arguments.
* Add changes to changelog
* Add nolint comment
The attribute.Set is (possibly overly) optimized to avoid allocations.
The returned value from the constructor is a value of a Set, not a
pointer to the Set. A Set contains a lock value and pointer methods so
passing the Set value raises the copylock go vet error. This copies the
same nolint comment from the `NewSet` method this used to use.
* Apply suggestions from code review
Co-authored-by: Sam Xie <xsambundy@gmail.com>
Co-authored-by: Sam Xie <xsambundy@gmail.com>