@sentry/cloudflare 11.12.0 → 11.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (618) hide show
  1. package/build/cjs/dev/_virtual/_rolldown/runtime.js +22 -0
  2. package/build/cjs/dev/baseSdk.js +98 -103
  3. package/build/cjs/dev/baseSdk.js.map +1 -1
  4. package/build/cjs/dev/client.js +218 -237
  5. package/build/cjs/dev/client.js.map +1 -1
  6. package/build/cjs/dev/clientCache.js +8 -8
  7. package/build/cjs/dev/clientCache.js.map +1 -1
  8. package/build/cjs/dev/debug-build.js +9 -5
  9. package/build/cjs/dev/debug-build.js.map +1 -1
  10. package/build/cjs/dev/defineCloudflareOptions.js +5 -8
  11. package/build/cjs/dev/defineCloudflareOptions.js.map +1 -1
  12. package/build/cjs/dev/durableobject.js +287 -176
  13. package/build/cjs/dev/durableobject.js.map +1 -1
  14. package/build/cjs/dev/flush.js +104 -77
  15. package/build/cjs/dev/flush.js.map +1 -1
  16. package/build/cjs/dev/index.js +181 -182
  17. package/build/cjs/dev/instrument.js +53 -39
  18. package/build/cjs/dev/instrument.js.map +1 -1
  19. package/build/cjs/dev/instrumentations/agents/index.js +34 -13
  20. package/build/cjs/dev/instrumentations/agents/index.js.map +1 -1
  21. package/build/cjs/dev/instrumentations/agents/instrumentAgentCallableRpc.js +46 -49
  22. package/build/cjs/dev/instrumentations/agents/instrumentAgentCallableRpc.js.map +1 -1
  23. package/build/cjs/dev/instrumentations/agents/instrumentAgentRequestConversation.js +23 -16
  24. package/build/cjs/dev/instrumentations/agents/instrumentAgentRequestConversation.js.map +1 -1
  25. package/build/cjs/dev/instrumentations/agents/instrumentChatAgentConversation.js +36 -28
  26. package/build/cjs/dev/instrumentations/agents/instrumentChatAgentConversation.js.map +1 -1
  27. package/build/cjs/dev/instrumentations/agents/types.js +103 -58
  28. package/build/cjs/dev/instrumentations/agents/types.js.map +1 -1
  29. package/build/cjs/dev/instrumentations/instrumentDurableObjectHandlers.js +87 -118
  30. package/build/cjs/dev/instrumentations/instrumentDurableObjectHandlers.js.map +1 -1
  31. package/build/cjs/dev/instrumentations/instrumentDurableObjectNamespace.js +46 -44
  32. package/build/cjs/dev/instrumentations/instrumentDurableObjectNamespace.js.map +1 -1
  33. package/build/cjs/dev/instrumentations/instrumentDurableObjectStorage.js +70 -71
  34. package/build/cjs/dev/instrumentations/instrumentDurableObjectStorage.js.map +1 -1
  35. package/build/cjs/dev/instrumentations/instrumentDurableObjectSyncKvStorage.js +31 -39
  36. package/build/cjs/dev/instrumentations/instrumentDurableObjectSyncKvStorage.js.map +1 -1
  37. package/build/cjs/dev/instrumentations/instrumentSqlStorage.js +50 -52
  38. package/build/cjs/dev/instrumentations/instrumentSqlStorage.js.map +1 -1
  39. package/build/cjs/dev/instrumentations/instrumentWorkerEntrypoint.js +136 -123
  40. package/build/cjs/dev/instrumentations/instrumentWorkerEntrypoint.js.map +1 -1
  41. package/build/cjs/dev/instrumentations/worker/instrumentD1.js +131 -146
  42. package/build/cjs/dev/instrumentations/worker/instrumentD1.js.map +1 -1
  43. package/build/cjs/dev/instrumentations/worker/instrumentEmail.js +63 -61
  44. package/build/cjs/dev/instrumentations/worker/instrumentEmail.js.map +1 -1
  45. package/build/cjs/dev/instrumentations/worker/instrumentEnv.js +83 -88
  46. package/build/cjs/dev/instrumentations/worker/instrumentEnv.js.map +1 -1
  47. package/build/cjs/dev/instrumentations/worker/instrumentFetch.js +41 -48
  48. package/build/cjs/dev/instrumentations/worker/instrumentFetch.js.map +1 -1
  49. package/build/cjs/dev/instrumentations/worker/instrumentFetcher.js +25 -21
  50. package/build/cjs/dev/instrumentations/worker/instrumentFetcher.js.map +1 -1
  51. package/build/cjs/dev/instrumentations/worker/instrumentKV.js +54 -67
  52. package/build/cjs/dev/instrumentations/worker/instrumentKV.js.map +1 -1
  53. package/build/cjs/dev/instrumentations/worker/instrumentQueue.js +98 -105
  54. package/build/cjs/dev/instrumentations/worker/instrumentQueue.js.map +1 -1
  55. package/build/cjs/dev/instrumentations/worker/instrumentQueueProducer.js +88 -94
  56. package/build/cjs/dev/instrumentations/worker/instrumentQueueProducer.js.map +1 -1
  57. package/build/cjs/dev/instrumentations/worker/instrumentR2.js +128 -115
  58. package/build/cjs/dev/instrumentations/worker/instrumentR2.js.map +1 -1
  59. package/build/cjs/dev/instrumentations/worker/instrumentScheduled.js +90 -94
  60. package/build/cjs/dev/instrumentations/worker/instrumentScheduled.js.map +1 -1
  61. package/build/cjs/dev/instrumentations/worker/instrumentTail.js +100 -55
  62. package/build/cjs/dev/instrumentations/worker/instrumentTail.js.map +1 -1
  63. package/build/cjs/dev/integrations/cronTriggers.js +130 -85
  64. package/build/cjs/dev/integrations/cronTriggers.js.map +1 -1
  65. package/build/cjs/dev/integrations/fetch.js +9 -9
  66. package/build/cjs/dev/integrations/fetch.js.map +1 -1
  67. package/build/cjs/dev/integrations/httpServer.js +41 -22
  68. package/build/cjs/dev/integrations/httpServer.js.map +1 -1
  69. package/build/cjs/dev/integrations/spotlight.js +52 -55
  70. package/build/cjs/dev/integrations/spotlight.js.map +1 -1
  71. package/build/cjs/dev/opentelemetry/tracer.js +10 -8
  72. package/build/cjs/dev/opentelemetry/tracer.js.map +1 -1
  73. package/build/cjs/dev/options.js +56 -39
  74. package/build/cjs/dev/options.js.map +1 -1
  75. package/build/cjs/dev/orchestrion-deferred-channels.js +45 -29
  76. package/build/cjs/dev/orchestrion-deferred-channels.js.map +1 -1
  77. package/build/cjs/dev/orchestrion-diagnostics-channel.js +97 -72
  78. package/build/cjs/dev/orchestrion-diagnostics-channel.js.map +1 -1
  79. package/build/cjs/dev/pages-plugin.js +20 -21
  80. package/build/cjs/dev/pages-plugin.js.map +1 -1
  81. package/build/cjs/dev/request.js +16 -10
  82. package/build/cjs/dev/request.js.map +1 -1
  83. package/build/cjs/dev/scope-utils.js +12 -12
  84. package/build/cjs/dev/scope-utils.js.map +1 -1
  85. package/build/cjs/dev/sdk.js +24 -15
  86. package/build/cjs/dev/sdk.js.map +1 -1
  87. package/build/cjs/dev/transport.js +93 -86
  88. package/build/cjs/dev/transport.js.map +1 -1
  89. package/build/cjs/dev/utils/asyncContextStrategy.js +10 -10
  90. package/build/cjs/dev/utils/asyncContextStrategy.js.map +1 -1
  91. package/build/cjs/dev/utils/bindingPropagation.js +17 -11
  92. package/build/cjs/dev/utils/bindingPropagation.js.map +1 -1
  93. package/build/cjs/dev/utils/cloudflareTrace.js +34 -0
  94. package/build/cjs/dev/utils/cloudflareTrace.js.map +1 -0
  95. package/build/cjs/dev/utils/instrumentContext.js +74 -58
  96. package/build/cjs/dev/utils/instrumentContext.js.map +1 -1
  97. package/build/cjs/dev/utils/internalSqlQuery.js +38 -21
  98. package/build/cjs/dev/utils/internalSqlQuery.js.map +1 -1
  99. package/build/cjs/dev/utils/internalStorageKey.js +41 -38
  100. package/build/cjs/dev/utils/internalStorageKey.js.map +1 -1
  101. package/build/cjs/dev/utils/invocationContext.js +42 -32
  102. package/build/cjs/dev/utils/invocationContext.js.map +1 -1
  103. package/build/cjs/dev/utils/invocationScope.js +45 -21
  104. package/build/cjs/dev/utils/invocationScope.js.map +1 -1
  105. package/build/cjs/dev/utils/isBinding.js +47 -15
  106. package/build/cjs/dev/utils/isBinding.js.map +1 -1
  107. package/build/cjs/dev/utils/isCloudflareClass.js +11 -20
  108. package/build/cjs/dev/utils/isCloudflareClass.js.map +1 -1
  109. package/build/cjs/dev/utils/queueTraceMeta.js +24 -35
  110. package/build/cjs/dev/utils/queueTraceMeta.js.map +1 -1
  111. package/build/cjs/dev/utils/rpcMeta.js +37 -27
  112. package/build/cjs/dev/utils/rpcMeta.js.map +1 -1
  113. package/build/cjs/dev/utils/traceLinks.js +52 -42
  114. package/build/cjs/dev/utils/traceLinks.js.map +1 -1
  115. package/build/cjs/dev/vendor/stacktrace.js +32 -24
  116. package/build/cjs/dev/vendor/stacktrace.js.map +1 -1
  117. package/build/cjs/dev/vite/agentClass.js +105 -98
  118. package/build/cjs/dev/vite/agentClass.js.map +1 -1
  119. package/build/cjs/dev/vite/autoInstrument.js +125 -122
  120. package/build/cjs/dev/vite/autoInstrument.js.map +1 -1
  121. package/build/cjs/dev/vite/index.js +44 -21
  122. package/build/cjs/dev/vite/index.js.map +1 -1
  123. package/build/cjs/dev/vite/instrumentFile.js +37 -20
  124. package/build/cjs/dev/vite/instrumentFile.js.map +1 -1
  125. package/build/cjs/dev/vite/mastraObservability.js +19 -12
  126. package/build/cjs/dev/vite/mastraObservability.js.map +1 -1
  127. package/build/cjs/dev/vite/moduleShape.js +220 -201
  128. package/build/cjs/dev/vite/moduleShape.js.map +1 -1
  129. package/build/cjs/dev/vite/providedModulePlugin.js +62 -45
  130. package/build/cjs/dev/vite/providedModulePlugin.js.map +1 -1
  131. package/build/cjs/dev/vite/transform.js +332 -284
  132. package/build/cjs/dev/vite/transform.js.map +1 -1
  133. package/build/cjs/dev/vite/workerEntrypoint.js +66 -57
  134. package/build/cjs/dev/vite/workerEntrypoint.js.map +1 -1
  135. package/build/cjs/dev/vite/wranglerConfig.js +94 -67
  136. package/build/cjs/dev/vite/wranglerConfig.js.map +1 -1
  137. package/build/cjs/dev/withSentry.js +32 -26
  138. package/build/cjs/dev/withSentry.js.map +1 -1
  139. package/build/cjs/dev/workflows.js +164 -151
  140. package/build/cjs/dev/workflows.js.map +1 -1
  141. package/build/cjs/dev/wrapMethodWithSentry.js +148 -169
  142. package/build/cjs/dev/wrapMethodWithSentry.js.map +1 -1
  143. package/build/cjs/dev/wrapRequestHandlerWithInit.js +76 -78
  144. package/build/cjs/dev/wrapRequestHandlerWithInit.js.map +1 -1
  145. package/build/cjs/prod/_virtual/_rolldown/runtime.js +22 -0
  146. package/build/cjs/prod/baseSdk.js +94 -93
  147. package/build/cjs/prod/baseSdk.js.map +1 -1
  148. package/build/cjs/prod/client.js +218 -237
  149. package/build/cjs/prod/client.js.map +1 -1
  150. package/build/cjs/prod/clientCache.js +8 -8
  151. package/build/cjs/prod/clientCache.js.map +1 -1
  152. package/build/cjs/prod/debug-build.js +9 -5
  153. package/build/cjs/prod/debug-build.js.map +1 -1
  154. package/build/cjs/prod/defineCloudflareOptions.js +5 -8
  155. package/build/cjs/prod/defineCloudflareOptions.js.map +1 -1
  156. package/build/cjs/prod/durableobject.js +287 -176
  157. package/build/cjs/prod/durableobject.js.map +1 -1
  158. package/build/cjs/prod/flush.js +104 -77
  159. package/build/cjs/prod/flush.js.map +1 -1
  160. package/build/cjs/prod/index.js +181 -182
  161. package/build/cjs/prod/instrument.js +53 -39
  162. package/build/cjs/prod/instrument.js.map +1 -1
  163. package/build/cjs/prod/instrumentations/agents/index.js +34 -13
  164. package/build/cjs/prod/instrumentations/agents/index.js.map +1 -1
  165. package/build/cjs/prod/instrumentations/agents/instrumentAgentCallableRpc.js +46 -49
  166. package/build/cjs/prod/instrumentations/agents/instrumentAgentCallableRpc.js.map +1 -1
  167. package/build/cjs/prod/instrumentations/agents/instrumentAgentRequestConversation.js +23 -16
  168. package/build/cjs/prod/instrumentations/agents/instrumentAgentRequestConversation.js.map +1 -1
  169. package/build/cjs/prod/instrumentations/agents/instrumentChatAgentConversation.js +36 -28
  170. package/build/cjs/prod/instrumentations/agents/instrumentChatAgentConversation.js.map +1 -1
  171. package/build/cjs/prod/instrumentations/agents/types.js +103 -58
  172. package/build/cjs/prod/instrumentations/agents/types.js.map +1 -1
  173. package/build/cjs/prod/instrumentations/instrumentDurableObjectHandlers.js +87 -118
  174. package/build/cjs/prod/instrumentations/instrumentDurableObjectHandlers.js.map +1 -1
  175. package/build/cjs/prod/instrumentations/instrumentDurableObjectNamespace.js +46 -44
  176. package/build/cjs/prod/instrumentations/instrumentDurableObjectNamespace.js.map +1 -1
  177. package/build/cjs/prod/instrumentations/instrumentDurableObjectStorage.js +70 -71
  178. package/build/cjs/prod/instrumentations/instrumentDurableObjectStorage.js.map +1 -1
  179. package/build/cjs/prod/instrumentations/instrumentDurableObjectSyncKvStorage.js +31 -39
  180. package/build/cjs/prod/instrumentations/instrumentDurableObjectSyncKvStorage.js.map +1 -1
  181. package/build/cjs/prod/instrumentations/instrumentSqlStorage.js +50 -52
  182. package/build/cjs/prod/instrumentations/instrumentSqlStorage.js.map +1 -1
  183. package/build/cjs/prod/instrumentations/instrumentWorkerEntrypoint.js +136 -123
  184. package/build/cjs/prod/instrumentations/instrumentWorkerEntrypoint.js.map +1 -1
  185. package/build/cjs/prod/instrumentations/worker/instrumentD1.js +131 -146
  186. package/build/cjs/prod/instrumentations/worker/instrumentD1.js.map +1 -1
  187. package/build/cjs/prod/instrumentations/worker/instrumentEmail.js +63 -61
  188. package/build/cjs/prod/instrumentations/worker/instrumentEmail.js.map +1 -1
  189. package/build/cjs/prod/instrumentations/worker/instrumentEnv.js +83 -88
  190. package/build/cjs/prod/instrumentations/worker/instrumentEnv.js.map +1 -1
  191. package/build/cjs/prod/instrumentations/worker/instrumentFetch.js +41 -48
  192. package/build/cjs/prod/instrumentations/worker/instrumentFetch.js.map +1 -1
  193. package/build/cjs/prod/instrumentations/worker/instrumentFetcher.js +25 -21
  194. package/build/cjs/prod/instrumentations/worker/instrumentFetcher.js.map +1 -1
  195. package/build/cjs/prod/instrumentations/worker/instrumentKV.js +54 -67
  196. package/build/cjs/prod/instrumentations/worker/instrumentKV.js.map +1 -1
  197. package/build/cjs/prod/instrumentations/worker/instrumentQueue.js +98 -105
  198. package/build/cjs/prod/instrumentations/worker/instrumentQueue.js.map +1 -1
  199. package/build/cjs/prod/instrumentations/worker/instrumentQueueProducer.js +88 -94
  200. package/build/cjs/prod/instrumentations/worker/instrumentQueueProducer.js.map +1 -1
  201. package/build/cjs/prod/instrumentations/worker/instrumentR2.js +128 -115
  202. package/build/cjs/prod/instrumentations/worker/instrumentR2.js.map +1 -1
  203. package/build/cjs/prod/instrumentations/worker/instrumentScheduled.js +90 -94
  204. package/build/cjs/prod/instrumentations/worker/instrumentScheduled.js.map +1 -1
  205. package/build/cjs/prod/instrumentations/worker/instrumentTail.js +100 -55
  206. package/build/cjs/prod/instrumentations/worker/instrumentTail.js.map +1 -1
  207. package/build/cjs/prod/integrations/cronTriggers.js +130 -85
  208. package/build/cjs/prod/integrations/cronTriggers.js.map +1 -1
  209. package/build/cjs/prod/integrations/fetch.js +9 -9
  210. package/build/cjs/prod/integrations/fetch.js.map +1 -1
  211. package/build/cjs/prod/integrations/httpServer.js +41 -22
  212. package/build/cjs/prod/integrations/httpServer.js.map +1 -1
  213. package/build/cjs/prod/integrations/spotlight.js +52 -55
  214. package/build/cjs/prod/integrations/spotlight.js.map +1 -1
  215. package/build/cjs/prod/opentelemetry/tracer.js +10 -8
  216. package/build/cjs/prod/opentelemetry/tracer.js.map +1 -1
  217. package/build/cjs/prod/options.js +38 -24
  218. package/build/cjs/prod/options.js.map +1 -1
  219. package/build/cjs/prod/orchestrion-deferred-channels.js +45 -29
  220. package/build/cjs/prod/orchestrion-deferred-channels.js.map +1 -1
  221. package/build/cjs/prod/orchestrion-diagnostics-channel.js +97 -72
  222. package/build/cjs/prod/orchestrion-diagnostics-channel.js.map +1 -1
  223. package/build/cjs/prod/pages-plugin.js +20 -21
  224. package/build/cjs/prod/pages-plugin.js.map +1 -1
  225. package/build/cjs/prod/request.js +16 -10
  226. package/build/cjs/prod/request.js.map +1 -1
  227. package/build/cjs/prod/scope-utils.js +12 -12
  228. package/build/cjs/prod/scope-utils.js.map +1 -1
  229. package/build/cjs/prod/sdk.js +24 -15
  230. package/build/cjs/prod/sdk.js.map +1 -1
  231. package/build/cjs/prod/transport.js +93 -86
  232. package/build/cjs/prod/transport.js.map +1 -1
  233. package/build/cjs/prod/utils/asyncContextStrategy.js +10 -10
  234. package/build/cjs/prod/utils/asyncContextStrategy.js.map +1 -1
  235. package/build/cjs/prod/utils/bindingPropagation.js +17 -11
  236. package/build/cjs/prod/utils/bindingPropagation.js.map +1 -1
  237. package/build/cjs/prod/utils/cloudflareTrace.js +34 -0
  238. package/build/cjs/prod/utils/cloudflareTrace.js.map +1 -0
  239. package/build/cjs/prod/utils/instrumentContext.js +74 -58
  240. package/build/cjs/prod/utils/instrumentContext.js.map +1 -1
  241. package/build/cjs/prod/utils/internalSqlQuery.js +38 -21
  242. package/build/cjs/prod/utils/internalSqlQuery.js.map +1 -1
  243. package/build/cjs/prod/utils/internalStorageKey.js +41 -38
  244. package/build/cjs/prod/utils/internalStorageKey.js.map +1 -1
  245. package/build/cjs/prod/utils/invocationContext.js +42 -32
  246. package/build/cjs/prod/utils/invocationContext.js.map +1 -1
  247. package/build/cjs/prod/utils/invocationScope.js +45 -21
  248. package/build/cjs/prod/utils/invocationScope.js.map +1 -1
  249. package/build/cjs/prod/utils/isBinding.js +47 -15
  250. package/build/cjs/prod/utils/isBinding.js.map +1 -1
  251. package/build/cjs/prod/utils/isCloudflareClass.js +11 -20
  252. package/build/cjs/prod/utils/isCloudflareClass.js.map +1 -1
  253. package/build/cjs/prod/utils/queueTraceMeta.js +24 -35
  254. package/build/cjs/prod/utils/queueTraceMeta.js.map +1 -1
  255. package/build/cjs/prod/utils/rpcMeta.js +37 -27
  256. package/build/cjs/prod/utils/rpcMeta.js.map +1 -1
  257. package/build/cjs/prod/utils/traceLinks.js +52 -42
  258. package/build/cjs/prod/utils/traceLinks.js.map +1 -1
  259. package/build/cjs/prod/vendor/stacktrace.js +32 -24
  260. package/build/cjs/prod/vendor/stacktrace.js.map +1 -1
  261. package/build/cjs/prod/vite/agentClass.js +105 -98
  262. package/build/cjs/prod/vite/agentClass.js.map +1 -1
  263. package/build/cjs/prod/vite/autoInstrument.js +125 -122
  264. package/build/cjs/prod/vite/autoInstrument.js.map +1 -1
  265. package/build/cjs/prod/vite/index.js +44 -21
  266. package/build/cjs/prod/vite/index.js.map +1 -1
  267. package/build/cjs/prod/vite/instrumentFile.js +37 -20
  268. package/build/cjs/prod/vite/instrumentFile.js.map +1 -1
  269. package/build/cjs/prod/vite/mastraObservability.js +19 -12
  270. package/build/cjs/prod/vite/mastraObservability.js.map +1 -1
  271. package/build/cjs/prod/vite/moduleShape.js +220 -201
  272. package/build/cjs/prod/vite/moduleShape.js.map +1 -1
  273. package/build/cjs/prod/vite/providedModulePlugin.js +62 -45
  274. package/build/cjs/prod/vite/providedModulePlugin.js.map +1 -1
  275. package/build/cjs/prod/vite/transform.js +332 -284
  276. package/build/cjs/prod/vite/transform.js.map +1 -1
  277. package/build/cjs/prod/vite/workerEntrypoint.js +66 -57
  278. package/build/cjs/prod/vite/workerEntrypoint.js.map +1 -1
  279. package/build/cjs/prod/vite/wranglerConfig.js +94 -67
  280. package/build/cjs/prod/vite/wranglerConfig.js.map +1 -1
  281. package/build/cjs/prod/withSentry.js +32 -26
  282. package/build/cjs/prod/withSentry.js.map +1 -1
  283. package/build/cjs/prod/workflows.js +164 -151
  284. package/build/cjs/prod/workflows.js.map +1 -1
  285. package/build/cjs/prod/wrapMethodWithSentry.js +148 -169
  286. package/build/cjs/prod/wrapMethodWithSentry.js.map +1 -1
  287. package/build/cjs/prod/wrapRequestHandlerWithInit.js +76 -78
  288. package/build/cjs/prod/wrapRequestHandlerWithInit.js.map +1 -1
  289. package/build/esm/dev/baseSdk.js +98 -101
  290. package/build/esm/dev/baseSdk.js.map +1 -1
  291. package/build/esm/dev/client.js +218 -235
  292. package/build/esm/dev/client.js.map +1 -1
  293. package/build/esm/dev/clientCache.js +8 -6
  294. package/build/esm/dev/clientCache.js.map +1 -1
  295. package/build/esm/dev/debug-build.js +9 -3
  296. package/build/esm/dev/debug-build.js.map +1 -1
  297. package/build/esm/dev/defineCloudflareOptions.js +5 -6
  298. package/build/esm/dev/defineCloudflareOptions.js.map +1 -1
  299. package/build/esm/dev/durableobject.js +287 -174
  300. package/build/esm/dev/durableobject.js.map +1 -1
  301. package/build/esm/dev/flush.js +104 -75
  302. package/build/esm/dev/flush.js.map +1 -1
  303. package/build/esm/dev/index.js +19 -18
  304. package/build/esm/dev/instrument.js +53 -37
  305. package/build/esm/dev/instrument.js.map +1 -1
  306. package/build/esm/dev/instrumentations/agents/index.js +34 -11
  307. package/build/esm/dev/instrumentations/agents/index.js.map +1 -1
  308. package/build/esm/dev/instrumentations/agents/instrumentAgentCallableRpc.js +46 -47
  309. package/build/esm/dev/instrumentations/agents/instrumentAgentCallableRpc.js.map +1 -1
  310. package/build/esm/dev/instrumentations/agents/instrumentAgentRequestConversation.js +23 -14
  311. package/build/esm/dev/instrumentations/agents/instrumentAgentRequestConversation.js.map +1 -1
  312. package/build/esm/dev/instrumentations/agents/instrumentChatAgentConversation.js +36 -26
  313. package/build/esm/dev/instrumentations/agents/instrumentChatAgentConversation.js.map +1 -1
  314. package/build/esm/dev/instrumentations/agents/types.js +103 -56
  315. package/build/esm/dev/instrumentations/agents/types.js.map +1 -1
  316. package/build/esm/dev/instrumentations/instrumentDurableObjectHandlers.js +87 -116
  317. package/build/esm/dev/instrumentations/instrumentDurableObjectHandlers.js.map +1 -1
  318. package/build/esm/dev/instrumentations/instrumentDurableObjectNamespace.js +46 -42
  319. package/build/esm/dev/instrumentations/instrumentDurableObjectNamespace.js.map +1 -1
  320. package/build/esm/dev/instrumentations/instrumentDurableObjectStorage.js +70 -69
  321. package/build/esm/dev/instrumentations/instrumentDurableObjectStorage.js.map +1 -1
  322. package/build/esm/dev/instrumentations/instrumentDurableObjectSyncKvStorage.js +31 -37
  323. package/build/esm/dev/instrumentations/instrumentDurableObjectSyncKvStorage.js.map +1 -1
  324. package/build/esm/dev/instrumentations/instrumentSqlStorage.js +50 -50
  325. package/build/esm/dev/instrumentations/instrumentSqlStorage.js.map +1 -1
  326. package/build/esm/dev/instrumentations/instrumentWorkerEntrypoint.js +136 -121
  327. package/build/esm/dev/instrumentations/instrumentWorkerEntrypoint.js.map +1 -1
  328. package/build/esm/dev/instrumentations/worker/instrumentD1.js +131 -144
  329. package/build/esm/dev/instrumentations/worker/instrumentD1.js.map +1 -1
  330. package/build/esm/dev/instrumentations/worker/instrumentEmail.js +63 -59
  331. package/build/esm/dev/instrumentations/worker/instrumentEmail.js.map +1 -1
  332. package/build/esm/dev/instrumentations/worker/instrumentEnv.js +83 -86
  333. package/build/esm/dev/instrumentations/worker/instrumentEnv.js.map +1 -1
  334. package/build/esm/dev/instrumentations/worker/instrumentFetch.js +41 -46
  335. package/build/esm/dev/instrumentations/worker/instrumentFetch.js.map +1 -1
  336. package/build/esm/dev/instrumentations/worker/instrumentFetcher.js +25 -19
  337. package/build/esm/dev/instrumentations/worker/instrumentFetcher.js.map +1 -1
  338. package/build/esm/dev/instrumentations/worker/instrumentKV.js +54 -65
  339. package/build/esm/dev/instrumentations/worker/instrumentKV.js.map +1 -1
  340. package/build/esm/dev/instrumentations/worker/instrumentQueue.js +98 -103
  341. package/build/esm/dev/instrumentations/worker/instrumentQueue.js.map +1 -1
  342. package/build/esm/dev/instrumentations/worker/instrumentQueueProducer.js +88 -92
  343. package/build/esm/dev/instrumentations/worker/instrumentQueueProducer.js.map +1 -1
  344. package/build/esm/dev/instrumentations/worker/instrumentR2.js +128 -113
  345. package/build/esm/dev/instrumentations/worker/instrumentR2.js.map +1 -1
  346. package/build/esm/dev/instrumentations/worker/instrumentScheduled.js +90 -92
  347. package/build/esm/dev/instrumentations/worker/instrumentScheduled.js.map +1 -1
  348. package/build/esm/dev/instrumentations/worker/instrumentTail.js +100 -53
  349. package/build/esm/dev/instrumentations/worker/instrumentTail.js.map +1 -1
  350. package/build/esm/dev/integrations/cronTriggers.js +129 -82
  351. package/build/esm/dev/integrations/cronTriggers.js.map +1 -1
  352. package/build/esm/dev/integrations/fetch.js +9 -6
  353. package/build/esm/dev/integrations/fetch.js.map +1 -1
  354. package/build/esm/dev/integrations/httpServer.js +40 -19
  355. package/build/esm/dev/integrations/httpServer.js.map +1 -1
  356. package/build/esm/dev/integrations/spotlight.js +51 -52
  357. package/build/esm/dev/integrations/spotlight.js.map +1 -1
  358. package/build/esm/dev/opentelemetry/tracer.js +10 -6
  359. package/build/esm/dev/opentelemetry/tracer.js.map +1 -1
  360. package/build/esm/dev/options.js +56 -37
  361. package/build/esm/dev/options.js.map +1 -1
  362. package/build/esm/dev/orchestrion-deferred-channels.js +45 -27
  363. package/build/esm/dev/orchestrion-deferred-channels.js.map +1 -1
  364. package/build/esm/dev/orchestrion-diagnostics-channel.js +87 -66
  365. package/build/esm/dev/orchestrion-diagnostics-channel.js.map +1 -1
  366. package/build/esm/dev/package.json +1 -1
  367. package/build/esm/dev/pages-plugin.js +20 -19
  368. package/build/esm/dev/pages-plugin.js.map +1 -1
  369. package/build/esm/dev/request.js +14 -7
  370. package/build/esm/dev/request.js.map +1 -1
  371. package/build/esm/dev/scope-utils.js +12 -10
  372. package/build/esm/dev/scope-utils.js.map +1 -1
  373. package/build/esm/dev/sdk.js +23 -13
  374. package/build/esm/dev/sdk.js.map +1 -1
  375. package/build/esm/dev/transport.js +93 -84
  376. package/build/esm/dev/transport.js.map +1 -1
  377. package/build/esm/dev/utils/asyncContextStrategy.js +10 -8
  378. package/build/esm/dev/utils/asyncContextStrategy.js.map +1 -1
  379. package/build/esm/dev/utils/bindingPropagation.js +17 -9
  380. package/build/esm/dev/utils/bindingPropagation.js.map +1 -1
  381. package/build/esm/dev/utils/cloudflareTrace.js +34 -0
  382. package/build/esm/dev/utils/cloudflareTrace.js.map +1 -0
  383. package/build/esm/dev/utils/instrumentContext.js +74 -56
  384. package/build/esm/dev/utils/instrumentContext.js.map +1 -1
  385. package/build/esm/dev/utils/internalSqlQuery.js +38 -19
  386. package/build/esm/dev/utils/internalSqlQuery.js.map +1 -1
  387. package/build/esm/dev/utils/internalStorageKey.js +41 -36
  388. package/build/esm/dev/utils/internalStorageKey.js.map +1 -1
  389. package/build/esm/dev/utils/invocationContext.js +42 -30
  390. package/build/esm/dev/utils/invocationContext.js.map +1 -1
  391. package/build/esm/dev/utils/invocationScope.js +45 -19
  392. package/build/esm/dev/utils/invocationScope.js.map +1 -1
  393. package/build/esm/dev/utils/isBinding.js +47 -13
  394. package/build/esm/dev/utils/isBinding.js.map +1 -1
  395. package/build/esm/dev/utils/isCloudflareClass.js +11 -18
  396. package/build/esm/dev/utils/isCloudflareClass.js.map +1 -1
  397. package/build/esm/dev/utils/queueTraceMeta.js +24 -33
  398. package/build/esm/dev/utils/queueTraceMeta.js.map +1 -1
  399. package/build/esm/dev/utils/rpcMeta.js +37 -25
  400. package/build/esm/dev/utils/rpcMeta.js.map +1 -1
  401. package/build/esm/dev/utils/traceLinks.js +52 -40
  402. package/build/esm/dev/utils/traceLinks.js.map +1 -1
  403. package/build/esm/dev/vendor/stacktrace.js +31 -21
  404. package/build/esm/dev/vendor/stacktrace.js.map +1 -1
  405. package/build/esm/dev/vite/agentClass.js +105 -96
  406. package/build/esm/dev/vite/agentClass.js.map +1 -1
  407. package/build/esm/dev/vite/autoInstrument.js +125 -120
  408. package/build/esm/dev/vite/autoInstrument.js.map +1 -1
  409. package/build/esm/dev/vite/index.js +43 -19
  410. package/build/esm/dev/vite/index.js.map +1 -1
  411. package/build/esm/dev/vite/instrumentFile.js +37 -18
  412. package/build/esm/dev/vite/instrumentFile.js.map +1 -1
  413. package/build/esm/dev/vite/mastraObservability.js +19 -10
  414. package/build/esm/dev/vite/mastraObservability.js.map +1 -1
  415. package/build/esm/dev/vite/moduleShape.js +220 -199
  416. package/build/esm/dev/vite/moduleShape.js.map +1 -1
  417. package/build/esm/dev/vite/providedModulePlugin.js +60 -43
  418. package/build/esm/dev/vite/providedModulePlugin.js.map +1 -1
  419. package/build/esm/dev/vite/transform.js +330 -282
  420. package/build/esm/dev/vite/transform.js.map +1 -1
  421. package/build/esm/dev/vite/workerEntrypoint.js +66 -55
  422. package/build/esm/dev/vite/workerEntrypoint.js.map +1 -1
  423. package/build/esm/dev/vite/wranglerConfig.js +94 -65
  424. package/build/esm/dev/vite/wranglerConfig.js.map +1 -1
  425. package/build/esm/dev/withSentry.js +32 -24
  426. package/build/esm/dev/withSentry.js.map +1 -1
  427. package/build/esm/dev/workflows.js +164 -149
  428. package/build/esm/dev/workflows.js.map +1 -1
  429. package/build/esm/dev/wrapMethodWithSentry.js +148 -167
  430. package/build/esm/dev/wrapMethodWithSentry.js.map +1 -1
  431. package/build/esm/dev/wrapRequestHandlerWithInit.js +76 -76
  432. package/build/esm/dev/wrapRequestHandlerWithInit.js.map +1 -1
  433. package/build/esm/prod/baseSdk.js +94 -91
  434. package/build/esm/prod/baseSdk.js.map +1 -1
  435. package/build/esm/prod/client.js +218 -235
  436. package/build/esm/prod/client.js.map +1 -1
  437. package/build/esm/prod/clientCache.js +8 -6
  438. package/build/esm/prod/clientCache.js.map +1 -1
  439. package/build/esm/prod/debug-build.js +9 -3
  440. package/build/esm/prod/debug-build.js.map +1 -1
  441. package/build/esm/prod/defineCloudflareOptions.js +5 -6
  442. package/build/esm/prod/defineCloudflareOptions.js.map +1 -1
  443. package/build/esm/prod/durableobject.js +287 -174
  444. package/build/esm/prod/durableobject.js.map +1 -1
  445. package/build/esm/prod/flush.js +104 -75
  446. package/build/esm/prod/flush.js.map +1 -1
  447. package/build/esm/prod/index.js +19 -18
  448. package/build/esm/prod/instrument.js +53 -37
  449. package/build/esm/prod/instrument.js.map +1 -1
  450. package/build/esm/prod/instrumentations/agents/index.js +34 -11
  451. package/build/esm/prod/instrumentations/agents/index.js.map +1 -1
  452. package/build/esm/prod/instrumentations/agents/instrumentAgentCallableRpc.js +46 -47
  453. package/build/esm/prod/instrumentations/agents/instrumentAgentCallableRpc.js.map +1 -1
  454. package/build/esm/prod/instrumentations/agents/instrumentAgentRequestConversation.js +23 -14
  455. package/build/esm/prod/instrumentations/agents/instrumentAgentRequestConversation.js.map +1 -1
  456. package/build/esm/prod/instrumentations/agents/instrumentChatAgentConversation.js +36 -26
  457. package/build/esm/prod/instrumentations/agents/instrumentChatAgentConversation.js.map +1 -1
  458. package/build/esm/prod/instrumentations/agents/types.js +103 -56
  459. package/build/esm/prod/instrumentations/agents/types.js.map +1 -1
  460. package/build/esm/prod/instrumentations/instrumentDurableObjectHandlers.js +87 -116
  461. package/build/esm/prod/instrumentations/instrumentDurableObjectHandlers.js.map +1 -1
  462. package/build/esm/prod/instrumentations/instrumentDurableObjectNamespace.js +46 -42
  463. package/build/esm/prod/instrumentations/instrumentDurableObjectNamespace.js.map +1 -1
  464. package/build/esm/prod/instrumentations/instrumentDurableObjectStorage.js +70 -69
  465. package/build/esm/prod/instrumentations/instrumentDurableObjectStorage.js.map +1 -1
  466. package/build/esm/prod/instrumentations/instrumentDurableObjectSyncKvStorage.js +31 -37
  467. package/build/esm/prod/instrumentations/instrumentDurableObjectSyncKvStorage.js.map +1 -1
  468. package/build/esm/prod/instrumentations/instrumentSqlStorage.js +50 -50
  469. package/build/esm/prod/instrumentations/instrumentSqlStorage.js.map +1 -1
  470. package/build/esm/prod/instrumentations/instrumentWorkerEntrypoint.js +136 -121
  471. package/build/esm/prod/instrumentations/instrumentWorkerEntrypoint.js.map +1 -1
  472. package/build/esm/prod/instrumentations/worker/instrumentD1.js +131 -144
  473. package/build/esm/prod/instrumentations/worker/instrumentD1.js.map +1 -1
  474. package/build/esm/prod/instrumentations/worker/instrumentEmail.js +63 -59
  475. package/build/esm/prod/instrumentations/worker/instrumentEmail.js.map +1 -1
  476. package/build/esm/prod/instrumentations/worker/instrumentEnv.js +83 -86
  477. package/build/esm/prod/instrumentations/worker/instrumentEnv.js.map +1 -1
  478. package/build/esm/prod/instrumentations/worker/instrumentFetch.js +41 -46
  479. package/build/esm/prod/instrumentations/worker/instrumentFetch.js.map +1 -1
  480. package/build/esm/prod/instrumentations/worker/instrumentFetcher.js +25 -19
  481. package/build/esm/prod/instrumentations/worker/instrumentFetcher.js.map +1 -1
  482. package/build/esm/prod/instrumentations/worker/instrumentKV.js +54 -65
  483. package/build/esm/prod/instrumentations/worker/instrumentKV.js.map +1 -1
  484. package/build/esm/prod/instrumentations/worker/instrumentQueue.js +98 -103
  485. package/build/esm/prod/instrumentations/worker/instrumentQueue.js.map +1 -1
  486. package/build/esm/prod/instrumentations/worker/instrumentQueueProducer.js +88 -92
  487. package/build/esm/prod/instrumentations/worker/instrumentQueueProducer.js.map +1 -1
  488. package/build/esm/prod/instrumentations/worker/instrumentR2.js +128 -113
  489. package/build/esm/prod/instrumentations/worker/instrumentR2.js.map +1 -1
  490. package/build/esm/prod/instrumentations/worker/instrumentScheduled.js +90 -92
  491. package/build/esm/prod/instrumentations/worker/instrumentScheduled.js.map +1 -1
  492. package/build/esm/prod/instrumentations/worker/instrumentTail.js +100 -53
  493. package/build/esm/prod/instrumentations/worker/instrumentTail.js.map +1 -1
  494. package/build/esm/prod/integrations/cronTriggers.js +129 -82
  495. package/build/esm/prod/integrations/cronTriggers.js.map +1 -1
  496. package/build/esm/prod/integrations/fetch.js +9 -6
  497. package/build/esm/prod/integrations/fetch.js.map +1 -1
  498. package/build/esm/prod/integrations/httpServer.js +40 -19
  499. package/build/esm/prod/integrations/httpServer.js.map +1 -1
  500. package/build/esm/prod/integrations/spotlight.js +51 -52
  501. package/build/esm/prod/integrations/spotlight.js.map +1 -1
  502. package/build/esm/prod/opentelemetry/tracer.js +10 -6
  503. package/build/esm/prod/opentelemetry/tracer.js.map +1 -1
  504. package/build/esm/prod/options.js +38 -22
  505. package/build/esm/prod/options.js.map +1 -1
  506. package/build/esm/prod/orchestrion-deferred-channels.js +45 -27
  507. package/build/esm/prod/orchestrion-deferred-channels.js.map +1 -1
  508. package/build/esm/prod/orchestrion-diagnostics-channel.js +87 -66
  509. package/build/esm/prod/orchestrion-diagnostics-channel.js.map +1 -1
  510. package/build/esm/prod/package.json +1 -1
  511. package/build/esm/prod/pages-plugin.js +20 -19
  512. package/build/esm/prod/pages-plugin.js.map +1 -1
  513. package/build/esm/prod/request.js +14 -7
  514. package/build/esm/prod/request.js.map +1 -1
  515. package/build/esm/prod/scope-utils.js +12 -10
  516. package/build/esm/prod/scope-utils.js.map +1 -1
  517. package/build/esm/prod/sdk.js +23 -13
  518. package/build/esm/prod/sdk.js.map +1 -1
  519. package/build/esm/prod/transport.js +93 -84
  520. package/build/esm/prod/transport.js.map +1 -1
  521. package/build/esm/prod/utils/asyncContextStrategy.js +10 -8
  522. package/build/esm/prod/utils/asyncContextStrategy.js.map +1 -1
  523. package/build/esm/prod/utils/bindingPropagation.js +17 -9
  524. package/build/esm/prod/utils/bindingPropagation.js.map +1 -1
  525. package/build/esm/prod/utils/cloudflareTrace.js +34 -0
  526. package/build/esm/prod/utils/cloudflareTrace.js.map +1 -0
  527. package/build/esm/prod/utils/instrumentContext.js +74 -56
  528. package/build/esm/prod/utils/instrumentContext.js.map +1 -1
  529. package/build/esm/prod/utils/internalSqlQuery.js +38 -19
  530. package/build/esm/prod/utils/internalSqlQuery.js.map +1 -1
  531. package/build/esm/prod/utils/internalStorageKey.js +41 -36
  532. package/build/esm/prod/utils/internalStorageKey.js.map +1 -1
  533. package/build/esm/prod/utils/invocationContext.js +42 -30
  534. package/build/esm/prod/utils/invocationContext.js.map +1 -1
  535. package/build/esm/prod/utils/invocationScope.js +45 -19
  536. package/build/esm/prod/utils/invocationScope.js.map +1 -1
  537. package/build/esm/prod/utils/isBinding.js +47 -13
  538. package/build/esm/prod/utils/isBinding.js.map +1 -1
  539. package/build/esm/prod/utils/isCloudflareClass.js +11 -18
  540. package/build/esm/prod/utils/isCloudflareClass.js.map +1 -1
  541. package/build/esm/prod/utils/queueTraceMeta.js +24 -33
  542. package/build/esm/prod/utils/queueTraceMeta.js.map +1 -1
  543. package/build/esm/prod/utils/rpcMeta.js +37 -25
  544. package/build/esm/prod/utils/rpcMeta.js.map +1 -1
  545. package/build/esm/prod/utils/traceLinks.js +52 -40
  546. package/build/esm/prod/utils/traceLinks.js.map +1 -1
  547. package/build/esm/prod/vendor/stacktrace.js +31 -21
  548. package/build/esm/prod/vendor/stacktrace.js.map +1 -1
  549. package/build/esm/prod/vite/agentClass.js +105 -96
  550. package/build/esm/prod/vite/agentClass.js.map +1 -1
  551. package/build/esm/prod/vite/autoInstrument.js +125 -120
  552. package/build/esm/prod/vite/autoInstrument.js.map +1 -1
  553. package/build/esm/prod/vite/index.js +43 -19
  554. package/build/esm/prod/vite/index.js.map +1 -1
  555. package/build/esm/prod/vite/instrumentFile.js +37 -18
  556. package/build/esm/prod/vite/instrumentFile.js.map +1 -1
  557. package/build/esm/prod/vite/mastraObservability.js +19 -10
  558. package/build/esm/prod/vite/mastraObservability.js.map +1 -1
  559. package/build/esm/prod/vite/moduleShape.js +220 -199
  560. package/build/esm/prod/vite/moduleShape.js.map +1 -1
  561. package/build/esm/prod/vite/providedModulePlugin.js +60 -43
  562. package/build/esm/prod/vite/providedModulePlugin.js.map +1 -1
  563. package/build/esm/prod/vite/transform.js +330 -282
  564. package/build/esm/prod/vite/transform.js.map +1 -1
  565. package/build/esm/prod/vite/workerEntrypoint.js +66 -55
  566. package/build/esm/prod/vite/workerEntrypoint.js.map +1 -1
  567. package/build/esm/prod/vite/wranglerConfig.js +94 -65
  568. package/build/esm/prod/vite/wranglerConfig.js.map +1 -1
  569. package/build/esm/prod/withSentry.js +32 -24
  570. package/build/esm/prod/withSentry.js.map +1 -1
  571. package/build/esm/prod/workflows.js +164 -149
  572. package/build/esm/prod/workflows.js.map +1 -1
  573. package/build/esm/prod/wrapMethodWithSentry.js +148 -167
  574. package/build/esm/prod/wrapMethodWithSentry.js.map +1 -1
  575. package/build/esm/prod/wrapRequestHandlerWithInit.js +76 -76
  576. package/build/esm/prod/wrapRequestHandlerWithInit.js.map +1 -1
  577. package/build/types/baseSdk.d.ts.map +1 -1
  578. package/build/types/client.d.ts +9 -1
  579. package/build/types/client.d.ts.map +1 -1
  580. package/build/types/durableobject.d.ts.map +1 -1
  581. package/build/types/index.d.ts +3 -2
  582. package/build/types/index.d.ts.map +1 -1
  583. package/build/types/instrumentations/worker/instrumentEmail.d.ts.map +1 -1
  584. package/build/types/instrumentations/worker/instrumentFetcher.d.ts.map +1 -1
  585. package/build/types/instrumentations/worker/instrumentQueue.d.ts.map +1 -1
  586. package/build/types/instrumentations/worker/instrumentScheduled.d.ts.map +1 -1
  587. package/build/types/instrumentations/worker/instrumentTail.d.ts +4 -2
  588. package/build/types/instrumentations/worker/instrumentTail.d.ts.map +1 -1
  589. package/build/types/options.d.ts.map +1 -1
  590. package/build/types/utils/cloudflareTrace.d.ts +13 -0
  591. package/build/types/utils/cloudflareTrace.d.ts.map +1 -0
  592. package/build/types/vite/autoInstrument.d.ts.map +1 -1
  593. package/build/types/vite/index.d.ts +3 -0
  594. package/build/types/vite/index.d.ts.map +1 -1
  595. package/build/types/vite/providedModulePlugin.d.ts +15 -11
  596. package/build/types/vite/providedModulePlugin.d.ts.map +1 -1
  597. package/build/types/vite/transform.d.ts +12 -2
  598. package/build/types/vite/transform.d.ts.map +1 -1
  599. package/build/types/vite/wranglerConfig.d.ts +8 -0
  600. package/build/types/vite/wranglerConfig.d.ts.map +1 -1
  601. package/build/types/workflows.d.ts.map +1 -1
  602. package/build/types/wrapMethodWithSentry.d.ts.map +1 -1
  603. package/build/types/wrapRequestHandlerWithInit.d.ts.map +1 -1
  604. package/package.json +10 -14
  605. package/build/cjs/dev/index.js.map +0 -1
  606. package/build/cjs/dev/vite/flueRuntime.js +0 -15
  607. package/build/cjs/dev/vite/flueRuntime.js.map +0 -1
  608. package/build/cjs/prod/index.js.map +0 -1
  609. package/build/cjs/prod/vite/flueRuntime.js +0 -15
  610. package/build/cjs/prod/vite/flueRuntime.js.map +0 -1
  611. package/build/esm/dev/index.js.map +0 -1
  612. package/build/esm/dev/vite/flueRuntime.js +0 -13
  613. package/build/esm/dev/vite/flueRuntime.js.map +0 -1
  614. package/build/esm/prod/index.js.map +0 -1
  615. package/build/esm/prod/vite/flueRuntime.js +0 -13
  616. package/build/esm/prod/vite/flueRuntime.js.map +0 -1
  617. package/build/types/vite/flueRuntime.d.ts +0 -12
  618. package/build/types/vite/flueRuntime.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"httpServer.js","sources":["../../../../src/integrations/httpServer.ts"],"sourcesContent":["import type { Client, Integration, IntegrationFn, MaxRequestBodySize, Span } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport type { AssertTrue, CheckServerRequestOptions, ServerRequestOptions } from '@sentry/core/server';\n\nconst INTEGRATION_NAME = 'HttpServer' as const;\n\nexport interface HttpServerIntegrationOptions {\n /**\n * Controls the maximum size of incoming request bodies attached to events.\n *\n * Only applies to requests with textual content types (text/*, application/json,\n * application/x-www-form-urlencoded, application/xml, application/graphql).\n * Binary data is not captured.\n *\n * Available options:\n * - `'none'`: No request bodies will be attached\n * - `'small'`: Request bodies up to 1,000 bytes will be attached\n * - `'medium'`: Request bodies up to 10,000 bytes will be attached (default)\n * - `'always'`: Request bodies will always be attached (up to 1MB limit)\n *\n * @default 'medium'\n */\n maxRequestBodySize?: MaxRequestBodySize;\n\n /**\n * Do not capture the request body for incoming HTTP requests to URLs where the given callback returns `true`.\n * This can be useful for long running requests where the body is not needed, health check endpoints,\n * or requests containing sensitive data that should not be captured.\n *\n * @param url The full URL of the incoming request, including query string, protocol, host, etc.\n * @param request The incoming Request object.\n * @returns `true` to skip body capture for this request, `false` to capture normally.\n *\n * @example\n * ```ts\n * Sentry.httpServerIntegration({\n * ignoreRequestBody: (url) => url.includes('/health') || url.includes('/upload'),\n * })\n * ```\n */\n ignoreRequestBody?: (url: string, request: Request) => boolean;\n\n /**\n * Do not create spans for incoming requests whose URL path makes the given callback return `true`.\n *\n * `urlPath` is the path of the request, including the query string. `request` is the incoming\n * {@link Request}. Errors thrown by the handler are still captured.\n */\n ignoreIncomingRequests?: (urlPath: string, request: Request) => boolean;\n\n /**\n * Whether to automatically ignore common static asset requests (favicon.ico, robots.txt, etc.)\n * when creating spans.\n *\n * @default `true`\n */\n ignoreStaticAssets?: boolean;\n\n /**\n * Whether to create spans for incoming requests.\n * Errors are still captured and request data is still attached when this is `false`.\n * Defaults to the client's tracing configuration (`hasSpansEnabled`).\n */\n spans?: boolean;\n\n /**\n * A hook that can be used to mutate the span for incoming requests.\n * This is triggered after the span is created, before the request handler runs.\n */\n onSpanCreated?: (span: Span, request: Request) => void;\n\n /**\n * A hook that can be used to mutate the span one last time before it ends.\n * For a streamed response, this runs when the stream finishes.\n * It is not called when the request handler throws.\n */\n onSpanEnd?: (span: Span, request: Request, response: Response) => void;\n}\n\n// Checks these options against the shared `ServerRequestOptions`. A new\n// shared field fails to compile here, until this integration supports\n// it or lists it as unsupported.\ntype _ServerRequestOptionsCheck = AssertTrue<\n CheckServerRequestOptions<\n HttpServerIntegrationOptions,\n Request,\n Response,\n // Not supported. A worker has no long-lived process to run the timer\n // that flushes session aggregates.\n 'sessions' | 'sessionFlushingDelayMS'\n >\n>;\n\ntype SupportedServerRequestOptions = Omit<\n ServerRequestOptions<Request, Response>,\n 'sessions' | 'sessionFlushingDelayMS'\n>;\n\n// Every supported shared option is a required key, so a new one fails to compile below until the\n// integration passes it on.\ntype HttpServerRequestOptions = {\n [K in keyof Required<SupportedServerRequestOptions>]: SupportedServerRequestOptions[K];\n};\n\ninterface HttpServerIntegration extends Integration {\n requestOptions: HttpServerRequestOptions;\n}\n\n/**\n * The incoming request options of the client's `httpServerIntegration`. If the integration does not\n * set `maxRequestBodySize`, `dataCollection.httpBodies` decides. Without the integration, the SDK\n * attaches no request body.\n */\nexport function getHttpServerRequestOptions(client: Client): ServerRequestOptions<Request, Response> {\n return (\n client.getIntegrationByName<HttpServerIntegration>(INTEGRATION_NAME)?.requestOptions ?? {\n maxRequestBodySize: 'none',\n }\n );\n}\n\nconst _httpServerIntegration = ((options: HttpServerIntegrationOptions = {}): HttpServerIntegration => {\n return {\n name: INTEGRATION_NAME,\n requestOptions: {\n maxRequestBodySize: options.maxRequestBodySize,\n ignoreRequestBody: options.ignoreRequestBody,\n ignoreIncomingRequests: options.ignoreIncomingRequests,\n ignoreStaticAssets: options.ignoreStaticAssets ?? true,\n spans: options.spans,\n onSpanCreated: options.onSpanCreated,\n onSpanEnd: options.onSpanEnd,\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Configures incoming HTTP request handling for Cloudflare Workers.\n *\n * This integration controls how incoming HTTP request data is captured,\n * matching the API of `httpServerIntegration` in Node.js.\n *\n * @example\n * ```ts\n * Sentry.init({\n * integrations: [\n * Sentry.httpServerIntegration({\n * maxRequestBodySize: 'medium',\n * ignoreRequestBody: (url) => url.includes('/health'),\n * }),\n * ],\n * });\n * ```\n */\nexport const httpServerIntegration = defineIntegration(_httpServerIntegration);\n"],"names":["defineIntegration"],"mappings":";;;;AAIA,MAAM,gBAAA,GAAmB,YAAA;AA6GlB,SAAS,4BAA4B,MAAA,EAAyD;AACnG,EAAA,OACE,MAAA,CAAO,oBAAA,CAA4C,gBAAgB,CAAA,EAAG,cAAA,IAAkB;AAAA,IACtF,kBAAA,EAAoB;AAAA,GACtB;AAEJ;AAEA,MAAM,sBAAA,IAA0B,CAAC,OAAA,GAAwC,EAAC,KAA6B;AACrG,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,cAAA,EAAgB;AAAA,MACd,oBAAoB,OAAA,CAAQ,kBAAA;AAAA,MAC5B,mBAAmB,OAAA,CAAQ,iBAAA;AAAA,MAC3B,wBAAwB,OAAA,CAAQ,sBAAA;AAAA,MAChC,kBAAA,EAAoB,QAAQ,kBAAA,IAAsB,IAAA;AAAA,MAClD,OAAO,OAAA,CAAQ,KAAA;AAAA,MACf,eAAe,OAAA,CAAQ,aAAA;AAAA,MACvB,WAAW,OAAA,CAAQ;AAAA;AACrB,GACF;AACF,CAAA,CAAA;AAoBO,MAAM,qBAAA,GAAwBA,uBAAkB,sBAAsB;;;;;"}
