Skip to content

Commit 30795ef

Browse files
Dan Millerlizthegrey
Dan Miller
authored andcommitted
readme: fix quick start example (#374)
Fixes #257, #305
1 parent b2c0fc8 commit 30795ef

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import (
3535
"log"
3636

3737
"go.opentelemetry.io/otel/api/global"
38-
apitrace "go.opentelemetry.io/otel/api/trace"
3938
"go.opentelemetry.io/otel/exporter/trace/stdout"
4039
sdktrace "go.opentelemetry.io/otel/sdk/trace"
4140
)
@@ -55,12 +54,13 @@ func initTracer() {
5554

5655
func main() {
5756
initTracer()
57+
tracer := global.TraceProvider().Tracer("ex.com/basic")
5858

59-
apitrace.GlobalTracer().WithSpan(context.Background(), "foo",
59+
tracer.WithSpan(context.Background(), "foo",
6060
func(ctx context.Context) error {
61-
apitrace.GlobalTracer().WithSpan(ctx, "bar",
61+
tracer.WithSpan(ctx, "bar",
6262
func(ctx context.Context) error {
63-
apitrace.GlobalTracer().WithSpan(ctx, "baz",
63+
tracer.WithSpan(ctx, "baz",
6464
func(ctx context.Context) error {
6565
return nil
6666
},

0 commit comments

Comments
 (0)