Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove otel bsp delay workaround #940

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading