Skip to content

Commit

Permalink
docs - update BatchSpanProcessor example config (#2045)
Browse files Browse the repository at this point in the history
Update config options to those introduced in 9f965b0

Signed-off-by: Neil Fordyce <neil.fordyce@skyscanner.net>
  • Loading branch information
neilfordyce authored Mar 27, 2021
1 parent 9148387 commit ed92829
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions packages/opentelemetry-exporter-collector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,14 @@ const collectorOptions = {
const provider = new WebTracerProvider();
const exporter = new CollectorTraceExporter(collectorOptions);
provider.addSpanProcessor(new BatchSpanProcessor(exporter, {
// send spans as soon as we have this many
bufferSize: 10,
// send spans if we have buffered spans older than this
bufferTimeout: 500,
// The maximum queue size. After the size is reached spans are dropped.
maxQueueSize: 100,
// The maximum batch size of every export. It must be smaller or equal to maxQueueSize.
maxExportBatchSize: 10,
// The interval between two consecutive exports
scheduledDelayMillis: 500,
// How long the export can run before it is cancelled
exportTimeoutMillis: 30000,
}));

provider.register();
Expand Down Expand Up @@ -85,10 +89,10 @@ const collectorOptions = {
const provider = new BasicTracerProvider();
const exporter = new CollectorTraceExporter(collectorOptions);
provider.addSpanProcessor(new BatchSpanProcessor(exporter, {
// send spans as soon as we have this many
bufferSize: 1000,
// send spans if we have buffered spans older than this
bufferTimeout: 30000,
// The maximum queue size. After the size is reached spans are dropped.
maxQueueSize: 1000,
// The interval between two consecutive exports
scheduledDelayMillis: 30000,
}));

provider.register();
Expand Down

0 comments on commit ed92829

Please sign in to comment.