1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-03-03 14:52:56 +02:00

Merge pull request #807 from dcwangmit01/fix-otlp-example

Fixed OTLP example's accidental early close of exporter
This commit is contained in:
Tyler Yahn 2020-06-09 14:04:38 -07:00 committed by GitHub
commit c58680a772
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -63,7 +63,7 @@ func initProvider() (*otlp.Exporter, *push.Controller) {
func main() {
exp, pusher := initProvider()
defer handleErr(exp.Stop(), "Failed to stop exporter")
defer func() { handleErr(exp.Stop(), "Failed to stop exporter") }()
defer pusher.Stop() // pushes any last exports to the receiver
tracer := global.Tracer("mage-sense")