1
+ {"version":3,"file":"httpServer.js","names":["defineIntegration"],"sources":["../../../../src/integrations/httpServer.ts"],"sourcesContent":["import type { Client, Integration, IntegrationFn, MaxRequestBodySize, Span } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport type { AssertTrue, CheckServerRequestOptions, ServerRequestOptions } from '@sentry/core/server';\n\nconst INTEGRATION_NAME = 'HttpServer' as const;\n\nexport interface HttpServerIntegrationOptions {\n /**\n * Controls the maximum size of incoming request bodies attached to events.\n *\n * Only applies to requests with textual content types (text/*, application/json,\n * application/x-www-form-urlencoded, application/xml, application/graphql).\n * Binary data is not captured.\n *\n * Available options:\n * - `'none'`: No request bodies will be attached\n * - `'small'`: Request bodies up to 1,000 bytes will be attached\n * - `'medium'`: Request bodies up to 10,000 bytes will be attached (default)\n * - `'always'`: Request bodies will always be attached (up to 1MB limit)\n *\n * @default 'medium'\n */\n maxRequestBodySize?: MaxRequestBodySize;\n\n /**\n * Do not capture the request body for incoming HTTP requests to URLs where the given callback returns `true`.\n * This can be useful for long running requests where the body is not needed, health check endpoints,\n * or requests containing sensitive data that should not be captured.\n *\n * @param url The full URL of the incoming request, including query string, protocol, host, etc.\n * @param request The incoming Request object.\n * @returns `true` to skip body capture for this request, `false` to capture normally.\n *\n * @example\n * ```ts\n * Sentry.httpServerIntegration({\n * ignoreRequestBody: (url) => url.includes('/health') || url.includes('/upload'),\n * })\n * ```\n */\n ignoreRequestBody?: (url: string, request: Request) => boolean;\n\n /**\n * Do not create spans for incoming requests whose URL path makes the given callback return `true`.\n *\n * `urlPath` is the path of the request, including the query string. `request` is the incoming\n * {@link Request}. Errors thrown by the handler are still captured.\n */\n ignoreIncomingRequests?: (urlPath: string, request: Request) => boolean;\n\n /**\n * Whether to automatically ignore common static asset requests (favicon.ico, robots.txt, etc.)\n * when creating spans.\n *\n * @default `true`\n */\n ignoreStaticAssets?: boolean;\n\n /**\n * Whether to create spans for incoming requests.\n * Errors are still captured and request data is still attached when this is `false`.\n * Defaults to the client's tracing configuration (`hasSpansEnabled`).\n */\n spans?: boolean;\n\n /**\n * A hook that can be used to mutate the span for incoming requests.\n * This is triggered after the span is created, before the request handler runs.\n */\n onSpanCreated?: (span: Span, request: Request) => void;\n\n /**\n * A hook that can be used to mutate the span one last time before it ends.\n * For a streamed response, this runs when the stream finishes.\n * It is not called when the request handler throws.\n */\n onSpanEnd?: (span: Span, request: Request, response: Response) => void;\n}\n\n// Checks these options against the shared `ServerRequestOptions`. A new\n// shared field fails to compile here, until this integration supports\n// it or lists it as unsupported.\ntype _ServerRequestOptionsCheck = AssertTrue<\n CheckServerRequestOptions<\n HttpServerIntegrationOptions,\n Request,\n Response,\n // Not supported. A worker has no long-lived process to run the timer\n // that flushes session aggregates.\n 'sessions' | 'sessionFlushingDelayMS'\n >\n>;\n\ntype SupportedServerRequestOptions = Omit<\n ServerRequestOptions<Request, Response>,\n 'sessions' | 'sessionFlushingDelayMS'\n>;\n\n// Every supported shared option is a required key, so a new one fails to compile below until the\n// integration passes it on.\ntype HttpServerRequestOptions = {\n [K in keyof Required<SupportedServerRequestOptions>]: SupportedServerRequestOptions[K];\n};\n\ninterface HttpServerIntegration extends Integration {\n requestOptions: HttpServerRequestOptions;\n}\n\n/**\n * The incoming request options of the client's `httpServerIntegration`. If the integration does not\n * set `maxRequestBodySize`, `dataCollection.httpBodies` decides. Without the integration, the SDK\n * attaches no request body.\n */\nexport function getHttpServerRequestOptions(client: Client): ServerRequestOptions<Request, Response> {\n return (\n client.getIntegrationByName<HttpServerIntegration>(INTEGRATION_NAME)?.requestOptions ?? {\n maxRequestBodySize: 'none',\n }\n );\n}\n\nconst _httpServerIntegration = ((options: HttpServerIntegrationOptions = {}): HttpServerIntegration => {\n return {\n name: INTEGRATION_NAME,\n requestOptions: {\n maxRequestBodySize: options.maxRequestBodySize,\n ignoreRequestBody: options.ignoreRequestBody,\n ignoreIncomingRequests: options.ignoreIncomingRequests,\n ignoreStaticAssets: options.ignoreStaticAssets ?? true,\n spans: options.spans,\n onSpanCreated: options.onSpanCreated,\n onSpanEnd: options.onSpanEnd,\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Configures incoming HTTP request handling for Cloudflare Workers.\n *\n * This integration controls how incoming HTTP request data is captured,\n * matching the API of `httpServerIntegration` in Node.js.\n *\n * @example\n * ```ts\n * Sentry.init({\n * integrations: [\n * Sentry.httpServerIntegration({\n * maxRequestBodySize: 'medium',\n * ignoreRequestBody: (url) => url.includes('/health'),\n * }),\n * ],\n * });\n * ```\n */\nexport const httpServerIntegration = defineIntegration(_httpServerIntegration);\n"],"mappings":";;AAIA,MAAM,mBAAmB;;;;;;AA6GzB,SAAgB,4BAA4B,QAAyD;CACnG,OACE,OAAO,qBAA4C,gBAAgB,CAAC,EAAE,kBAAkB,EACtF,oBAAoB,OACtB;AAEJ;AAEA,MAAM,2BAA2B,UAAwC,CAAC,MAA6B;CACrG,OAAO;EACL,MAAM;EACN,gBAAgB;GACd,oBAAoB,QAAQ;GAC5B,mBAAmB,QAAQ;GAC3B,wBAAwB,QAAQ;GAChC,oBAAoB,QAAQ,sBAAsB;GAClD,OAAO,QAAQ;GACf,eAAe,QAAQ;GACvB,WAAW,QAAQ;EACrB;CACF;AACF;;;;;;;;;;;;;;;;;;;AAoBA,MAAa,yBAAA,GAAwBA,aAAAA,kBAAAA,CAAkB,sBAAsB"}
@@ -1,64 +1,61 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
-
3
- const core = require('@sentry/core');
4
- const debugBuild = require('../debug-build.js');
5
-
1
+ const require_debug_build = require("../debug-build.js");
2
+ let _sentry_core = require("@sentry/core");
3
+ // src/integrations/spotlight.ts
6
4
  const INTEGRATION_NAME = "Spotlight";
