MCPcopy Create free account
hub / github.com/getsentry/sentry-javascript / ensureInstrumented

Function ensureInstrumented

packages/cloudflare/src/instrument.ts:70–84  ·  view source on GitHub ↗
(original: T, instrumentFn: (original: T) => T, noMark?: boolean)

Source from the content-addressed store, hash-verified

68 * @param noMark - If true, skips storing the original→instrumented mapping.
69 */
70export function ensureInstrumented<T>(original: T, instrumentFn: (original: T) => T, noMark?: boolean): T {
71 const existing = getInstrumented(original);
72
73 if (existing) {
74 return existing;
75 }
76
77 const instrumented = instrumentFn(original);
78
79 if (!noMark) {
80 markAsInstrumented(original, instrumented);
81 }
82
83 return instrumented;
84}

Callers 9

wrapMethodWithSentryFunction · 0.90
constructFunction · 0.90
instrumentD1Function · 0.90

Calls 2

getInstrumentedFunction · 0.85
markAsInstrumentedFunction · 0.70

Tested by

no test coverage detected