1
0
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:
Gustavo Silva Paiva
2020-03-11 12:23:32 -03:00
committed by GitHub
parent 9674c81cb7
commit 85751428a3
16 changed files with 49 additions and 29 deletions

View File

@@ -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()