@sentry/node
Version:
Sentry Node SDK using OpenTelemetry for performance instrumentation
18 lines (17 loc) • 810 B
JavaScript
import { envToBool } from "@sentry/core";
// src/utils/spotlight.ts
/**
* Parse the spotlight option with proper precedence:
* - `false` or explicit string from options: use as-is
* - `true`: enable spotlight, but prefer a custom URL from the env var if set
* - `undefined`: defer entirely to the env var (bool or URL)
*/
function getSpotlightConfig(optionsSpotlight) {
if (optionsSpotlight === false) return false;
if (typeof optionsSpotlight === "string") return optionsSpotlight;
const envBool = envToBool(process.env.SENTRY_SPOTLIGHT, { strict: true });
const envUrl = envBool === null && process.env.SENTRY_SPOTLIGHT ? process.env.SENTRY_SPOTLIGHT : void 0;
return optionsSpotlight === true ? envUrl ?? true : envBool ?? envUrl;
}
export { getSpotlightConfig };
//# sourceMappingURL=spotlight.js.map