From f6f458e1554dc5221c133155ae8acf64d5054663 Mon Sep 17 00:00:00 2001 From: Guangwen Feng Date: Thu, 7 Jan 2021 02:17:36 +0800 Subject: [PATCH 1/2] Fix golint issue caused by typo in trace.go (#1436) Signed-off-by: Guangwen Feng Co-authored-by: Tyler Yahn --- trace.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trace.go b/trace.go index 281592e94f1..bd6b6818cf9 100644 --- a/trace.go +++ b/trace.go @@ -27,7 +27,7 @@ func Tracer(name string) trace.Tracer { return GetTracerProvider().Tracer(name) } -// TracerProvider returns the registered global trace provider. +// GetTracerProvider returns the registered global trace provider. // If none is registered then an instance of NoopTracerProvider is returned. // // Use the trace provider to create a named tracer. E.g. From db06c8d1cb3c1646098295f6007f6d6128a382c7 Mon Sep 17 00:00:00 2001 From: Tyler Yahn Date: Wed, 6 Jan 2021 10:50:58 -0800 Subject: [PATCH 2/2] Flush metric events before shutdown in collector example (#1438) Fixes #1437 --- example/otel-collector/main.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/example/otel-collector/main.go b/example/otel-collector/main.go index 11c763f0ce0..e9bcba7fdd5 100644 --- a/example/otel-collector/main.go +++ b/example/otel-collector/main.go @@ -88,9 +88,12 @@ func initProvider() func() { pusher.Start() return func() { - handleErr(tracerProvider.Shutdown(ctx), "failed to shutdown provider") + // Shutdown will flush any remaining spans. + handleErr(tracerProvider.Shutdown(ctx), "failed to shutdown TracerProvider") + + // Push any last metric events to the exporter. + pusher.Stop() handleErr(exp.Shutdown(ctx), "failed to stop exporter") - pusher.Stop() // pushes any last exports to the receiver } }