Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(span): remove SetAttribute method #1216

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
124 changes: 62 additions & 62 deletions CHANGELOG.md

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions api/trace/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 0 additions & 4 deletions api/trace/context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
}
Expand Down
4 changes: 0 additions & 4 deletions api/trace/noop_span.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
}
Expand Down
4 changes: 0 additions & 4 deletions api/trace/tracetest/mock_span.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
}
Expand Down
4 changes: 0 additions & 4 deletions api/trace/tracetest/span.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 0 additions & 4 deletions bridge/opentracing/internal/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
7 changes: 0 additions & 7 deletions sdk/trace/span.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down