1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-07-09 00:45:53 +02:00

Add a Shutdown method to sdk TraceProvider (#1227)

* Add a Shutdown method to api TraceProvider

- sdktraceprovider shutdown span processors
- In examples, replace processosr shutdown with
  traceprovider's shutdown

Signed-off-by: Hui Kang <kangh@us.ibm.com>

* remove shutdown in the api provider interface

* Add context in parameter and return error

* handle error in shutdown

* Update CHANGELOG.md

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
This commit is contained in:
Hui Kang
2020-10-26 12:20:49 -04:00
committed by GitHub
parent 230bdd10f0
commit d75ccbb378
7 changed files with 72 additions and 7 deletions

View File

@ -46,8 +46,8 @@ func main() {
}
bsp := sdktrace.NewBatchSpanProcessor(exporter)
defer bsp.Shutdown()
tp := sdktrace.NewTracerProvider(sdktrace.WithSpanProcessor(bsp))
defer func() { _ = tp.Shutdown(context.Background()) }()
pusher := push.New(
basic.New(
simple.NewWithExactDistribution(),