Skip to content

Commit

Permalink
remove otel bsp delay workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
seemk committed Aug 29, 2024
1 parent bf06eef commit 9f2833b
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions src/tracing/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,27 +317,14 @@ export function consoleSpanExporterFactory(): SpanExporter {
return new ConsoleSpanExporter();
}

// Temporary workaround until https://github.com/open-telemetry/opentelemetry-js/issues/3094 is resolved
function getBatchSpanProcessorConfig() {
// OTel uses its own parsed environment, we can just use the default env if the BSP delay is unset.
if (getNonEmptyEnvVar('OTEL_BSP_SCHEDULE_DELAY') !== undefined) {
return undefined;
}

return { scheduledDelayMillis: 500 };
}

export function defaultSpanProcessorFactory(options: Options): SpanProcessor[] {
let exporters = options.spanExporterFactory(options);

if (!Array.isArray(exporters)) {
exporters = [exporters];
}

return exporters.map(
(exporter) =>
new SplunkBatchSpanProcessor(exporter, getBatchSpanProcessorConfig())
);
return exporters.map((exporter) => new SplunkBatchSpanProcessor(exporter));
}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
Expand Down

0 comments on commit 9f2833b

Please sign in to comment.