1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2024-12-24 20:14:40 +02:00

Add tracer option argument to global Tracer function (#1902)

* Add tracer opt arg to global Tracer func

* Update PR number
This commit is contained in:
Tyler Yahn 2021-05-13 21:43:19 +00:00 committed by GitHub
parent 035fc650a2
commit 6324adaa66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -43,6 +43,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- Unembed `SpanContext` in `Link`. (#1877)
- Semantic conventions are now generated from the specification YAML. (#1891)
- Spans created by the global `Tracer` obtained from `go.opentelemetry.io/otel`, prior to a functioning `TracerProvider` being set, now propagate the span context from their parent if one exists. (#1901)
- The `"go.opentelemetry.io/otel".Tracer` function now accepts tracer options. (#1902)
- Move the `go.opentelemetry.io/otel/unit` package to `go.opentelemetry.io/otel/metric/unit`. (#1903)
### Deprecated

View File

@ -22,9 +22,9 @@ import (
// Tracer creates a named tracer that implements Tracer interface.
// If the name is an empty string then provider uses default name.
//
// This is short for GetTracerProvider().Tracer(name)
func Tracer(name string) trace.Tracer {
return GetTracerProvider().Tracer(name)
// This is short for GetTracerProvider().Tracer(name, opts...)
func Tracer(name string, opts ...trace.TracerOption) trace.Tracer {
return GetTracerProvider().Tracer(name, opts...)
}
// GetTracerProvider returns the registered global trace provider.