1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-07-03 00:27:03 +02:00

Deprecate Library and move all uses to Scope (#2977)

* Deprecate Library and move all uses to Scope

* Add PR number to changelog

* Don't change signatures in stable modules

* Revert some changes

* Rename internal struct names

* A bit more renaming

* Update sdk/trace/span.go

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

* Update based on feedback

* Revert change

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
This commit is contained in:
Craig Pastro
2022-07-06 11:55:46 -07:00
committed by GitHub
parent 5795c70e0c
commit 575e1bb270
18 changed files with 156 additions and 122 deletions

View File

@ -63,8 +63,12 @@ type ReadOnlySpan interface {
Events() []Event
// Status returns the spans status.
Status() Status
// InstrumentationScope returns information about the instrumentation
// scope that created the span.
InstrumentationScope() instrumentation.Scope
// InstrumentationLibrary returns information about the instrumentation
// library that created the span.
// Deprecated: please use InstrumentationScope instead.
InstrumentationLibrary() instrumentation.Library
// Resource returns information about the entity that produced the span.
Resource() *resource.Resource
@ -584,12 +588,20 @@ func (s *recordingSpan) Status() Status {
return s.status
}
// InstrumentationScope returns the instrumentation.Scope associated with
// the Tracer that created this span.
func (s *recordingSpan) InstrumentationScope() instrumentation.Scope {
s.mu.Lock()
defer s.mu.Unlock()
return s.tracer.instrumentationScope
}
// InstrumentationLibrary returns the instrumentation.Library associated with
// the Tracer that created this span.
func (s *recordingSpan) InstrumentationLibrary() instrumentation.Library {
s.mu.Lock()
defer s.mu.Unlock()
return s.tracer.instrumentationLibrary
return s.tracer.instrumentationScope
}
// Resource returns the Resource associated with the Tracer that created this
@ -668,7 +680,7 @@ func (s *recordingSpan) snapshot() ReadOnlySpan {
defer s.mu.Unlock()
sd.endTime = s.endTime
sd.instrumentationLibrary = s.tracer.instrumentationLibrary
sd.instrumentationScope = s.tracer.instrumentationScope
sd.name = s.name
sd.parent = s.parent
sd.resource = s.tracer.provider.resource