diff --git a/CHANGELOG.md b/CHANGELOG.md index c777839ff..8d62a7137 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,9 +23,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - The `ExtractHTTP` and `InjectHTTP` fuctions from the `go.opentelemetry.io/otel/api/propagation` package were removed. (#1212) - The `Propagators` interface from the `go.opentelemetry.io/otel/api/propagation` package was removed to conform to the OpenTelemetry specification. The explicit `TextMapPropagator` type can be used in its place as this is the `Propagator` type the specification defines. (#1212) - -### Removed - +- The `SetAttribute` method of the `Span` from the `go.opentelemetry.io/otel/api/trace` package was removed given its redundancy with the `SetAttributes` method. (#1216) - Remove duplicate hostname key `HostHostNameKey` in Resource semantic conventions. (#1219) ## [0.12.0] - 2020-09-24 diff --git a/api/trace/api.go b/api/trace/api.go index 614f5bab4..3f15f48e2 100644 --- a/api/trace/api.go +++ b/api/trace/api.go @@ -138,9 +138,6 @@ type Span interface { // Set span attributes SetAttributes(kv ...label.KeyValue) - - // Set singular span attribute, with type inference. - SetAttribute(k string, v interface{}) } // SpanConfig is a group of options for a Span. diff --git a/api/trace/context_test.go b/api/trace/context_test.go index cd9c108fe..fd106d9d5 100644 --- a/api/trace/context_test.go +++ b/api/trace/context_test.go @@ -96,10 +96,6 @@ func (mockSpan) SetError(v bool) { func (mockSpan) SetAttributes(attributes ...label.KeyValue) { } -// SetAttribute does nothing. -func (mockSpan) SetAttribute(k string, v interface{}) { -} - // End does nothing. func (mockSpan) End(options ...trace.SpanOption) { } diff --git a/api/trace/noop_span.go b/api/trace/noop_span.go index 510a0f0c3..f014f2106 100644 --- a/api/trace/noop_span.go +++ b/api/trace/noop_span.go @@ -49,10 +49,6 @@ func (noopSpan) SetError(v bool) { func (noopSpan) SetAttributes(attributes ...label.KeyValue) { } -// SetAttribute does nothing. -func (noopSpan) SetAttribute(k string, v interface{}) { -} - // End does nothing. func (noopSpan) End(options ...SpanOption) { } diff --git a/api/trace/tracetest/mock_span.go b/api/trace/tracetest/mock_span.go index a8f406523..e6de86023 100644 --- a/api/trace/tracetest/mock_span.go +++ b/api/trace/tracetest/mock_span.go @@ -62,10 +62,6 @@ func (ms *MockSpan) SetError(v bool) { func (ms *MockSpan) SetAttributes(attributes ...label.KeyValue) { } -// SetAttribute does nothing. -func (ms *MockSpan) SetAttribute(k string, v interface{}) { -} - // End does nothing. func (ms *MockSpan) End(options ...apitrace.SpanOption) { } diff --git a/api/trace/tracetest/span.go b/api/trace/tracetest/span.go index 312624111..3fcb10df9 100644 --- a/api/trace/tracetest/span.go +++ b/api/trace/tracetest/span.go @@ -174,10 +174,6 @@ func (s *Span) SetAttributes(attrs ...label.KeyValue) { } } -func (s *Span) SetAttribute(k string, v interface{}) { - s.SetAttributes(label.Any(k, v)) -} - // Name returns the name most recently set on the Span, either at or after creation time. // It cannot be change after End has been called on the Span. func (s *Span) Name() string { diff --git a/bridge/opentracing/internal/mock.go b/bridge/opentracing/internal/mock.go index 1110b63db..d115b8218 100644 --- a/bridge/opentracing/internal/mock.go +++ b/bridge/opentracing/internal/mock.go @@ -228,10 +228,6 @@ func (s *MockSpan) SetAttributes(attributes ...label.KeyValue) { }) } -func (s *MockSpan) SetAttribute(k string, v interface{}) { - s.SetAttributes(label.Any(k, v)) -} - func (s *MockSpan) applyUpdate(update otelbaggage.MapUpdate) { s.Attributes = s.Attributes.Apply(update) } diff --git a/sdk/trace/span.go b/sdk/trace/span.go index b975c1382..40c9e5273 100644 --- a/sdk/trace/span.go +++ b/sdk/trace/span.go @@ -101,13 +101,6 @@ func (s *span) SetAttributes(attributes ...label.KeyValue) { s.copyToCappedAttributes(attributes...) } -func (s *span) SetAttribute(k string, v interface{}) { - attr := label.Any(k, v) - if attr.Value.Type() != label.INVALID { - s.SetAttributes(attr) - } -} - // End ends the span. // // The only SpanOption currently supported is WithTimestamp which will set the