7
5
  const _spotlightIntegration = ((options = {}) => {
8
- const sidecarUrl = options.sidecarUrl || "http://localhost:8969/stream";
9
- return {
10
- name: INTEGRATION_NAME,
11
- setup(client) {
12
- debugBuild.DEBUG_BUILD && core.debug.log("[Spotlight] Using Sidecar URL", sidecarUrl);
13
- setupSidecarForwarding(client, sidecarUrl);
14
- }
15
- };
6
+ const sidecarUrl = options.sidecarUrl || "http://localhost:8969/stream";
7
+ return {
8
+ name: INTEGRATION_NAME,
9
+ setup(client) {
10
+ require_debug_build.DEBUG_BUILD && _sentry_core.debug.log("[Spotlight] Using Sidecar URL", sidecarUrl);
11
+ setupSidecarForwarding(client, sidecarUrl);
12
+ }
13
+ };
16
14
  });
17
- const spotlightIntegration = core.defineIntegration(_spotlightIntegration);
15
+ /**
16
+ * Use this integration to send errors and transactions to Spotlight.
17
+ *
18
+ * Learn more about spotlight at https://spotlightjs.com
19
+ *
20
+ * Important: This integration is intended for local development only.
21
+ * Each forwarded envelope counts as a Worker subrequest (50 free / 1000 paid
22
+ * per invocation), so it should not be enabled in production.
23
+ */
24
+ const spotlightIntegration = (0, _sentry_core.defineIntegration)(_spotlightIntegration);
18
25
  function setupSidecarForwarding(client, sidecarUrl) {
19
- const parsedUrl = parseSidecarUrl(sidecarUrl);
20
- if (!parsedUrl) {
21
- return;
22
- }
23
- let failCount = 0;
24
- client.on("beforeEnvelope", (envelope) => {
25
- if (failCount > 3) {
26
- debugBuild.DEBUG_BUILD && core.debug.warn("[Spotlight] Disabled Sentry -> Spotlight forwarding due to too many failed requests");
27
- return;
28
- }
29
- const body = core.serializeEnvelope(envelope);
30
- core.suppressTracing(() => {
31
- fetch(parsedUrl.href, {
32
- method: "POST",
33
- body,
34
- headers: {
35
- "Content-Type": "application/x-sentry-envelope"
36
- }
37
- }).then(
38
- (res) => {
39
- res.text().catch(() => {
40
- });
41
- if (res.status >= 200 && res.status < 400) {
42
- failCount = 0;
43
- }
44
- },
45
- () => {
46
- failCount++;
47
- debugBuild.DEBUG_BUILD && core.debug.warn("[Spotlight] Failed to send envelope to Spotlight Sidecar");
48
- }
49
- );
50
- });
51
- });
26
+ const parsedUrl = parseSidecarUrl(sidecarUrl);
27
+ if (!parsedUrl) return;
28
+ let failCount = 0;
29
+ client.on("beforeEnvelope", (envelope) => {
30
+ if (failCount > 3) {
31
+ require_debug_build.DEBUG_BUILD && _sentry_core.debug.warn("[Spotlight] Disabled Sentry -> Spotlight forwarding due to too many failed requests");
32
+ return;
33
+ }
34
+ const body = (0, _sentry_core.serializeEnvelope)(envelope);
35
+ (0, _sentry_core.suppressTracing)(() => {
36
+ fetch(parsedUrl.href, {
37
+ method: "POST",
38
+ body,
39
+ headers: { "Content-Type": "application/x-sentry-envelope" }
40
+ }).then((res) => {
41
+ res.text().catch(() => {});
42
+ if (res.status >= 200 && res.status < 400) failCount = 0;
43
+ }, () => {
44
+ failCount++;
45
+ require_debug_build.DEBUG_BUILD && _sentry_core.debug.warn("[Spotlight] Failed to send envelope to Spotlight Sidecar");
46
+ });
47
+ });
48
+ });
52
49
  }
