You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-12-01 23:12:29 +02:00
Register/unregister in the fixed order (#1198)
- change the processors' map to array - increase test coverage Signed-off-by: Hui Kang <kangh@us.ibm.com> Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com> Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
This commit is contained in:
@@ -139,8 +139,8 @@ func (s *span) End(options ...apitrace.SpanOption) {
|
||||
}
|
||||
config := apitrace.NewSpanConfig(options...)
|
||||
s.endOnce.Do(func() {
|
||||
sps, _ := s.tracer.provider.spanProcessors.Load().(spanProcessorMap)
|
||||
mustExportOrProcess := len(sps) > 0
|
||||
sps, ok := s.tracer.provider.spanProcessors.Load().(spanProcessorStates)
|
||||
mustExportOrProcess := ok && len(sps) > 0
|
||||
if mustExportOrProcess {
|
||||
sd := s.makeSpanData()
|
||||
if config.Timestamp.IsZero() {
|
||||
@@ -148,8 +148,8 @@ func (s *span) End(options ...apitrace.SpanOption) {
|
||||
} else {
|
||||
sd.EndTime = config.Timestamp
|
||||
}
|
||||
for sp := range sps {
|
||||
sp.OnEnd(sd)
|
||||
for _, sp := range sps {
|
||||
sp.sp.OnEnd(sd)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user