You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-11-29 23:07:45 +02:00
add shorter version for global providers (#538)
This commit is contained in:
committed by
GitHub
parent
9674c81cb7
commit
85751428a3
@@ -58,14 +58,14 @@ func main() {
|
||||
|
||||
ctx := context.Background()
|
||||
|
||||
tr := global.TraceProvider().Tracer("component-main")
|
||||
tr := global.Tracer("component-main")
|
||||
ctx, span := tr.Start(ctx, "foo")
|
||||
bar(ctx)
|
||||
span.End()
|
||||
}
|
||||
|
||||
func bar(ctx context.Context) {
|
||||
tr := global.TraceProvider().Tracer("component-bar")
|
||||
tr := global.Tracer("component-bar")
|
||||
_, span := tr.Start(ctx, "bar")
|
||||
defer span.End()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user