@@ -315,8 +315,9 @@ describe('sentryCloudflareAutoInstrumentPlugin', () => {
315315 expect ( result . code ) . toBe (
316316 [
317317 "import * as __SENTRY__ from '@sentry/cloudflare';" ,
318+ 'const __SENTRY_OPTIONS__ = (env) => { const opts = (() => undefined)(env); return { ...opts, rpcTracePropagationBindings: ["MY_AGENT", ...(opts?.rpcTracePropagationBindings ?? [])] }; };' ,
318319 "import { MyAgent } from './agent';" ,
319- 'const __SENTRY_WRAPPED_MyAgent__ = __SENTRY__._INTERNAL_wrapUnlessInstrumented(__SENTRY__.instrumentAgentWithSentry, () => undefined , MyAgent);' ,
320+ 'const __SENTRY_WRAPPED_MyAgent__ = __SENTRY__._INTERNAL_wrapUnlessInstrumented(__SENTRY__.instrumentAgentWithSentry, __SENTRY_OPTIONS__ , MyAgent);' ,
320321 'export { __SENTRY_WRAPPED_MyAgent__ as MyAgent };' ,
321322 ] . join ( '\n' ) ,
322323 ) ;
@@ -332,8 +333,9 @@ describe('sentryCloudflareAutoInstrumentPlugin', () => {
332333 expect ( result . code ) . toBe (
333334 [
334335 "import * as __SENTRY__ from '@sentry/cloudflare';" ,
336+ 'const __SENTRY_OPTIONS__ = (env) => { const opts = (() => undefined)(env); return { ...opts, rpcTracePropagationBindings: ["MY_AGENT", ...(opts?.rpcTracePropagationBindings ?? [])] }; };' ,
335337 "import { MyAgent as __SENTRY_REEXPORT_MyAgent__ } from './agent';" ,
336- 'const __SENTRY_WRAPPED_MyAgent__ = __SENTRY__._INTERNAL_wrapUnlessInstrumented(__SENTRY__.instrumentAgentWithSentry, () => undefined , __SENTRY_REEXPORT_MyAgent__);' ,
338+ 'const __SENTRY_WRAPPED_MyAgent__ = __SENTRY__._INTERNAL_wrapUnlessInstrumented(__SENTRY__.instrumentAgentWithSentry, __SENTRY_OPTIONS__ , __SENTRY_REEXPORT_MyAgent__);' ,
337339 'export { __SENTRY_WRAPPED_MyAgent__ as MyAgent };' ,
338340 ] . join ( '\n' ) ,
339341 ) ;
@@ -352,8 +354,9 @@ describe('sentryCloudflareAutoInstrumentPlugin', () => {
352354 expect ( result . code ) . toBe (
353355 [
354356 "import * as __SENTRY__ from '@sentry/cloudflare';" ,
357+ 'const __SENTRY_OPTIONS__ = (env) => { const opts = (() => undefined)(env); return { ...opts, rpcTracePropagationBindings: ["MY_AGENT", ...(opts?.rpcTracePropagationBindings ?? [])] }; };' ,
355358 "import { MyAgent as __SENTRY_REEXPORT_MyAgent__ } from './do';" ,
356- 'const __SENTRY_WRAPPED_MyAgent__ = __SENTRY__._INTERNAL_wrapUnlessInstrumented(__SENTRY__.instrumentDurableObjectWithSentry, () => undefined , __SENTRY_REEXPORT_MyAgent__);' ,
359+ 'const __SENTRY_WRAPPED_MyAgent__ = __SENTRY__._INTERNAL_wrapUnlessInstrumented(__SENTRY__.instrumentDurableObjectWithSentry, __SENTRY_OPTIONS__ , __SENTRY_REEXPORT_MyAgent__);' ,
357360 'export { __SENTRY_WRAPPED_MyAgent__ as MyAgent };' ,
358361 ] . join ( '\n' ) ,
359362 ) ;
0 commit comments