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

fix: set BSP interval to 500ms #509

Merged
merged 1 commit into from
Jul 15, 2022
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: 14 additions & 1 deletion src/tracing/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,21 @@ const SpanExporterMap: Record<string, SpanExporterFactory> = {
'otlp-grpc': otlpSpanExporterFactory,
};

// 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 (process.env.OTEL_BSP_SCHEDULE_DELAY !== undefined) {
return undefined;
}

return { scheduledDelayMillis: 500 };
}

export function defaultSpanProcessorFactory(options: Options): SpanProcessor {
return new SplunkBatchSpanProcessor(options.spanExporterFactory(options));
return new SplunkBatchSpanProcessor(
options.spanExporterFactory(options),
getBatchSpanProcessorConfig()
);
}

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