1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-01-07 23:02:15 +02:00
opentelemetry-go/sdk/resource
Tyler Yahn 0fe65e6bd2
Comply with OpenTelemetry attributes specification (#1703)
* 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>
2021-03-17 20:48:43 -04:00
..
auto.go chore: adds vanity import for files that don't have it. (#1297) 2020-11-04 09:10:58 -08:00
benchmark_test.go Rename otel/label -> otel/attribute (#1541) 2021-02-18 12:59:37 -05:00
builtin_test.go Comply with OpenTelemetry attributes specification (#1703) 2021-03-17 20:48:43 -04:00
builtin.go Comply with OpenTelemetry attributes specification (#1703) 2021-03-17 20:48:43 -04:00
config_test.go Rename otel/label -> otel/attribute (#1541) 2021-02-18 12:59:37 -05:00
config.go revent end-users from implementing some interfaces (#1575) 2021-02-24 10:03:35 -08:00
doc.go chore: adds vanity import for files that don't have it. (#1297) 2020-11-04 09:10:58 -08:00
env_test.go Rename otel/label -> otel/attribute (#1541) 2021-02-18 12:59:37 -05:00
env.go Rename resource pkg label vars and methods (#1692) 2021-03-11 11:00:12 -08:00
resource_test.go Comply with OpenTelemetry attributes specification (#1703) 2021-03-17 20:48:43 -04:00
resource.go Comply with OpenTelemetry attributes specification (#1703) 2021-03-17 20:48:43 -04:00