File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/init Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -166,17 +166,17 @@ private static BatchSpanProcessor createExporter(Configuration configuration) {
166166 BatchSpanProcessorBuilder builder = BatchSpanProcessor .builder (currExporter );
167167
168168 String delayMillisStr = System .getenv ("APPLICATIONINSIGHTS_PREVIEW_BSP_SCHEDULE_DELAY" );
169+ int delayMillis ;
169170 if (delayMillisStr != null ) {
170- // experimenting with flushing at small interval instead of using batch size 1
171- // (suspect this may be better performance on small containers)
172- builder .setScheduleDelay (Duration .ofMillis (Integer .parseInt (delayMillisStr )));
171+ delayMillis = Integer .parseInt (delayMillisStr );
173172 } else {
174- // using batch size 1 because need to convert to SpanData as soon as possible to grab data for
175- // live metrics. the real batching is done at a lower level
176- builder .setMaxExportBatchSize (1 );
173+ // using small interval because need to convert to SpanData as soon as possible to grab data
174+ // for live metrics. the real batching is done at a lower level
175+ // (not using batch size 1 because that seems to cause poor performance on small containers)
176+ delayMillis = 100 ;
177177 }
178178
179- return builder .build ();
179+ return builder .setScheduleDelay ( Duration . ofMillis ( delayMillis )). build ();
180180 }
181181
182182 private static class BackCompatHttpUrlProcessor implements SpanExporter {
You can’t perform that action at this time.
0 commit comments