53
50
  function parseSidecarUrl(url) {
54
- try {
55
- return new URL(url);
56
- } catch {
57
- debugBuild.DEBUG_BUILD && core.debug.warn(`[Spotlight] Invalid sidecar URL: ${url}`);
58
- return void 0;
59
- }
51
+ try {
52
+ return new URL(url);
53
+ } catch {
54
+ require_debug_build.DEBUG_BUILD && _sentry_core.debug.warn(`[Spotlight] Invalid sidecar URL: ${url}`);
55
+ return;
56
+ }
60
57
  }
61
-
62
58
  exports.INTEGRATION_NAME = INTEGRATION_NAME;
63
59
  exports.spotlightIntegration = spotlightIntegration;
64
- //# sourceMappingURL=spotlight.js.map
60
+
61
+ //# sourceMappingURL=spotlight.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"spotlight.js","sources":["../../../../src/integrations/spotlight.ts"],"sourcesContent":["import type { Client, Envelope, IntegrationFn } from '@sentry/core';\nimport { debug, defineIntegration, serializeEnvelope, suppressTracing } from '@sentry/core';\nimport { DEBUG_BUILD } from '../debug-build';\n\ntype SpotlightConnectionOptions = {\n /**\n * Set this if the Spotlight Sidecar is not running on localhost:8969.\n * By default, the URL is set to http://localhost:8969/stream\n */\n sidecarUrl?: string;\n};\n\nexport const INTEGRATION_NAME = 'Spotlight' as const;\n\nconst _spotlightIntegration = ((options: Partial<SpotlightConnectionOptions> = {}) => {\n const sidecarUrl = options.sidecarUrl || 'http://localhost:8969/stream';\n\n return {\n name: INTEGRATION_NAME,\n setup(client) {\n DEBUG_BUILD && debug.log('[Spotlight] Using Sidecar URL', sidecarUrl);\n setupSidecarForwarding(client, sidecarUrl);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Use this integration to send errors and transactions to Spotlight.\n *\n * Learn more about spotlight at https://spotlightjs.com\n *\n * Important: This integration is intended for local development only.\n * Each forwarded envelope counts as a Worker subrequest (50 free / 1000 paid\n * per invocation), so it should not be enabled in production.\n */\nexport const spotlightIntegration = defineIntegration(_spotlightIntegration);\n\nfunction setupSidecarForwarding(client: Client, sidecarUrl: string): void {\n const parsedUrl = parseSidecarUrl(sidecarUrl);\n if (!parsedUrl) {\n return;\n }\n\n let failCount = 0;\n\n client.on('beforeEnvelope', (envelope: Envelope) => {\n if (failCount > 3) {\n DEBUG_BUILD && debug.warn('[Spotlight] Disabled Sentry -> Spotlight forwarding due to too many failed requests');\n return;\n }\n\n const body = serializeEnvelope(envelope);\n\n suppressTracing(() => {\n fetch(parsedUrl.href, {\n method: 'POST',\n body,\n headers: {\n 'Content-Type': 'application/x-sentry-envelope',\n },\n }).then(\n res => {\n // Consume the response body to satisfy Cloudflare Workers' requirement\n // that all fetch response bodies are read or cancelled.\n res.text().catch(() => {\n // no-op\n });\n\n if (res.status >= 200 && res.status < 400) {\n failCount = 0;\n }\n },\n () => {\n failCount++;\n DEBUG_BUILD && debug.warn('[Spotlight] Failed to send envelope to Spotlight Sidecar');\n },\n );\n });\n });\n}\n\nfunction parseSidecarUrl(url: string): URL | undefined {\n try {\n return new URL(url);\n } catch {\n DEBUG_BUILD && debug.warn(`[Spotlight] Invalid sidecar URL: ${url}`);\n return undefined;\n }\n}\n"],"names":["DEBUG_BUILD","debug","defineIntegration","serializeEnvelope","suppressTracing"],"mappings":";;;;;AAYO,MAAM,gBAAA,GAAmB;AAEhC,MAAM,qBAAA,IAAyB,CAAC,OAAA,GAA+C,EAAC,KAAM;AACpF,EAAA,MAAM,UAAA,GAAa,QAAQ,UAAA,IAAc,8BAAA;AAEzC,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,MAAM,MAAA,EAAQ;AACZ,MAAAA,sBAAA,IAAeC,UAAA,CAAM,GAAA,CAAI,+BAAA,EAAiC,UAAU,CAAA;AACpE,MAAA,sBAAA,CAAuB,QAAQ,UAAU,CAAA;AAAA,IAC3C;AAAA,GACF;AACF,CAAA,CAAA;AAWO,MAAM,oBAAA,GAAuBC,uBAAkB,qBAAqB;AAE3E,SAAS,sBAAA,CAAuB,QAAgB,UAAA,EAA0B;AACxE,EAAA,MAAM,SAAA,GAAY,gBAAgB,UAAU,CAAA;AAC5C,EAAA,IAAI,CAAC,SAAA,EAAW;AACd,IAAA;AAAA,EACF;AAEA,EAAA,IAAI,SAAA,GAAY,CAAA;AAEhB,EAAA,MAAA,CAAO,EAAA,CAAG,gBAAA,EAAkB,CAAC,QAAA,KAAuB;AAClD,IAAA,IAAI,YAAY,CAAA,EAAG;AACjB,MAAAF,sBAAA,IAAeC,UAAA,CAAM,KAAK,qFAAqF,CAAA;AAC/G,MAAA;AAAA,IACF;AAEA,IAAA,MAAM,IAAA,GAAOE,uBAAkB,QAAQ,CAAA;AAEvC,IAAAC,oBAAA,CAAgB,MAAM;AACpB,MAAA,KAAA,CAAM,UAAU,IAAA,EAAM;AAAA,QACpB,MAAA,EAAQ,MAAA;AAAA,QACR,IAAA;AAAA,QACA,OAAA,EAAS;AAAA,UACP,cAAA,EAAgB;AAAA;AAClB,OACD,CAAA,CAAE,IAAA;AAAA,QACD,CAAA,GAAA,KAAO;AAGL,UAAA,GAAA,CAAI,IAAA,EAAK,CAAE,KAAA,CAAM,MAAM;AAAA,UAEvB,CAAC,CAAA;AAED,UAAA,IAAI,GAAA,CAAI,MAAA,IAAU,GAAA,IAAO,GAAA,CAAI,SAAS,GAAA,EAAK;AACzC,YAAA,SAAA,GAAY,CAAA;AAAA,UACd;AAAA,QACF,CAAA;AAAA,QACA,MAAM;AACJ,UAAA,SAAA,EAAA;AACA,UAAAJ,sBAAA,IAAeC,UAAA,CAAM,KAAK,0DAA0D,CAAA;AAAA,QACtF;AAAA,OACF;AAAA,IACF,CAAC,CAAA;AAAA,EACH,CAAC,CAAA;AACH;AAEA,SAAS,gBAAgB,GAAA,EAA8B;AACrD,EAAA,IAAI;AACF,IAAA,OAAO,IAAI,IAAI,GAAG,CAAA;AAAA,EACpB,CAAA,CAAA,MAAQ;AACN,IAAAD,sBAAA,IAAeC,UAAA,CAAM,IAAA,CAAK,CAAA,iCAAA,EAAoC,GAAG,CAAA,CAAE,CAAA;AACnE,IAAA,OAAO,MAAA;AAAA,EACT;AACF;;;;;"}
1
+ {"version":3,"file":"spotlight.js","names":["DEBUG_BUILD","debug","defineIntegration","serializeEnvelope","suppressTracing"],"sources":["../../../../src/integrations/spotlight.ts"],"sourcesContent":["import type { Client, Envelope, IntegrationFn } from '@sentry/core';\nimport { debug, defineIntegration, serializeEnvelope, suppressTracing } from '@sentry/core';\nimport { DEBUG_BUILD } from '../debug-build';\n\ntype SpotlightConnectionOptions = {\n /**\n * Set this if the Spotlight Sidecar is not running on localhost:8969.\n * By default, the URL is set to http://localhost:8969/stream\n */\n sidecarUrl?: string;\n};\n\nexport const INTEGRATION_NAME = 'Spotlight' as const;\n\nconst _spotlightIntegration = ((options: Partial<SpotlightConnectionOptions> = {}) => {\n const sidecarUrl = options.sidecarUrl || 'http://localhost:8969/stream';\n\n return {\n name: INTEGRATION_NAME,\n setup(client) {\n DEBUG_BUILD && debug.log('[Spotlight] Using Sidecar URL', sidecarUrl);\n setupSidecarForwarding(client, sidecarUrl);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Use this integration to send errors and transactions to Spotlight.\n *\n * Learn more about spotlight at https://spotlightjs.com\n *\n * Important: This integration is intended for local development only.\n * Each forwarded envelope counts as a Worker subrequest (50 free / 1000 paid\n * per invocation), so it should not be enabled in production.\n */\nexport const spotlightIntegration = defineIntegration(_spotlightIntegration);\n\nfunction setupSidecarForwarding(client: Client, sidecarUrl: string): void {\n const parsedUrl = parseSidecarUrl(sidecarUrl);\n if (!parsedUrl) {\n return;\n }\n\n let failCount = 0;\n\n client.on('beforeEnvelope', (envelope: Envelope) => {\n if (failCount > 3) {\n DEBUG_BUILD && debug.warn('[Spotlight] Disabled Sentry -> Spotlight forwarding due to too many failed requests');\n return;\n }\n\n const body = serializeEnvelope(envelope);\n\n suppressTracing(() => {\n fetch(parsedUrl.href, {\n method: 'POST',\n body,\n headers: {\n 'Content-Type': 'application/x-sentry-envelope',\n },\n }).then(\n res => {\n // Consume the response body to satisfy Cloudflare Workers' requirement\n // that all fetch response bodies are read or cancelled.\n res.text().catch(() => {\n // no-op\n });\n\n if (res.status >= 200 && res.status < 400) {\n failCount = 0;\n }\n },\n () => {\n failCount++;\n DEBUG_BUILD && debug.warn('[Spotlight] Failed to send envelope to Spotlight Sidecar');\n },\n );\n });\n });\n}\n\nfunction parseSidecarUrl(url: string): URL | undefined {\n try {\n return new URL(url);\n } catch {\n DEBUG_BUILD && debug.warn(`[Spotlight] Invalid sidecar URL: ${url}`);\n return undefined;\n }\n}\n"],"mappings":";;;AAYA,MAAa,mBAAmB;AAEhC,MAAM,0BAA0B,UAA+C,CAAC,MAAM;CACpF,MAAM,aAAa,QAAQ,cAAc;CAEzC,OAAO;EACL,MAAM;EACN,MAAM,QAAQ;GACZA,oBAAAA,eAAeC,aAAAA,MAAM,IAAI,iCAAiC,UAAU;GACpE,uBAAuB,QAAQ,UAAU;EAC3C;CACF;AACF;;;;;;;;;;AAWA,MAAa,wBAAA,GAAuBC,aAAAA,kBAAAA,CAAkB,qBAAqB;AAE3E,SAAS,uBAAuB,QAAgB,YAA0B;CACxE,MAAM,YAAY,gBAAgB,UAAU;CAC5C,IAAI,CAAC,WACH;CAGF,IAAI,YAAY;CAEhB,OAAO,GAAG,mBAAmB,aAAuB;EAClD,IAAI,YAAY,GAAG;GACjBF,oBAAAA,eAAeC,aAAAA,MAAM,KAAK,qFAAqF;GAC/G;EACF;EAEA,MAAM,QAAA,GAAOE,aAAAA,kBAAAA,CAAkB,QAAQ;EAEvCC,CAAAA,GAAAA,aAAAA,gBAAAA,OAAsB;GACpB,MAAM,UAAU,MAAM;IACpB,QAAQ;IACR;IACA,SAAS,EACP,gBAAgB,gCAClB;GACF,CAAC,CAAC,CAAC,MACD,QAAO;IAGL,IAAI,KAAK,CAAC,CAAC,YAAY,CAEvB,CAAC;IAED,IAAI,IAAI,UAAU,OAAO,IAAI,SAAS,KACpC,YAAY;GAEhB,SACM;IACJ;IACAJ,oBAAAA,eAAeC,aAAAA,MAAM,KAAK,0DAA0D;GACtF,CACF;EACF,CAAC;CACH,CAAC;AACH;AAEA,SAAS,gBAAgB,KAA8B;CACrD,IAAI;EACF,OAAO,IAAI,IAAI,GAAG;CACpB,QAAQ;EACND,oBAAAA,eAAeC,aAAAA,MAAM,KAAK,oCAAoC,KAAK;EACnE;CACF;AACF"}
@@ -1,11 +1,13 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
-
3
- const api = require('@opentelemetry/api');
4
- const opentelemetry = require('@sentry/opentelemetry');
5
-
1
+ let _opentelemetry_api = require("@opentelemetry/api");
2
+ let _sentry_opentelemetry = require("@sentry/opentelemetry");
3
+ // src/opentelemetry/tracer.ts
4
+ /**
5
+ * Set up a mock OTEL tracer to allow inter-op with OpenTelemetry emitted spans.
6
+ * This is not perfect but handles easy/common use cases.
7
+ */
6
8
  function setupOpenTelemetryTracer() {
7
- api.trace.setGlobalTracerProvider(new opentelemetry.SentryTracerProvider());
9
+ _opentelemetry_api.trace.setGlobalTracerProvider(new _sentry_opentelemetry.SentryTracerProvider());
8
10
  }
