Skip to content
Merged
Changes from 2 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
14 changes: 14 additions & 0 deletions packages/node/src/sdk/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,9 @@ export function validateOpenTelemetrySetup(): void {
}
}

const FALSY_ENV_VALUES = new Set(['0', 'false', 'no']);
const TRUTHY_ENV_VALUES = new Set(['1', 'true', 'yes']);

function getClientOptions(
options: NodeOptions,
getDefaultIntegrationsImpl: (options: Options) => Integration[],
Expand All @@ -221,6 +224,17 @@ function getClientOptions(
? true
: options.autoSessionTracking;

if (options.spotlight == null && process.env.SENTRY_SPOTLIGHT) {
const spotlightEnv = process.env.SENTRY_SPOTLIGHT.toLowerCase();
if (FALSY_ENV_VALUES.has(spotlightEnv)) {
options.spotlight = false;
} else if (TRUTHY_ENV_VALUES.has(spotlightEnv)) {
options.spotlight = true;
} else {
options.spotlight = spotlightEnv;
}
}

const tracesSampleRate = getTracesSampleRate(options.tracesSampleRate);

const baseOptions = dropUndefinedKeys({
Expand Down
Loading