Skip to content

Commit

Permalink
feat: adjust batching defaults and expose their configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
InesNi committed Jan 24, 2024
1 parent 4985639 commit 3022035
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,16 @@ class OTelTraceConfig {
this.exporterOpts
);

this.processorOpts = {
scheduledDelayMillis: this.config.scheduledDelayMillis || 5000,
maxExportBatchSize: this.config.maxExportBatchSize || 1000,
maxQueueSize: this.config.maxQueueSize || 2000
};
const Processor = this.config.smartSampling
? OutlierDetectionBatchSpanProcessor
: BatchSpanProcessor;

this.tracerProvider.addSpanProcessor(
new Processor(this.exporter, {
scheduledDelayMillis: 1000
})
);
this.tracerProvider.addSpanProcessor(new Processor(this.exporter));
this.tracerProvider.register();
}

Expand Down Expand Up @@ -160,6 +161,8 @@ class OTelTraceBase {
await new Promise((resolve) => setTimeout(resolve, 500));
}
debug('Pending Playwright traces done');
debug('Waiting for flush period to complete');
await new Promise((resolve) => setTimeout(resolve, 5000));
}
}

Expand Down

0 comments on commit 3022035

Please sign in to comment.