9
-
10
11
  exports.setupOpenTelemetryTracer = setupOpenTelemetryTracer;
11
- //# sourceMappingURL=tracer.js.map
12
+
13
+ //# sourceMappingURL=tracer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tracer.js","sources":["../../../../src/opentelemetry/tracer.ts"],"sourcesContent":["import { trace } from '@opentelemetry/api';\nimport { SentryTracerProvider } from '@sentry/opentelemetry';\n\n/**\n * Set up a mock OTEL tracer to allow inter-op with OpenTelemetry emitted spans.\n * This is not perfect but handles easy/common use cases.\n */\nexport function setupOpenTelemetryTracer(): void {\n trace.setGlobalTracerProvider(new SentryTracerProvider());\n}\n"],"names":["trace","SentryTracerProvider"],"mappings":";;;;;AAOO,SAAS,wBAAA,GAAiC;AAC/C,EAAAA,SAAA,CAAM,uBAAA,CAAwB,IAAIC,kCAAA,EAAsB,CAAA;AAC1D;;;;"}
1
+ {"version":3,"file":"tracer.js","names":["trace","SentryTracerProvider"],"sources":["../../../../src/opentelemetry/tracer.ts"],"sourcesContent":["import { trace } from '@opentelemetry/api';\nimport { SentryTracerProvider } from '@sentry/opentelemetry';\n\n/**\n * Set up a mock OTEL tracer to allow inter-op with OpenTelemetry emitted spans.\n * This is not perfect but handles easy/common use cases.\n */\nexport function setupOpenTelemetryTracer(): void {\n trace.setGlobalTracerProvider(new SentryTracerProvider());\n}\n"],"mappings":";;;;;;;AAOA,SAAgB,2BAAiC;CAC/CA,mBAAAA,MAAM,wBAAwB,IAAIC,sBAAAA,qBAAqB,CAAC;AAC1D"}
@@ -1,33 +1,47 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
-
3
- const core = require('@sentry/core');
4
-
1
+ let _sentry_core = require("@sentry/core");
2
+ // src/options.ts
3
+ /**
4
+ * Checks if the value is a valid CF_VERSION_METADATA binding.
5
+ */
5
6
  function isVersionMetadata(value) {
6
- return core.isObjectLike(value) && "id" in value && typeof value.id === "string";
7
+ return (0, _sentry_core.isObjectLike)(value) && "id" in value && typeof value.id === "string";
7
8
  }
