1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-11-29 23:07:45 +02:00

Move Version function and code from global to toplevel (#1330)

* Move global code to toplevel package

* Move version function to toplevel package

* Update changelog

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
This commit is contained in:
Krzesimir Nowak
2020-11-16 18:30:54 +01:00
committed by GitHub
parent 20c78fed0a
commit 3d6e8b5078
57 changed files with 232 additions and 364 deletions

View File

@@ -19,7 +19,7 @@ import (
"sync"
"sync/atomic"
"go.opentelemetry.io/otel/global"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/trace"
export "go.opentelemetry.io/otel/sdk/export/trace"
@@ -144,7 +144,7 @@ func (p *TracerProvider) UnregisterSpanProcessor(s SpanProcessor) {
}
if stopOnce != nil {
stopOnce.state.Do(func() {
global.Handle(s.Shutdown(context.Background()))
otel.Handle(s.Shutdown(context.Background()))
})
}
if len(new) > 1 {
@@ -192,7 +192,7 @@ func (p *TracerProvider) Shutdown(ctx context.Context) error {
for _, sps := range spss {
sps.state.Do(func() {
global.Handle(sps.sp.Shutdown(ctx))
otel.Handle(sps.sp.Shutdown(ctx))
})
}
return nil