File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,6 @@ import (
35
35
" log"
36
36
37
37
" go.opentelemetry.io/otel/api/global"
38
- apitrace " go.opentelemetry.io/otel/api/trace"
39
38
" go.opentelemetry.io/otel/exporter/trace/stdout"
40
39
sdktrace " go.opentelemetry.io/otel/sdk/trace"
41
40
)
@@ -55,12 +54,13 @@ func initTracer() {
55
54
56
55
func main () {
57
56
initTracer ()
57
+ tracer := global.TraceProvider ().Tracer (" ex.com/basic" )
58
58
59
- apitrace. GlobalTracer () .WithSpan (context.Background (), " foo" ,
59
+ tracer .WithSpan (context.Background (), " foo" ,
60
60
func (ctx context.Context ) error {
61
- apitrace. GlobalTracer () .WithSpan (ctx, " bar" ,
61
+ tracer .WithSpan (ctx, " bar" ,
62
62
func (ctx context.Context ) error {
63
- apitrace. GlobalTracer () .WithSpan (ctx, " baz" ,
63
+ tracer .WithSpan (ctx, " baz" ,
64
64
func (ctx context.Context ) error {
65
65
return nil
66
66
},
You can’t perform that action at this time.
0 commit comments