You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-11-25 22:41:46 +02:00
Unify TracerProvider span processor lookups (#3942)
* Pre-allocate spanProcessorStates slice * Make sync.Once a non-pointer It doesn't need to be a pointer, can be part of the struct to avoid allocating a separate object for it * getSpanProcessors() helper * Add tests for UnregisterSpanProcessor()
This commit is contained in:
committed by
GitHub
parent
271df1dc01
commit
22fd10447d
@@ -62,11 +62,11 @@ type SpanProcessor interface {
|
||||
|
||||
type spanProcessorState struct {
|
||||
sp SpanProcessor
|
||||
state *sync.Once
|
||||
state sync.Once
|
||||
}
|
||||
|
||||
func newSpanProcessorState(sp SpanProcessor) *spanProcessorState {
|
||||
return &spanProcessorState{sp: sp, state: &sync.Once{}}
|
||||
return &spanProcessorState{sp: sp}
|
||||
}
|
||||
|
||||
type spanProcessorStates []*spanProcessorState
|
||||
|
||||
Reference in New Issue
Block a user