Skip to content

Commit 1205802

Browse files
committed
util/otelutil: change uses of deprecated instrumentation.Library
While the interface's signature uses the deprecated "Library" type, and upstream documents it as "needed for backward compatibility"; https://github.com/open-telemetry/opentelemetry-go/blob/0f7f1d0bad21aba18feaadc0171c53705fbda419/sdk/trace/span.go#L62-L65 The Library type is now an alias for Scope, so using the non-deprecated type still satisfies the interface; https://github.com/open-telemetry/opentelemetry-go/blob/0f7f1d0bad21aba18feaadc0171c53705fbda419/sdk/instrumentation/library.go#L6-L9 Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent fd87647 commit 1205802

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

util/otelutil/span.go

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ type Span struct {
5959
Resource []attribute.KeyValue
6060
// InstrumentationLibrary is information about the library that produced
6161
// the span
62-
//nolint:staticcheck
63-
InstrumentationLibrary instrumentation.Library
62+
InstrumentationLibrary instrumentation.Scope
6463
}
6564

6665
type Spans []Span
@@ -112,8 +111,8 @@ type spanData struct {
112111
DroppedLinks int
113112
ChildSpanCount int
114113
Resource []keyValue // change this type from the otel type to make this struct marshallable
115-
//nolint:staticcheck
116-
InstrumentationLibrary instrumentation.Library
114+
115+
InstrumentationLibrary instrumentation.Scope
117116
}
118117

119118
// spanContext is a custom type used to unmarshal otel SpanContext correctly.
@@ -484,8 +483,6 @@ func (s spanSnapshot) InstrumentationScope() instrumentation.Scope {
484483
}
485484

486485
// InstrumentationLibrary returns the InstrumentationLibrary of the snapshot
487-
//
488-
//nolint:staticcheck
489-
func (s spanSnapshot) InstrumentationLibrary() instrumentation.Library {
486+
func (s spanSnapshot) InstrumentationLibrary() instrumentation.Scope {
490487
return s.instrumentationScope
491488
}

0 commit comments

Comments
 (0)