@sentry/core
Version:
Base implementation for all Sentry JavaScript SDKs
18 lines (17 loc) • 1.09 kB
JavaScript
import { consoleSandbox } from "./debug-logger.js";
// src/utils/warnAboutIgnoredTransactionOptions.ts
/**
* Warns about `beforeSendTransaction` and `ignoreTransactions` being ignored because span streaming is enabled.
*
* Both options are tied to the transaction event that span streaming no longer produces, so they silently
* stop taking effect when users upgrade. Since that's easy to miss, this warning bypasses the `debug` logger
* (which is opt-in and stripped from non-debug bundles) and writes to the console directly.
*/
function maybeWarnAboutIgnoredTransactionOptions(options) {
if (options.traceLifecycle !== "stream" || !(options.beforeSendTransaction || options.ignoreTransactions?.length)) return;
consoleSandbox(() => {
console.warn("[Sentry] `beforeSendTransaction` and `ignoreTransactions` are ignored with `traceLifecycle: 'stream'` (enabled by default). Use `beforeSendSpan` and `ignoreSpans` instead, or set `traceLifecycle: 'static'`.");
});
}
export { maybeWarnAboutIgnoredTransactionOptions };
//# sourceMappingURL=warnAboutIgnoredTransactionOptions.js.map