Skip to content

Commit

Permalink
Tweak BatchSpanProcessor paramters to try and limit dropped spans
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-richardson committed Nov 27, 2024
1 parent 2fbb86e commit b748590
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import javax.annotation.Nullable;
import javax.servlet.http.HttpServletRequest;
import java.time.Duration;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
Expand Down Expand Up @@ -94,6 +95,9 @@ private SpanProcessor buildGrpcSpanProcessor(Map<String, String> headers, String
.build();

return BatchSpanProcessor.builder(spanExporter)
.setMaxQueueSize(32768) // Default is 2048. Increasing it to limit dropped spans.
.setScheduleDelay(Duration.ofSeconds(5)) // Default is 5s. This is another lever we can tweak.
.setMaxExportBatchSize(8192) // Default is 512. Increasing it to limit dropped spans.
.setMeterProvider(meterProvider)
.build();
}
Expand Down

0 comments on commit b748590

Please sign in to comment.