8
9
  function getEnvVar(env, varName) {
9
- return core.isObjectLike(env) && varName in env && typeof env[varName] === "string" ? env[varName] : void 0;
10
+ return (0, _sentry_core.isObjectLike)(env) && varName in env && typeof env[varName] === "string" ? env[varName] : void 0;
10
11
  }
12
+ /**
13
+ * Merges the options passed in from the user with the options we read from
14
+ * the Cloudflare `env` environment variable object.
15
+ *
16
+ * Release is determined with the following priority (highest to lowest):
17
+ * 1. User-provided release option
18
+ * 2. SENTRY_RELEASE environment variable
19
+ * 3. CF_VERSION_METADATA.id binding (if configured in the wrangler config)
20
+ *
21
+ * @param userOptions - The options passed in from the user.
22
+ * @param env - The environment variables.
23
+ *
24
+ * @returns The final options.
25
+ */
11
26
  function getFinalOptions(userOptions = {}, env) {
12
- if (!core.isObjectLike(env)) {
13
- return userOptions;
14
- }
15
- const release = "SENTRY_RELEASE" in env && typeof env.SENTRY_RELEASE === "string" ? env.SENTRY_RELEASE : "CF_VERSION_METADATA" in env && isVersionMetadata(env.CF_VERSION_METADATA) ? env.CF_VERSION_METADATA.id : void 0;
16
- const tracesSampleRate = userOptions.tracesSampleRate ?? parseFloat(getEnvVar(env, "SENTRY_TRACES_SAMPLE_RATE") ?? "");
17
- return {
18
- release,
19
- ...userOptions,
20
- dsn: userOptions.dsn ?? getEnvVar(env, "SENTRY_DSN"),
21
- environment: userOptions.environment ?? getEnvVar(env, "SENTRY_ENVIRONMENT"),
22
- tracesSampleRate: isFinite(tracesSampleRate) ? tracesSampleRate : void 0,
23
- debug: userOptions.debug ?? core.envToBool(getEnvVar(env, "SENTRY_DEBUG")),
24
- tunnel: userOptions.tunnel ?? getEnvVar(env, "SENTRY_TUNNEL"),
25
- traceLifecycle: userOptions.traceLifecycle ?? getTraceLifecycleFromEnv(getEnvVar(env, "SENTRY_TRACE_LIFECYCLE"))
26
- };
27
+ if (!(0, _sentry_core.isObjectLike)(env)) return userOptions;
28
+ const release = "SENTRY_RELEASE" in env && typeof env.SENTRY_RELEASE === "string" ? env.SENTRY_RELEASE : "CF_VERSION_METADATA" in env && isVersionMetadata(env.CF_VERSION_METADATA) ? env.CF_VERSION_METADATA.id : void 0;
29
+ const tracesSampleRate = userOptions.tracesSampleRate ?? parseFloat(getEnvVar(env, "SENTRY_TRACES_SAMPLE_RATE") ?? "");
30
+ return {
31
+ release,
32
+ ...userOptions,
33
+ dsn: userOptions.dsn ?? getEnvVar(env, "SENTRY_DSN"),
34
+ environment: userOptions.environment ?? getEnvVar(env, "SENTRY_ENVIRONMENT"),
35
+ serverName: userOptions.serverName ?? getEnvVar(env, "SENTRY_NAME"),
36
+ tracesSampleRate: isFinite(tracesSampleRate) ? tracesSampleRate : void 0,
37
+ debug: userOptions.debug ?? (0, _sentry_core.envToBool)(getEnvVar(env, "SENTRY_DEBUG")),
38
+ tunnel: userOptions.tunnel ?? getEnvVar(env, "SENTRY_TUNNEL"),
39
+ traceLifecycle: userOptions.traceLifecycle ?? getTraceLifecycleFromEnv(getEnvVar(env, "SENTRY_TRACE_LIFECYCLE"))
40
+ };
27
41
  }
28
42
  function getTraceLifecycleFromEnv(envVar) {
29
- return envVar === "stream" || envVar === "static" ? envVar : void 0;
43
+ return envVar === "stream" || envVar === "static" ? envVar : void 0;
30
44
  }
31
-
32
45
  exports.getFinalOptions = getFinalOptions;
