Skip to content

Commit

Permalink
[tracegen] Enable BlockOnQueueFull in OTel SDK to avoid dropped spans (
Browse files Browse the repository at this point in the history
…#4578)

## Which problem is this PR solving?
[tracegen] Enable BlockOnQueueFull in OTel SDK to make spans not dropped
in spikes

## Short description of the changes
Call `WithBlocking()` from OTel SDK to enable `BlockOnQueueFull=true` to
make spans not dropped when the queue is full.

Tested locally:
- Before the change: Spans in tracegen were dropped when generated to
jaeger-collector, even with just 1m duration and 1 worker.
- With the change: Spans in tracegen were not dropped even with 1h
duration and 10 workers.

![Screenshot 2023-07-12
005149](https://github.com/jaegertracing/jaeger/assets/75315486/cff1e8c7-7a5a-451f-97f2-186ca4f06251)

---------

Signed-off-by: Ha Anh Vu <[email protected]>
  • Loading branch information
haanhvu authored Jul 11, 2023
1 parent 6e40173 commit e40a3e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/tracegen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func createTracers(cfg *tracegen.Config, logger *zap.Logger) ([]trace.Tracer, fu
logger.Sugar().Infof("using %s trace exporter for service %s", cfg.TraceExporter, svc)

tp := sdktrace.NewTracerProvider(
sdktrace.WithBatcher(exp),
sdktrace.WithBatcher(exp, sdktrace.WithBlocking()),
sdktrace.WithResource(resource.NewWithAttributes(
semconv.SchemaURL,
semconv.ServiceNameKey.String(svc),
Expand Down

0 comments on commit e40a3e5

Please sign in to comment.