1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2024-12-10 09:50:58 +02:00

Wait for batcher to push changes

This commit is contained in:
Stefan Prisca 2020-05-20 10:38:34 +02:00
parent 1f16b8a573
commit e1b144e775

View File

@ -66,11 +66,14 @@ func main() {
// Then use the OpenTelemetry tracing library, like we normally would.
ctx, span := tracer.Start(context.Background(), "CollectorExporter-Example")
defer span.End()
for i := 0; i < 10; i++ {
_, iSpan := tracer.Start(ctx, fmt.Sprintf("Sample-%d", i))
<-time.After(time.Second)
iSpan.End()
}
span.End()
// Wait 1 second before ending
<-time.After(time.Second)
}