Skip to content

Commit

Permalink
Update zipkin names
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlias committed Jul 11, 2024
1 parent cb332cd commit d6b9b0f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions example/zipkin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import (
"go.opentelemetry.io/otel/trace"
)

const name = "go.opentelemetry.io/otel/example/zipkin"

var logger = log.New(os.Stderr, "zipkin-example", log.Ldate|log.Ltime|log.Llongfile)

// initTracer creates a new trace provider instance and registers it as global trace provider.
Expand Down Expand Up @@ -69,7 +71,7 @@ func main() {
}
}()

tr := otel.GetTracerProvider().Tracer("component-main")
tr := otel.GetTracerProvider().Tracer(name)
ctx, span := tr.Start(ctx, "foo", trace.WithSpanKind(trace.SpanKindServer))
<-time.After(6 * time.Millisecond)
bar(ctx)
Expand All @@ -78,7 +80,7 @@ func main() {
}

func bar(ctx context.Context) {
tr := otel.GetTracerProvider().Tracer("component-bar")
tr := trace.SpanFromContext(ctx).TracerProvider().Tracer(name)
_, span := tr.Start(ctx, "bar")
<-time.After(6 * time.Millisecond)
span.End()
Expand Down

0 comments on commit d6b9b0f

Please sign in to comment.