Files
klz-cables.com/.pnpm-store/v10/files/4f/ec75a46b717be11a31d78f2330a17b6870251a45af17d43021e685454bce124e59706a06745ae9b4823386c84821f230dc667ffd3149cc54c6250093d3fe80
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

40 lines
1.4 KiB
Plaintext

import { isWrapped } from '@opentelemetry/instrumentation';
import { getClient, isEnabled, hasSpansEnabled, consoleSandbox, getGlobalScope } from '@sentry/core';
import { createMissingInstrumentationContext } from './createMissingInstrumentationContext.js';
import { isCjs } from './detection.js';
/**
* Checks and warns if a framework isn't wrapped by opentelemetry.
*/
function ensureIsWrapped(
maybeWrappedFunction,
name,
) {
const clientOptions = getClient()?.getOptions();
if (
!clientOptions?.disableInstrumentationWarnings &&
!isWrapped(maybeWrappedFunction) &&
isEnabled() &&
hasSpansEnabled(clientOptions)
) {
consoleSandbox(() => {
if (isCjs()) {
// eslint-disable-next-line no-console
console.warn(
`[Sentry] ${name} is not instrumented. This is likely because you required/imported ${name} before calling \`Sentry.init()\`.`,
);
} else {
// eslint-disable-next-line no-console
console.warn(
`[Sentry] ${name} is not instrumented. Please make sure to initialize Sentry in a separate file that you \`--import\` when running node, see: https://docs.sentry.io/platforms/javascript/guides/${name}/install/esm/.`,
);
}
});
getGlobalScope().setContext('missing_instrumentation', createMissingInstrumentationContext(name));
}
}
export { ensureIsWrapped };
//# sourceMappingURL=ensureIsWrapped.js.map