File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -10,9 +10,7 @@ import (
1010 "log"
1111 "os"
1212
13- "go.opentelemetry.io/otel"
1413 apilog "go.opentelemetry.io/otel/log"
15- "go.opentelemetry.io/otel/log/global"
1614 nooplog "go.opentelemetry.io/otel/log/noop"
1715 "go.opentelemetry.io/otel/metric"
1816 noopmetric "go.opentelemetry.io/otel/metric/noop"
@@ -89,14 +87,22 @@ func init() {
8987 log .Fatal (err )
9088 }
9189
92- // Set the global providers.
93- otel .SetTracerProvider (s .TracerProvider ())
94- otel .SetMeterProvider (s .MeterProvider ())
95- global .SetLoggerProvider (s .LoggerProvider ())
9690 sdk = & s
9791}
9892
99- // Shutdown calls the shutdown function of the global SDK instantiated if
93+ // Global returns the globally configured SDK only instantiated
94+ // through the use of the `OTEL_EXPERIMENTAL_CONFIG_FILE“ environment
95+ // variable.
96+ func Global () SDK {
97+ if sdk != nil {
98+ return * sdk
99+ }
100+ return noopSDK
101+ }
102+
103+ // Shutdown calls the `Shutdown` function of the globally configured SDK only instantiated
104+ // through the use of the `OTEL_EXPERIMENTAL_CONFIG_FILE“ environment
105+ // variable.
100106func Shutdown (ctx context.Context ) {
101107 if sdk == nil {
102108 return
You can’t perform that action at this time.
0 commit comments