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:
parent
1f16b8a573
commit
e1b144e775
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user