33
- //# sourceMappingURL=options.js.map
46
+
47
+ //# sourceMappingURL=options.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"options.js","sources":["../../../src/options.ts"],"sourcesContent":["import { isObjectLike, envToBool } from '@sentry/core';\nimport type { CloudflareOptions } from './client';\n\n/**\n * Cloudflare's version metadata binding structure.\n * @see https://developers.cloudflare.com/workers/runtime-apis/bindings/version-metadata/\n */\ninterface CfVersionMetadata {\n id: string;\n tag?: string;\n timestamp?: string;\n}\n\n/**\n * Checks if the value is a valid CF_VERSION_METADATA binding.\n */\nfunction isVersionMetadata(value: unknown): value is CfVersionMetadata {\n return isObjectLike(value) && 'id' in value && typeof value.id === 'string';\n}\n\nfunction getEnvVar<T extends Record<string, unknown>>(env: unknown, varName: keyof T): string | undefined {\n return isObjectLike(env) && varName in env && typeof (env as T)[varName] === 'string'\n ? ((env as T)[varName] as string)\n : undefined;\n}\n\n/**\n * Merges the options passed in from the user with the options we read from\n * the Cloudflare `env` environment variable object.\n *\n * Release is determined with the following priority (highest to lowest):\n * 1. User-provided release option\n * 2. SENTRY_RELEASE environment variable\n * 3. CF_VERSION_METADATA.id binding (if configured in the wrangler config)\n *\n * @param userOptions - The options passed in from the user.\n * @param env - The environment variables.\n *\n * @returns The final options.\n */\nexport function getFinalOptions(userOptions: CloudflareOptions = {}, env: unknown): CloudflareOptions {\n if (!isObjectLike(env)) {\n return userOptions;\n }\n\n // Priority: userOptions.release > SENTRY_RELEASE > CF_VERSION_METADATA.id\n const release =\n 'SENTRY_RELEASE' in env && typeof env.SENTRY_RELEASE === 'string'\n ? env.SENTRY_RELEASE\n : 'CF_VERSION_METADATA' in env && isVersionMetadata(env.CF_VERSION_METADATA)\n ? env.CF_VERSION_METADATA.id\n : undefined;\n\n const tracesSampleRate =\n userOptions.tracesSampleRate ?? parseFloat(getEnvVar(env, 'SENTRY_TRACES_SAMPLE_RATE') ?? '');\n\n // Spotlight precedence (mirrors node-core's getSpotlightConfig):\n // - false or explicit string from options: use as-is\n // - true: enable, but prefer a custom URL from the env var if set\n // - undefined: defer entirely to the env var (bool or URL)\n /*! rollup-include-development-only */\n const spotlight = getSpotlightFromEnv(userOptions.spotlight, getEnvVar(env, 'SENTRY_SPOTLIGHT'));\n /*! rollup-include-development-only-end */\n\n return {\n release,\n ...userOptions,\n dsn: userOptions.dsn ?? getEnvVar(env, 'SENTRY_DSN'),\n environment: userOptions.environment ?? getEnvVar(env, 'SENTRY_ENVIRONMENT'),\n tracesSampleRate: isFinite(tracesSampleRate) ? tracesSampleRate : undefined,\n debug: userOptions.debug ?? envToBool(getEnvVar(env, 'SENTRY_DEBUG')),\n tunnel: userOptions.tunnel ?? getEnvVar(env, 'SENTRY_TUNNEL'),\n traceLifecycle: userOptions.traceLifecycle ?? getTraceLifecycleFromEnv(getEnvVar(env, 'SENTRY_TRACE_LIFECYCLE')),\n /*! rollup-include-development-only */\n spotlight,\n /*! rollup-include-development-only-end */\n };\n}\n\n/**\n * Resolve the spotlight option from a user-supplied value and an env binding string.\n * Mirrors node-core's `getSpotlightConfig` precedence:\n * - `false` or explicit string from options → use as-is\n * - `true` → enable, but prefer a custom URL from the env var if set\n * - `undefined` → defer entirely to the env var (bool or URL)\n */\nfunction getSpotlightFromEnv(\n optionsSpotlight: boolean | string | undefined,\n envVar: string | undefined,\n): boolean | string | undefined {\n if (optionsSpotlight === false) {\n return false;\n }\n if (typeof optionsSpotlight === 'string') {\n return optionsSpotlight;\n }\n\n // optionsSpotlight is true or undefined\n const envBool = envToBool(envVar, { strict: true });\n const envUrl = envBool === null && envVar ? envVar : undefined;\n\n return optionsSpotlight === true\n ? (envUrl ?? true) // true: use env URL if present, otherwise true\n : (envBool ?? envUrl); // undefined: use env var (bool or URL)\n}\n\nfunction getTraceLifecycleFromEnv(envVar: string | undefined): 'static' | 'stream' | undefined {\n return envVar === 'stream' || envVar === 'static' ? envVar : undefined;\n}\n"],"names":["isObjectLike","envToBool"],"mappings":";;;;AAgBA,SAAS,kBAAkB,KAAA,EAA4C;AACrE,EAAA,OAAOA,kBAAa,KAAK,CAAA,IAAK,QAAQ,KAAA,IAAS,OAAO,MAAM,EAAA,KAAO,QAAA;AACrE;AAEA,SAAS,SAAA,CAA6C,KAAc,OAAA,EAAsC;AACxG,EAAA,OAAOA,iBAAA,CAAa,GAAG,CAAA,IAAK,OAAA,IAAW,GAAA,IAAO,OAAQ,GAAA,CAAU,OAAO,CAAA,KAAM,QAAA,GACvE,GAAA,CAAU,OAAO,CAAA,GACnB,MAAA;AACN;AAgBO,SAAS,eAAA,CAAgB,WAAA,GAAiC,EAAC,EAAG,GAAA,EAAiC;AACpG,EAAA,IAAI,CAACA,iBAAA,CAAa,GAAG,CAAA,EAAG;AACtB,IAAA,OAAO,WAAA;AAAA,EACT;AAGA,EAAA,MAAM,UACJ,gBAAA,IAAoB,GAAA,IAAO,OAAO,GAAA,CAAI,mBAAmB,QAAA,GACrD,GAAA,CAAI,cAAA,GACJ,qBAAA,IAAyB,OAAO,iBAAA,CAAkB,GAAA,CAAI,mBAAmB,CAAA,GACvE,GAAA,CAAI,oBAAoB,EAAA,GACxB,MAAA;AAER,EAAA,MAAM,gBAAA,GACJ,YAAY,gBAAA,IAAoB,UAAA,CAAW,UAAU,GAAA,EAAK,2BAA2B,KAAK,EAAE,CAAA;AAM9F,EAAA,OAAO;AAAA,IACL,OAAA;AAAA,IACA,GAAG,WAAA;AAAA,IACH,GAAA,EAAK,WAAA,CAAY,GAAA,IAAO,SAAA,CAAU,KAAK,YAAY,CAAA;AAAA,IACnD,WAAA,EAAa,WAAA,CAAY,WAAA,IAAe,SAAA,CAAU,KAAK,oBAAoB,CAAA;AAAA,IAC3E,gBAAA,EAAkB,QAAA,CAAS,gBAAgB,CAAA,GAAI,gBAAA,GAAmB,MAAA;AAAA,IAClE,OAAO,WAAA,CAAY,KAAA,IAASC,eAAU,SAAA,CAAU,GAAA,EAAK,cAAc,CAAC,CAAA;AAAA,IACpE,MAAA,EAAQ,WAAA,CAAY,MAAA,IAAU,SAAA,CAAU,KAAK,eAAe,CAAA;AAAA,IAC5D,gBAAgB,WAAA,CAAY,cAAA,IAAkB,yBAAyB,SAAA,CAAU,GAAA,EAAK,wBAAwB,CAAC;AAAA,GAC/G;AACJ;AA6BA,SAAS,yBAAyB,MAAA,EAA6D;AAC7F,EAAA,OAAO,MAAA,KAAW,QAAA,IAAY,MAAA,KAAW,QAAA,GAAW,MAAA,GAAS,MAAA;AAC/D;;;;"}
1
+ {"version":3,"file":"options.js","names":["isObjectLike","envToBool"],"sources":["../../../src/options.ts"],"sourcesContent":["import { isObjectLike, envToBool } from '@sentry/core';\nimport type { CloudflareOptions } from './client';\n\n/**\n * Cloudflare's version metadata binding structure.\n * @see https://developers.cloudflare.com/workers/runtime-apis/bindings/version-metadata/\n */\ninterface CfVersionMetadata {\n id: string;\n tag?: string;\n timestamp?: string;\n}\n\n/**\n * Checks if the value is a valid CF_VERSION_METADATA binding.\n */\nfunction isVersionMetadata(value: unknown): value is CfVersionMetadata {\n return isObjectLike(value) && 'id' in value && typeof value.id === 'string';\n}\n\nfunction getEnvVar<T extends Record<string, unknown>>(env: unknown, varName: keyof T): string | undefined {\n return isObjectLike(env) && varName in env && typeof (env as T)[varName] === 'string'\n ? ((env as T)[varName] as string)\n : undefined;\n}\n\n/**\n * Merges the options passed in from the user with the options we read from\n * the Cloudflare `env` environment variable object.\n *\n * Release is determined with the following priority (highest to lowest):\n * 1. User-provided release option\n * 2. SENTRY_RELEASE environment variable\n * 3. CF_VERSION_METADATA.id binding (if configured in the wrangler config)\n *\n * @param userOptions - The options passed in from the user.\n * @param env - The environment variables.\n *\n * @returns The final options.\n */\nexport function getFinalOptions(userOptions: CloudflareOptions = {}, env: unknown): CloudflareOptions {\n if (!isObjectLike(env)) {\n return userOptions;\n }\n\n // Priority: userOptions.release > SENTRY_RELEASE > CF_VERSION_METADATA.id\n const release =\n 'SENTRY_RELEASE' in env && typeof env.SENTRY_RELEASE === 'string'\n ? env.SENTRY_RELEASE\n : 'CF_VERSION_METADATA' in env && isVersionMetadata(env.CF_VERSION_METADATA)\n ? env.CF_VERSION_METADATA.id\n : undefined;\n\n const tracesSampleRate =\n userOptions.tracesSampleRate ?? parseFloat(getEnvVar(env, 'SENTRY_TRACES_SAMPLE_RATE') ?? '');\n\n // Spotlight precedence (mirrors node-core's getSpotlightConfig):\n // - false or explicit string from options: use as-is\n // - true: enable, but prefer a custom URL from the env var if set\n // - undefined: defer entirely to the env var (bool or URL)\n /*! rollup-include-development-only */\n const spotlight = getSpotlightFromEnv(userOptions.spotlight, getEnvVar(env, 'SENTRY_SPOTLIGHT'));\n /*! rollup-include-development-only-end */\n\n return {\n release,\n ...userOptions,\n dsn: userOptions.dsn ?? getEnvVar(env, 'SENTRY_DSN'),\n environment: userOptions.environment ?? getEnvVar(env, 'SENTRY_ENVIRONMENT'),\n serverName: userOptions.serverName ?? getEnvVar(env, 'SENTRY_NAME'),\n tracesSampleRate: isFinite(tracesSampleRate) ? tracesSampleRate : undefined,\n debug: userOptions.debug ?? envToBool(getEnvVar(env, 'SENTRY_DEBUG')),\n tunnel: userOptions.tunnel ?? getEnvVar(env, 'SENTRY_TUNNEL'),\n traceLifecycle: userOptions.traceLifecycle ?? getTraceLifecycleFromEnv(getEnvVar(env, 'SENTRY_TRACE_LIFECYCLE')),\n /*! rollup-include-development-only */\n spotlight,\n /*! rollup-include-development-only-end */\n };\n}\n\n/**\n * Resolve the spotlight option from a user-supplied value and an env binding string.\n * Mirrors node-core's `getSpotlightConfig` precedence:\n * - `false` or explicit string from options → use as-is\n * - `true` → enable, but prefer a custom URL from the env var if set\n * - `undefined` → defer entirely to the env var (bool or URL)\n */\nfunction getSpotlightFromEnv(\n optionsSpotlight: boolean | string | undefined,\n envVar: string | undefined,\n): boolean | string | undefined {\n if (optionsSpotlight === false) {\n return false;\n }\n if (typeof optionsSpotlight === 'string') {\n return optionsSpotlight;\n }\n\n // optionsSpotlight is true or undefined\n const envBool = envToBool(envVar, { strict: true });\n const envUrl = envBool === null && envVar ? envVar : undefined;\n\n return optionsSpotlight === true\n ? (envUrl ?? true) // true: use env URL if present, otherwise true\n : (envBool ?? envUrl); // undefined: use env var (bool or URL)\n}\n\nfunction getTraceLifecycleFromEnv(envVar: string | undefined): 'static' | 'stream' | undefined {\n return envVar === 'stream' || envVar === 'static' ? envVar : undefined;\n}\n"],"mappings":";;;;;AAgBA,SAAS,kBAAkB,OAA4C;CACrE,QAAA,GAAOA,aAAAA,aAAAA,CAAa,KAAK,KAAK,QAAQ,SAAS,OAAO,MAAM,OAAO;AACrE;AAEA,SAAS,UAA6C,KAAc,SAAsC;CACxG,QAAA,GAAOA,aAAAA,aAAAA,CAAa,GAAG,KAAK,WAAW,OAAO,OAAQ,IAAU,aAAa,WACvE,IAAU,WACZ,KAAA;AACN;;;;;;;;;;;;;;;AAgBA,SAAgB,gBAAgB,cAAiC,CAAC,GAAG,KAAiC;CACpG,IAAI,EAAA,GAACA,aAAAA,aAAAA,CAAa,GAAG,GACnB,OAAO;CAIT,MAAM,UACJ,oBAAoB,OAAO,OAAO,IAAI,mBAAmB,WACrD,IAAI,iBACJ,yBAAyB,OAAO,kBAAkB,IAAI,mBAAmB,IACvE,IAAI,oBAAoB,KACxB,KAAA;CAER,MAAM,mBACJ,YAAY,oBAAoB,WAAW,UAAU,KAAK,2BAA2B,KAAK,EAAE;CAM9F,OAAO;EACL;EACA,GAAG;EACH,KAAK,YAAY,OAAO,UAAU,KAAK,YAAY;EACnD,aAAa,YAAY,eAAe,UAAU,KAAK,oBAAoB;EAC3E,YAAY,YAAY,cAAc,UAAU,KAAK,aAAa;EAClE,kBAAkB,SAAS,gBAAgB,IAAI,mBAAmB,KAAA;EAClE,OAAO,YAAY,UAAA,GAASC,aAAAA,UAAAA,CAAU,UAAU,KAAK,cAAc,CAAC;EACpE,QAAQ,YAAY,UAAU,UAAU,KAAK,eAAe;EAC5D,gBAAgB,YAAY,kBAAkB,yBAAyB,UAAU,KAAK,wBAAwB,CAAC;CAC/G;AACJ;AA6BA,SAAS,yBAAyB,QAA6D;CAC7F,OAAO,WAAW,YAAY,WAAW,WAAW,SAAS,KAAA;AAC/D"}
@@ -1,39 +1,55 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
-
3
- const core = require('@sentry/core');
4
- const debugBuild = require('./debug-build.js');
5
-
1
+ const require_debug_build = require("./debug-build.js");
2
+ let _sentry_core = require("@sentry/core");
3
+ // src/orchestrion-deferred-channels.ts
4
+ /**
5
+ * Deferral for orchestrion channel events that could not be published when they occurred.
6
+ *
7
+ * On workerd, `channel.publish()`/`runStores()` throw at module/global scope, so a library
8
+ * instantiated at module scope (`const app = new Hono()`) cannot emit its wrapping event
9
+ * there. {@link ./orchestrion-diagnostics-channel} defers those events here;
10
+ * {@link flushDeferredChannelEvents} emits them once a request is being handled (where
11
+ * publish works) and the SDK's `init()` has registered subscribers.
12
+ *
13
+ * This module imports NO `node:*` builtin, so it is safe to pull into the request wrapper on
14
+ * runtimes without `nodejs_compat` — there the queue is always empty (no channels were ever
15
+ * injected) and the flush is a no-op.
16
+ */
6
17
  const deferred = [];
7
- const DEFERRED = /* @__PURE__ */ Symbol("sentryOrchestrionDeferred");
18
+ const DEFERRED = Symbol("sentryOrchestrionDeferred");
19
+ /** workerd's global-scope guard is the only error we degrade on; anything else is a real fault. */
8
20
  function isGlobalScopeError(error) {
9
- return error instanceof Error && /within global scope/.test(error.message);
21
+ return error instanceof Error && /within global scope/.test(error.message);
10
22
  }
23
+ /** Queue a channel event that could not be published now, at most once per context object. */
11
24
  function deferChannelEvent(channel, ctx) {
12
- if (ctx[DEFERRED]) {
13
- return;
14
- }
15
- ctx[DEFERRED] = true;
16
- deferred.push({ channel, ctx, hadError: "error" in ctx });
25
+ if (ctx[DEFERRED]) return;
26
+ ctx[DEFERRED] = true;
27
+ deferred.push({
28
+ channel,
29
+ ctx,
30
+ hadError: "error" in ctx
31
+ });
17
32
  }
33
+ /**
34
+ * Emit every deferred channel event via the real channel. Called at the top of the request
35
+ * handler, after `init()` has subscribed. Uses bare `start`/`end` publish (never `runStores`),
36
+ * so no `bindStore` producer runs and no span is parented to this request — only the plain
37
+ * subscribers (the instance patchers) fire. Idempotent: it drains the queue, so later requests
38
+ * and re-entrant calls are no-ops.
39
+ */
18
40
  function flushDeferredChannelEvents() {
19
- if (deferred.length === 0) {
20
- return;
21
- }
22
- const pending = deferred.splice(0, deferred.length);
23
- for (const { channel, ctx, hadError } of pending) {
24
- try {
25
- channel.start.publish(ctx);
26
- if (hadError) {
27
- channel.error.publish(ctx);
28
- }
29
- channel.end.publish(ctx);
30
- } catch (error) {
31
- debugBuild.DEBUG_BUILD && core.debug.warn("[orchestrion] failed to emit a deferred channel event", error);
32
- }
33
- }
41
+ if (deferred.length === 0) return;
42
+ const pending = deferred.splice(0, deferred.length);
43
+ for (const { channel, ctx, hadError } of pending) try {
44
+ channel.start.publish(ctx);
45
+ if (hadError) channel.error.publish(ctx);
46
+ channel.end.publish(ctx);
47
+ } catch (error) {
48
+ require_debug_build.DEBUG_BUILD && _sentry_core.debug.warn("[orchestrion] failed to emit a deferred channel event", error);
49
+ }
34
50
  }
35
-
36
51
  exports.deferChannelEvent = deferChannelEvent;
37
52
  exports.flushDeferredChannelEvents = flushDeferredChannelEvents;
38
53
  exports.isGlobalScopeError = isGlobalScopeError;
39
- //# sourceMappingURL=orchestrion-deferred-channels.js.map
54
+
55
+ //# sourceMappingURL=orchestrion-deferred-channels.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"orchestrion-deferred-channels.js","sources":["../../../src/orchestrion-deferred-channels.ts"],"sourcesContent":["/**\n * Deferral for orchestrion channel events that could not be published when they occurred.\n *\n * On workerd, `channel.publish()`/`runStores()` throw at module/global scope, so a library\n * instantiated at module scope (`const app = new Hono()`) cannot emit its wrapping event\n * there. {@link ./orchestrion-diagnostics-channel} defers those events here;\n * {@link flushDeferredChannelEvents} emits them once a request is being handled (where\n * publish works) and the SDK's `init()` has registered subscribers.\n *\n * This module imports NO `node:*` builtin, so it is safe to pull into the request wrapper on\n * runtimes without `nodejs_compat` — there the queue is always empty (no channels were ever\n * injected) and the flush is a no-op.\n */\nimport { debug } from '@sentry/core';\nimport { DEBUG_BUILD } from './debug-build';\n\ntype Ctx = Record<string, unknown>;\n\n// The minimal slice of a `node:diagnostics_channel` TracingChannel we emit on. Declared locally\n// (rather than imported from `node:diagnostics_channel`) so this module's graph carries no `node:`\n// specifier — `wrapRequestHandler` must load on runtimes without `nodejs_compat`, and the\n// module-graph test forbids any `node:` import reachable from it.\ninterface PublishableTracingChannel {\n start: { publish(ctx: Ctx): void };\n end: { publish(ctx: Ctx): void };\n error: { publish(ctx: Ctx): void };\n}\n\ninterface DeferredChannelEvent {\n channel: PublishableTracingChannel;\n ctx: Ctx;\n hadError: boolean;\n}\n\nconst deferred: DeferredChannelEvent[] = [];\nconst DEFERRED = Symbol('sentryOrchestrionDeferred');\n\n/** workerd's global-scope guard is the only error we degrade on; anything else is a real fault. */\nexport function isGlobalScopeError(error: unknown): boolean {\n return error instanceof Error && /within global scope/.test(error.message);\n}\n\n/** Queue a channel event that could not be published now, at most once per context object. */\nexport function deferChannelEvent(channel: PublishableTracingChannel, ctx: Ctx): void {\n if ((ctx as Record<symbol, unknown>)[DEFERRED]) {\n return;\n }\n (ctx as Record<symbol, unknown>)[DEFERRED] = true;\n deferred.push({ channel, ctx, hadError: 'error' in ctx });\n}\n\n/**\n * Emit every deferred channel event via the real channel. Called at the top of the request\n * handler, after `init()` has subscribed. Uses bare `start`/`end` publish (never `runStores`),\n * so no `bindStore` producer runs and no span is parented to this request — only the plain\n * subscribers (the instance patchers) fire. Idempotent: it drains the queue, so later requests\n * and re-entrant calls are no-ops.\n */\nexport function flushDeferredChannelEvents(): void {\n if (deferred.length === 0) {\n return;\n }\n const pending = deferred.splice(0, deferred.length);\n for (const { channel, ctx, hadError } of pending) {\n try {\n channel.start.publish(ctx);\n if (hadError) {\n channel.error.publish(ctx);\n }\n channel.end.publish(ctx);\n } catch (error) {\n DEBUG_BUILD && debug.warn('[orchestrion] failed to emit a deferred channel event', error);\n }\n }\n}\n"],"names":["DEBUG_BUILD","debug"],"mappings":";;;;;AAkCA,MAAM,WAAmC,EAAC;AAC1C,MAAM,QAAA,0BAAkB,2BAA2B,CAAA;AAG5C,SAAS,mBAAmB,KAAA,EAAyB;AAC1D,EAAA,OAAO,KAAA,YAAiB,KAAA,IAAS,qBAAA,CAAsB,IAAA,CAAK,MAAM,OAAO,CAAA;AAC3E;AAGO,SAAS,iBAAA,CAAkB,SAAoC,GAAA,EAAgB;AACpF,EAAA,IAAK,GAAA,CAAgC,QAAQ,CAAA,EAAG;AAC9C,IAAA;AAAA,EACF;AACA,EAAC,GAAA,CAAgC,QAAQ,CAAA,GAAI,IAAA;AAC7C,EAAA,QAAA,CAAS,KAAK,EAAE,OAAA,EAAS,KAAK,QAAA,EAAU,OAAA,IAAW,KAAK,CAAA;AAC1D;AASO,SAAS,0BAAA,GAAmC;AACjD,EAAA,IAAI,QAAA,CAAS,WAAW,CAAA,EAAG;AACzB,IAAA;AAAA,EACF;AACA,EAAA,MAAM,OAAA,GAAU,QAAA,CAAS,MAAA,CAAO,CAAA,EAAG,SAAS,MAAM,CAAA;AAClD,EAAA,KAAA,MAAW,EAAE,OAAA,EAAS,GAAA,EAAK,QAAA,MAAc,OAAA,EAAS;AAChD,IAAA,IAAI;AACF,MAAA,OAAA,CAAQ,KAAA,CAAM,QAAQ,GAAG,CAAA;AACzB,MAAA,IAAI,QAAA,EAAU;AACZ,QAAA,OAAA,CAAQ,KAAA,CAAM,QAAQ,GAAG,CAAA;AAAA,MAC3B;AACA,MAAA,OAAA,CAAQ,GAAA,CAAI,QAAQ,GAAG,CAAA;AAAA,IACzB,SAAS,KAAA,EAAO;AACd,MAAAA,sBAAA,IAAeC,UAAA,CAAM,IAAA,CAAK,uDAAA,EAAyD,KAAK,CAAA;AAAA,IAC1F;AAAA,EACF;AACF;;;;;;"}
1
+ {"version":3,"file":"orchestrion-deferred-channels.js","names":["DEBUG_BUILD","debug"],"sources":["../../../src/orchestrion-deferred-channels.ts"],"sourcesContent":["/**\n * Deferral for orchestrion channel events that could not be published when they occurred.\n *\n * On workerd, `channel.publish()`/`runStores()` throw at module/global scope, so a library\n * instantiated at module scope (`const app = new Hono()`) cannot emit its wrapping event\n * there. {@link ./orchestrion-diagnostics-channel} defers those events here;\n * {@link flushDeferredChannelEvents} emits them once a request is being handled (where\n * publish works) and the SDK's `init()` has registered subscribers.\n *\n * This module imports NO `node:*` builtin, so it is safe to pull into the request wrapper on\n * runtimes without `nodejs_compat` — there the queue is always empty (no channels were ever\n * injected) and the flush is a no-op.\n */\nimport { debug } from '@sentry/core';\nimport { DEBUG_BUILD } from './debug-build';\n\ntype Ctx = Record<string, unknown>;\n\n// The minimal slice of a `node:diagnostics_channel` TracingChannel we emit on. Declared locally\n// (rather than imported from `node:diagnostics_channel`) so this module's graph carries no `node:`\n// specifier — `wrapRequestHandler` must load on runtimes without `nodejs_compat`, and the\n// module-graph test forbids any `node:` import reachable from it.\ninterface PublishableTracingChannel {\n start: { publish(ctx: Ctx): void };\n end: { publish(ctx: Ctx): void };\n error: { publish(ctx: Ctx): void };\n}\n\ninterface DeferredChannelEvent {\n channel: PublishableTracingChannel;\n ctx: Ctx;\n hadError: boolean;\n}\n\nconst deferred: DeferredChannelEvent[] = [];\nconst DEFERRED = Symbol('sentryOrchestrionDeferred');\n\n/** workerd's global-scope guard is the only error we degrade on; anything else is a real fault. */\nexport function isGlobalScopeError(error: unknown): boolean {\n return error instanceof Error && /within global scope/.test(error.message);\n}\n\n/** Queue a channel event that could not be published now, at most once per context object. */\nexport function deferChannelEvent(channel: PublishableTracingChannel, ctx: Ctx): void {\n if ((ctx as Record<symbol, unknown>)[DEFERRED]) {\n return;\n }\n (ctx as Record<symbol, unknown>)[DEFERRED] = true;\n deferred.push({ channel, ctx, hadError: 'error' in ctx });\n}\n\n/**\n * Emit every deferred channel event via the real channel. Called at the top of the request\n * handler, after `init()` has subscribed. Uses bare `start`/`end` publish (never `runStores`),\n * so no `bindStore` producer runs and no span is parented to this request — only the plain\n * subscribers (the instance patchers) fire. Idempotent: it drains the queue, so later requests\n * and re-entrant calls are no-ops.\n */\nexport function flushDeferredChannelEvents(): void {\n if (deferred.length === 0) {\n return;\n }\n const pending = deferred.splice(0, deferred.length);\n for (const { channel, ctx, hadError } of pending) {\n try {\n channel.start.publish(ctx);\n if (hadError) {\n channel.error.publish(ctx);\n }\n channel.end.publish(ctx);\n } catch (error) {\n DEBUG_BUILD && debug.warn('[orchestrion] failed to emit a deferred channel event', error);\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAkCA,MAAM,WAAmC,CAAC;AAC1C,MAAM,WAAW,OAAO,2BAA2B;;AAGnD,SAAgB,mBAAmB,OAAyB;CAC1D,OAAO,iBAAiB,SAAS,sBAAsB,KAAK,MAAM,OAAO;AAC3E;;AAGA,SAAgB,kBAAkB,SAAoC,KAAgB;CACpF,IAAK,IAAgC,WACnC;CAED,IAAgC,YAAY;CAC7C,SAAS,KAAK;EAAE;EAAS;EAAK,UAAU,WAAW;CAAI,CAAC;AAC1D;;;;;;;;AASA,SAAgB,6BAAmC;CACjD,IAAI,SAAS,WAAW,GACtB;CAEF,MAAM,UAAU,SAAS,OAAO,GAAG,SAAS,MAAM;CAClD,KAAK,MAAM,EAAE,SAAS,KAAK,cAAc,SACvC,IAAI;EACF,QAAQ,MAAM,QAAQ,GAAG;EACzB,IAAI,UACF,QAAQ,MAAM,QAAQ,GAAG;EAE3B,QAAQ,IAAI,QAAQ,GAAG;CACzB,SAAS,OAAO;EACdA,oBAAAA,eAAeC,aAAAA,MAAM,KAAK,yDAAyD,KAAK;CAC1F;AAEJ"}
@@ -1,83 +1,108 @@
1
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
2
-
3
- const realDc = require('node:diagnostics_channel');
4
- const orchestrionDeferredChannels = require('./orchestrion-deferred-channels.js');
5
-
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
4
+ });
5
+ const require_runtime = require("./_virtual/_rolldown/runtime.js");
6
+ const require_orchestrion_deferred_channels = require("./orchestrion-deferred-channels.js");
7
+ let node_diagnostics_channel = require("node:diagnostics_channel");
8
+ node_diagnostics_channel = require_runtime.__toESM(node_diagnostics_channel);
9
+ // src/orchestrion-diagnostics-channel.ts
10
+ /**
11
+ * A workerd-safe `diagnostics_channel` façade for the orchestrion EMIT side, and the
12
+ * `dcModule` target for the Cloudflare orchestrion build (see `vite/index.ts`): orchestrion's
13
+ * transformed code imports `tracingChannel` from here (its default export) instead of
14
+ * `node:diagnostics_channel`.
15
+ *
16
+ * On workerd, `channel.publish()` and `channel.runStores()` throw at module/global scope
17
+ * ("Disallowed operation called within global scope …"); only inside a request handler do they
18
+ * work. `subscribe` and channel creation are fine anywhere. Orchestrion's transformed code emits
19
+ * `start.runStores(...)` / `end.publish(...)` at each wrapped call site, so a library
20
+ * instantiated at module scope (`const app = new Hono()`) throws the moment it is wrapped — or,
21
+ * if no subscriber exists yet, is skipped by the wrapper's `if (!hasSubscribers) return
22
+ * __apm$traced()` short-circuit and never instrumented.
23
+ *
24
+ * This façade delegates to the real `node:diagnostics_channel` singletons — so subscribers, which
25
+ * keep subscribing through `node:diagnostics_channel`, are reached unchanged — and changes two
26
+ * things:
27
+ *
28
+ * 1. `hasSubscribers` always reports `true`, so the wrapper never short-circuits. On Cloudflare a
29
+ * channel is only injected for an integration that is actually bundled, so the short-circuit
30
+ * buys nothing — and disabling it is what lets the wrapper run (and reach us) at module scope,
31
+ * before the per-request cached `init()` has subscribed.
32
+ * 2. When a delegated `publish`/`runStores` throws the global-scope error, the event is queued via
33
+ * {@link deferChannelEvent} instead. {@link flushDeferredChannelEvents}, called at the top of
34
+ * the request handler after `init()`, emits it via the real channel — now inside a request,
35
+ * where publish works.
36
+ *
37
+ * In a request handler nothing throws, so every call is a transparent pass-through to the real
38
+ * channel: lifecycle channels (spans, context binding) behave exactly as on Node.
39
+ */
6
40
  const cache = /* @__PURE__ */ new Map();
7
41
  function channelHasSubscribers(ch) {
8
- const value = ch.hasSubscribers;
9
- return typeof value === "function" ? Boolean(value.call(ch)) : Boolean(value);
42
+ const value = ch.hasSubscribers;
43
+ return typeof value === "function" ? Boolean(value.call(ch)) : Boolean(value);
10
44
  }
11
45
  function wrapSubChannel(tracing, real) {
12
- return {
13
- name: real.name,
14
- // A method (not a getter) so it reads truthy as a property in the emit guard *and* is callable,
15
- // matching workerd's native shape. Forced `true`: on Cloudflare a channel is only injected for a
16
- // bundled integration, so the wrapper's no-subscriber short-circuit buys nothing — and disabling
17
- // it is what lets the wrapper run (and reach us) at module scope before `init()` has subscribed.
18
- hasSubscribers() {
19
- return true;
20
- },
21
- publish(ctx) {
22
- const hadSubscribers = channelHasSubscribers(real);
23
- try {
24
- real.publish(ctx);
25
- } catch (error) {
26
- if (!orchestrionDeferredChannels.isGlobalScopeError(error)) {
27
- throw error;
28
- }
29
- if (!hadSubscribers) {
30
- orchestrionDeferredChannels.deferChannelEvent(tracing, ctx);
31
- }
32
- }
33
- },
34
- runStores(ctx, fn, ...rest) {
35
- try {
36
- return real.runStores(ctx, fn, ...rest);
37
- } catch (error) {
38
- if (!orchestrionDeferredChannels.isGlobalScopeError(error)) {
39
- throw error;
40
- }
41
- return fn();
42
- }
43
- },
44
- subscribe: real.subscribe.bind(real),
45
- unsubscribe: real.unsubscribe.bind(real),
46
- bindStore: real.bindStore.bind(real),
47
- unbindStore: real.unbindStore.bind(real)
48
- };
46
+ return {
47
+ name: real.name,
48
+ hasSubscribers() {
49
+ return true;
50
+ },
51
+ publish(ctx) {
52
+ const hadSubscribers = channelHasSubscribers(real);
53
+ try {
54
+ real.publish(ctx);
55
+ } catch (error) {
56
+ if (!require_orchestrion_deferred_channels.isGlobalScopeError(error)) throw error;
57
+ if (!hadSubscribers) require_orchestrion_deferred_channels.deferChannelEvent(tracing, ctx);
58
+ }
59
+ },
60
+ runStores(ctx, fn, ...rest) {
61
+ try {
62
+ return real.runStores(ctx, fn, ...rest);
63
+ } catch (error) {
64
+ if (!require_orchestrion_deferred_channels.isGlobalScopeError(error)) throw error;
65
+ return fn();
66
+ }
67
+ },
68
+ subscribe: real.subscribe.bind(real),
69
+ unsubscribe: real.unsubscribe.bind(real),
70
+ bindStore: real.bindStore.bind(real),
71
+ unbindStore: real.unbindStore.bind(real)
72
+ };
49
73
  }
50
74
  function tracingChannel(name) {
51
- const cached = cache.get(name);
52
- if (cached) {
53
- return cached;
54
- }
55
- const real = realDc.tracingChannel(name);
56
- const facade = {
57
- start: wrapSubChannel(real, real.start),
58
- end: wrapSubChannel(real, real.end),
59
- asyncStart: wrapSubChannel(real, real.asyncStart),
60
- asyncEnd: wrapSubChannel(real, real.asyncEnd),
61
- error: wrapSubChannel(real, real.error),
62
- // Iterator (`:next`) channels call these on the tracingChannel itself; delegate to the real
63
- // implementation (they only run in-request, where publish/runStores are allowed).
64
- traceSync: real.traceSync.bind(real),
65
- tracePromise: real.tracePromise.bind(real),
66
- traceCallback: real.traceCallback.bind(real),
67
- subscribe: real.subscribe.bind(real),
68
- unsubscribe: real.unsubscribe.bind(real)
69
- };
70
- cache.set(name, facade);
71
- return facade;
75
+ const cached = cache.get(name);
76
+ if (cached) return cached;
77
+ const real = node_diagnostics_channel.tracingChannel(name);
78
+ const facade = {
79
+ start: wrapSubChannel(real, real.start),
80
+ end: wrapSubChannel(real, real.end),
81
+ asyncStart: wrapSubChannel(real, real.asyncStart),
82
+ asyncEnd: wrapSubChannel(real, real.asyncEnd),
83
+ error: wrapSubChannel(real, real.error),
84
+ traceSync: real.traceSync.bind(real),
85
+ tracePromise: real.tracePromise.bind(real),
86
+ traceCallback: real.traceCallback.bind(real),
87
+ subscribe: real.subscribe.bind(real),
88
+ unsubscribe: real.unsubscribe.bind(real)
89
+ };
90
+ cache.set(name, facade);
91
+ return facade;
72
92
  }
73
- const channel = realDc.channel;
74
- const subscribe = realDc.subscribe;
75
- const unsubscribe = realDc.unsubscribe;
76
- const orchestrionDiagnosticsChannel = { tracingChannel, channel, subscribe, unsubscribe };
77
-
93
+ const channel = node_diagnostics_channel.channel;
94
+ const subscribe = node_diagnostics_channel.subscribe;
95
+ const unsubscribe = node_diagnostics_channel.unsubscribe;
96
+ var orchestrion_diagnostics_channel_default = {
97
+ tracingChannel,
98
+ channel,
99
+ subscribe,
100
+ unsubscribe
101
+ };
78
102
  exports.channel = channel;
79
- exports.default = orchestrionDiagnosticsChannel;
103
+ exports.default = orchestrion_diagnostics_channel_default;
80
104
  exports.subscribe = subscribe;
81
105
  exports.tracingChannel = tracingChannel;
82
106
  exports.unsubscribe = unsubscribe;
83
- //# sourceMappingURL=orchestrion-diagnostics-channel.js.map
107
+
108
+ //# sourceMappingURL=orchestrion-diagnostics-channel.js.map