@sentry/node 8.54.0 → 9.0.0-alpha.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 (282) hide show
  1. package/build/cjs/cron/common.js +1 -1
  2. package/build/cjs/cron/cron.js +1 -1
  3. package/build/cjs/cron/index.js +1 -1
  4. package/build/cjs/cron/node-cron.js +10 -11
  5. package/build/cjs/cron/node-cron.js.map +1 -1
  6. package/build/cjs/cron/node-schedule.js +2 -6
  7. package/build/cjs/cron/node-schedule.js.map +1 -1
  8. package/build/cjs/debug-build.js +1 -1
  9. package/build/cjs/index.js +3 -15
  10. package/build/cjs/index.js.map +1 -1
  11. package/build/cjs/integrations/anr/index.js +8 -13
  12. package/build/cjs/integrations/anr/index.js.map +1 -1
  13. package/build/cjs/integrations/childProcess.js +19 -24
  14. package/build/cjs/integrations/childProcess.js.map +1 -1
  15. package/build/cjs/integrations/console.js +1 -1
  16. package/build/cjs/integrations/context.js +16 -19
  17. package/build/cjs/integrations/context.js.map +1 -1
  18. package/build/cjs/integrations/contextlines.js +6 -10
  19. package/build/cjs/integrations/contextlines.js.map +1 -1
  20. package/build/cjs/integrations/fs.js +1 -1
  21. package/build/cjs/integrations/http/SentryHttpInstrumentation.js +99 -19
  22. package/build/cjs/integrations/http/SentryHttpInstrumentation.js.map +1 -1
  23. package/build/cjs/integrations/http/index.js +32 -46
  24. package/build/cjs/integrations/http/index.js.map +1 -1
  25. package/build/cjs/integrations/http/vendor/getRequestInfo.js +1 -1
  26. package/build/cjs/integrations/http/vendor/getRequestInfo.js.map +1 -1
  27. package/build/cjs/integrations/local-variables/common.js +1 -1
  28. package/build/cjs/integrations/local-variables/index.js +1 -1
  29. package/build/cjs/integrations/local-variables/local-variables-async.js +4 -8
  30. package/build/cjs/integrations/local-variables/local-variables-async.js.map +1 -1
  31. package/build/cjs/integrations/local-variables/local-variables-sync.js +18 -22
  32. package/build/cjs/integrations/local-variables/local-variables-sync.js.map +1 -1
  33. package/build/cjs/integrations/modules.js +2 -2
  34. package/build/cjs/integrations/modules.js.map +1 -1
  35. package/build/cjs/integrations/node-fetch.js +3 -7
  36. package/build/cjs/integrations/node-fetch.js.map +1 -1
  37. package/build/cjs/integrations/onuncaughtexception.js +1 -1
  38. package/build/cjs/integrations/onunhandledrejection.js +1 -1
  39. package/build/cjs/integrations/processSession.js +36 -0
  40. package/build/cjs/integrations/processSession.js.map +1 -0
  41. package/build/cjs/integrations/spotlight.js +2 -2
  42. package/build/cjs/integrations/spotlight.js.map +1 -1
  43. package/build/cjs/integrations/tracing/amqplib.js +1 -1
  44. package/build/cjs/integrations/tracing/connect.js +2 -2
  45. package/build/cjs/integrations/tracing/connect.js.map +1 -1
  46. package/build/cjs/integrations/tracing/dataloader.js +2 -6
  47. package/build/cjs/integrations/tracing/dataloader.js.map +1 -1
  48. package/build/cjs/integrations/tracing/express.js +4 -31
  49. package/build/cjs/integrations/tracing/express.js.map +1 -1
  50. package/build/cjs/integrations/tracing/fastify.js +3 -7
  51. package/build/cjs/integrations/tracing/fastify.js.map +1 -1
  52. package/build/cjs/integrations/tracing/genericPool.js +1 -1
  53. package/build/cjs/integrations/tracing/graphql.js +5 -5
  54. package/build/cjs/integrations/tracing/graphql.js.map +1 -1
  55. package/build/cjs/integrations/tracing/hapi/index.js +5 -9
  56. package/build/cjs/integrations/tracing/hapi/index.js.map +1 -1
  57. package/build/cjs/integrations/tracing/index.js +1 -6
  58. package/build/cjs/integrations/tracing/index.js.map +1 -1
  59. package/build/cjs/integrations/tracing/kafka.js +1 -1
  60. package/build/cjs/integrations/tracing/knex.js +2 -2
  61. package/build/cjs/integrations/tracing/knex.js.map +1 -1
  62. package/build/cjs/integrations/tracing/koa.js +4 -8
  63. package/build/cjs/integrations/tracing/koa.js.map +1 -1
  64. package/build/cjs/integrations/tracing/lrumemoizer.js +1 -1
  65. package/build/cjs/integrations/tracing/mongo.js +1 -1
  66. package/build/cjs/integrations/tracing/mongoose.js +1 -1
  67. package/build/cjs/integrations/tracing/mysql.js +1 -1
  68. package/build/cjs/integrations/tracing/mysql2.js +1 -1
  69. package/build/cjs/integrations/tracing/postgres.js +1 -1
  70. package/build/cjs/integrations/tracing/prisma.js +21 -67
  71. package/build/cjs/integrations/tracing/prisma.js.map +1 -1
  72. package/build/cjs/integrations/tracing/redis.js +4 -8
  73. package/build/cjs/integrations/tracing/redis.js.map +1 -1
  74. package/build/cjs/integrations/tracing/tedious.js +3 -7
  75. package/build/cjs/integrations/tracing/tedious.js.map +1 -1
  76. package/build/cjs/integrations/tracing/vercelai/index.js +14 -20
  77. package/build/cjs/integrations/tracing/vercelai/index.js.map +1 -1
  78. package/build/cjs/integrations/tracing/vercelai/instrumentation.js +1 -1
  79. package/build/cjs/nodeVersion.js +1 -1
  80. package/build/cjs/otel/contextManager.js +2 -2
  81. package/build/cjs/otel/contextManager.js.map +1 -1
  82. package/build/cjs/otel/instrument.js +1 -1
  83. package/build/cjs/proxy/base.js +30 -33
  84. package/build/cjs/proxy/base.js.map +1 -1
  85. package/build/cjs/proxy/index.js +3 -8
  86. package/build/cjs/proxy/index.js.map +1 -1
  87. package/build/cjs/proxy/parse-proxy-response.js +2 -2
  88. package/build/cjs/proxy/parse-proxy-response.js.map +1 -1
  89. package/build/cjs/sdk/api.js +2 -2
  90. package/build/cjs/sdk/api.js.map +1 -1
  91. package/build/cjs/sdk/client.js +3 -8
  92. package/build/cjs/sdk/client.js.map +1 -1
  93. package/build/cjs/sdk/index.js +5 -58
  94. package/build/cjs/sdk/index.js.map +1 -1
  95. package/build/cjs/sdk/initOtel.js +8 -22
  96. package/build/cjs/sdk/initOtel.js.map +1 -1
  97. package/build/cjs/transports/http.js +10 -16
  98. package/build/cjs/transports/http.js.map +1 -1
  99. package/build/cjs/utils/addOriginToSpan.js +1 -1
  100. package/build/cjs/utils/commonjs.js +1 -1
  101. package/build/cjs/utils/createMissingInstrumentationContext.js +1 -1
  102. package/build/cjs/utils/debug.js +1 -1
  103. package/build/cjs/utils/ensureIsWrapped.js +2 -6
  104. package/build/cjs/utils/ensureIsWrapped.js.map +1 -1
  105. package/build/cjs/utils/envToBool.js +2 -2
  106. package/build/cjs/utils/envToBool.js.map +1 -1
  107. package/build/cjs/utils/errorhandling.js +2 -3
  108. package/build/cjs/utils/errorhandling.js.map +1 -1
  109. package/build/cjs/utils/getRequestUrl.js +1 -1
  110. package/build/cjs/utils/module.js +1 -1
  111. package/build/cjs/utils/module.js.map +1 -1
  112. package/build/cjs/utils/redisCache.js +1 -4
  113. package/build/cjs/utils/redisCache.js.map +1 -1
  114. package/build/esm/cron/node-cron.js +9 -7
  115. package/build/esm/cron/node-cron.js.map +1 -1
  116. package/build/esm/cron/node-schedule.js +1 -2
  117. package/build/esm/cron/node-schedule.js.map +1 -1
  118. package/build/esm/index.js +3 -4
  119. package/build/esm/index.js.map +1 -1
  120. package/build/esm/integrations/anr/index.js +8 -9
  121. package/build/esm/integrations/anr/index.js.map +1 -1
  122. package/build/esm/integrations/anr/worker-script.js +2 -2
  123. package/build/esm/integrations/childProcess.js +20 -24
  124. package/build/esm/integrations/childProcess.js.map +1 -1
  125. package/build/esm/integrations/context.js +15 -15
  126. package/build/esm/integrations/context.js.map +1 -1
  127. package/build/esm/integrations/contextlines.js +5 -6
  128. package/build/esm/integrations/contextlines.js.map +1 -1
  129. package/build/esm/integrations/http/SentryHttpInstrumentation.js +99 -20
  130. package/build/esm/integrations/http/SentryHttpInstrumentation.js.map +1 -1
  131. package/build/esm/integrations/http/index.js +32 -43
  132. package/build/esm/integrations/http/index.js.map +1 -1
  133. package/build/esm/integrations/http/vendor/getRequestInfo.js.map +1 -1
  134. package/build/esm/integrations/local-variables/local-variables-async.js +3 -4
  135. package/build/esm/integrations/local-variables/local-variables-async.js.map +1 -1
  136. package/build/esm/integrations/local-variables/local-variables-sync.js +17 -18
  137. package/build/esm/integrations/local-variables/local-variables-sync.js.map +1 -1
  138. package/build/esm/integrations/local-variables/worker-script.js +2 -2
  139. package/build/esm/integrations/modules.js +1 -1
  140. package/build/esm/integrations/modules.js.map +1 -1
  141. package/build/esm/integrations/node-fetch.js +3 -4
  142. package/build/esm/integrations/node-fetch.js.map +1 -1
  143. package/build/esm/integrations/processSession.js +34 -0
  144. package/build/esm/integrations/processSession.js.map +1 -0
  145. package/build/esm/integrations/spotlight.js +1 -1
  146. package/build/esm/integrations/spotlight.js.map +1 -1
  147. package/build/esm/integrations/tracing/connect.js +1 -1
  148. package/build/esm/integrations/tracing/connect.js.map +1 -1
  149. package/build/esm/integrations/tracing/dataloader.js +1 -2
  150. package/build/esm/integrations/tracing/dataloader.js.map +1 -1
  151. package/build/esm/integrations/tracing/express.js +4 -28
  152. package/build/esm/integrations/tracing/express.js.map +1 -1
  153. package/build/esm/integrations/tracing/fastify.js +2 -3
  154. package/build/esm/integrations/tracing/fastify.js.map +1 -1
  155. package/build/esm/integrations/tracing/graphql.js +4 -4
  156. package/build/esm/integrations/tracing/graphql.js.map +1 -1
  157. package/build/esm/integrations/tracing/hapi/index.js +4 -5
  158. package/build/esm/integrations/tracing/hapi/index.js.map +1 -1
  159. package/build/esm/integrations/tracing/index.js +0 -5
  160. package/build/esm/integrations/tracing/index.js.map +1 -1
  161. package/build/esm/integrations/tracing/knex.js +1 -1
  162. package/build/esm/integrations/tracing/knex.js.map +1 -1
  163. package/build/esm/integrations/tracing/koa.js +3 -4
  164. package/build/esm/integrations/tracing/koa.js.map +1 -1
  165. package/build/esm/integrations/tracing/prisma.js +21 -64
  166. package/build/esm/integrations/tracing/prisma.js.map +1 -1
  167. package/build/esm/integrations/tracing/redis.js +4 -5
  168. package/build/esm/integrations/tracing/redis.js.map +1 -1
  169. package/build/esm/integrations/tracing/tedious.js +2 -3
  170. package/build/esm/integrations/tracing/tedious.js.map +1 -1
  171. package/build/esm/integrations/tracing/vercelai/index.js +13 -16
  172. package/build/esm/integrations/tracing/vercelai/index.js.map +1 -1
  173. package/build/esm/otel/contextManager.js +1 -1
  174. package/build/esm/otel/contextManager.js.map +1 -1
  175. package/build/esm/package.json +1 -1
  176. package/build/esm/proxy/base.js +29 -29
  177. package/build/esm/proxy/base.js.map +1 -1
  178. package/build/esm/proxy/index.js +2 -3
  179. package/build/esm/proxy/index.js.map +1 -1
  180. package/build/esm/proxy/parse-proxy-response.js +1 -1
  181. package/build/esm/proxy/parse-proxy-response.js.map +1 -1
  182. package/build/esm/sdk/api.js +1 -1
  183. package/build/esm/sdk/api.js.map +1 -1
  184. package/build/esm/sdk/client.js +2 -3
  185. package/build/esm/sdk/client.js.map +1 -1
  186. package/build/esm/sdk/index.js +5 -58
  187. package/build/esm/sdk/index.js.map +1 -1
  188. package/build/esm/sdk/initOtel.js +7 -18
  189. package/build/esm/sdk/initOtel.js.map +1 -1
  190. package/build/esm/transports/http.js +9 -12
  191. package/build/esm/transports/http.js.map +1 -1
  192. package/build/esm/utils/ensureIsWrapped.js +1 -2
  193. package/build/esm/utils/ensureIsWrapped.js.map +1 -1
  194. package/build/esm/utils/envToBool.js +1 -1
  195. package/build/esm/utils/envToBool.js.map +1 -1
  196. package/build/esm/utils/errorhandling.js +1 -2
  197. package/build/esm/utils/errorhandling.js.map +1 -1
  198. package/build/esm/utils/module.js.map +1 -1
  199. package/build/esm/utils/redisCache.js +0 -3
  200. package/build/esm/utils/redisCache.js.map +1 -1
  201. package/build/types/cron/node-cron.d.ts +1 -1
  202. package/build/types/cron/node-cron.d.ts.map +1 -1
  203. package/build/types/index.d.ts +4 -6
  204. package/build/types/index.d.ts.map +1 -1
  205. package/build/types/integrations/childProcess.d.ts +7 -7
  206. package/build/types/integrations/childProcess.d.ts.map +1 -1
  207. package/build/types/integrations/http/SentryHttpInstrumentation.d.ts +30 -0
  208. package/build/types/integrations/http/SentryHttpInstrumentation.d.ts.map +1 -1
  209. package/build/types/integrations/http/index.d.ts +11 -8
  210. package/build/types/integrations/http/index.d.ts.map +1 -1
  211. package/build/types/integrations/processSession.d.ts +5 -0
  212. package/build/types/integrations/processSession.d.ts.map +1 -0
  213. package/build/types/integrations/tracing/express.d.ts.map +1 -1
  214. package/build/types/integrations/tracing/hapi/types.d.ts +1 -0
  215. package/build/types/integrations/tracing/hapi/types.d.ts.map +1 -1
  216. package/build/types/integrations/tracing/index.d.ts.map +1 -1
  217. package/build/types/integrations/tracing/prisma.d.ts +11 -12
  218. package/build/types/integrations/tracing/prisma.d.ts.map +1 -1
  219. package/build/types/integrations/tracing/vercelai/index.d.ts.map +1 -1
  220. package/build/types/otel/contextManager.d.ts +1 -1
  221. package/build/types/proxy/helpers.d.ts +1 -0
  222. package/build/types/proxy/helpers.d.ts.map +1 -1
  223. package/build/types/proxy/parse-proxy-response.d.ts +1 -0
  224. package/build/types/proxy/parse-proxy-response.d.ts.map +1 -1
  225. package/build/types/sdk/index.d.ts.map +1 -1
  226. package/build/types/sdk/initOtel.d.ts +1 -3
  227. package/build/types/sdk/initOtel.d.ts.map +1 -1
  228. package/build/types/transports/http-module.d.ts +1 -0
  229. package/build/types/transports/http-module.d.ts.map +1 -1
  230. package/build/types/transports/http.d.ts +1 -0
  231. package/build/types/transports/http.d.ts.map +1 -1
  232. package/build/types/types.d.ts +2 -48
  233. package/build/types/types.d.ts.map +1 -1
  234. package/build/types/utils/errorhandling.d.ts.map +1 -1
  235. package/build/types-ts3.8/cron/node-cron.d.ts +1 -1
  236. package/build/types-ts3.8/index.d.ts +4 -6
  237. package/build/types-ts3.8/integrations/childProcess.d.ts +7 -7
  238. package/build/types-ts3.8/integrations/http/SentryHttpInstrumentation.d.ts +29 -0
  239. package/build/types-ts3.8/integrations/http/index.d.ts +11 -8
  240. package/build/types-ts3.8/integrations/processSession.d.ts +5 -0
  241. package/build/types-ts3.8/integrations/tracing/prisma.d.ts +11 -12
  242. package/build/types-ts3.8/otel/contextManager.d.ts +1 -1
  243. package/build/types-ts3.8/sdk/initOtel.d.ts +1 -3
  244. package/build/types-ts3.8/types.d.ts +2 -48
  245. package/package.json +8 -9
  246. package/build/cjs/integrations/tracing/nest/helpers.js +0 -100
  247. package/build/cjs/integrations/tracing/nest/helpers.js.map +0 -1
  248. package/build/cjs/integrations/tracing/nest/nest.js +0 -148
  249. package/build/cjs/integrations/tracing/nest/nest.js.map +0 -1
  250. package/build/cjs/integrations/tracing/nest/sentry-nest-event-instrumentation.js +0 -117
  251. package/build/cjs/integrations/tracing/nest/sentry-nest-event-instrumentation.js.map +0 -1
  252. package/build/cjs/integrations/tracing/nest/sentry-nest-instrumentation.js +0 -301
  253. package/build/cjs/integrations/tracing/nest/sentry-nest-instrumentation.js.map +0 -1
  254. package/build/esm/integrations/tracing/nest/helpers.js +0 -91
  255. package/build/esm/integrations/tracing/nest/helpers.js.map +0 -1
  256. package/build/esm/integrations/tracing/nest/nest.js +0 -141
  257. package/build/esm/integrations/tracing/nest/nest.js.map +0 -1
  258. package/build/esm/integrations/tracing/nest/sentry-nest-event-instrumentation.js +0 -115
  259. package/build/esm/integrations/tracing/nest/sentry-nest-event-instrumentation.js.map +0 -1
  260. package/build/esm/integrations/tracing/nest/sentry-nest-instrumentation.js +0 -295
  261. package/build/esm/integrations/tracing/nest/sentry-nest-instrumentation.js.map +0 -1
  262. package/build/types/integrations/tracing/nest/helpers.d.ts +0 -36
  263. package/build/types/integrations/tracing/nest/helpers.d.ts.map +0 -1
  264. package/build/types/integrations/tracing/nest/nest.d.ts +0 -19
  265. package/build/types/integrations/tracing/nest/nest.d.ts.map +0 -1
  266. package/build/types/integrations/tracing/nest/sentry-nest-event-instrumentation.d.ts +0 -27
  267. package/build/types/integrations/tracing/nest/sentry-nest-event-instrumentation.d.ts.map +0 -1
  268. package/build/types/integrations/tracing/nest/sentry-nest-instrumentation.d.ts +0 -37
  269. package/build/types/integrations/tracing/nest/sentry-nest-instrumentation.d.ts.map +0 -1
  270. package/build/types/integrations/tracing/nest/types.d.ts +0 -84
  271. package/build/types/integrations/tracing/nest/types.d.ts.map +0 -1
  272. package/build/types/integrations/tracing/prisma/vendor/v5-tracing-helper.d.ts +0 -38
  273. package/build/types/integrations/tracing/prisma/vendor/v5-tracing-helper.d.ts.map +0 -1
  274. package/build/types/integrations/tracing/prisma/vendor/v6-tracing-helper.d.ts +0 -31
  275. package/build/types/integrations/tracing/prisma/vendor/v6-tracing-helper.d.ts.map +0 -1
  276. package/build/types-ts3.8/integrations/tracing/nest/helpers.d.ts +0 -36
  277. package/build/types-ts3.8/integrations/tracing/nest/nest.d.ts +0 -19
  278. package/build/types-ts3.8/integrations/tracing/nest/sentry-nest-event-instrumentation.d.ts +0 -27
  279. package/build/types-ts3.8/integrations/tracing/nest/sentry-nest-instrumentation.d.ts +0 -37
  280. package/build/types-ts3.8/integrations/tracing/nest/types.d.ts +0 -84
  281. package/build/types-ts3.8/integrations/tracing/prisma/vendor/v5-tracing-helper.d.ts +0 -44
  282. package/build/types-ts3.8/integrations/tracing/prisma/vendor/v6-tracing-helper.d.ts +0 -34
@@ -1 +1 @@
1
- {"version":3,"file":"http.js","sources":["../../../src/transports/http.ts"],"sourcesContent":["import * as http from 'node:http';\nimport * as https from 'node:https';\nimport { Readable } from 'node:stream';\nimport { createGzip } from 'node:zlib';\nimport type {\n BaseTransportOptions,\n Transport,\n TransportMakeRequestResponse,\n TransportRequest,\n TransportRequestExecutor,\n} from '@sentry/core';\nimport { consoleSandbox, createTransport, suppressTracing } from '@sentry/core';\nimport { HttpsProxyAgent } from '../proxy';\nimport type { HTTPModule } from './http-module';\n\nexport interface NodeTransportOptions extends BaseTransportOptions {\n /** Define custom headers */\n headers?: Record<string, string>;\n /** Set a proxy that should be used for outbound requests. */\n proxy?: string;\n /** HTTPS proxy CA certificates */\n caCerts?: string | Buffer | Array<string | Buffer>;\n /** Custom HTTP module. Defaults to the native 'http' and 'https' modules. */\n httpModule?: HTTPModule;\n /** Allow overriding connection keepAlive, defaults to false */\n keepAlive?: boolean;\n}\n\n// Estimated maximum size for reasonable standalone event\nconst GZIP_THRESHOLD = 1024 * 32;\n\n/**\n * Gets a stream from a Uint8Array or string\n * Readable.from is ideal but was added in node.js v12.3.0 and v10.17.0\n */\nfunction streamFromBody(body: Uint8Array | string): Readable {\n return new Readable({\n read() {\n this.push(body);\n this.push(null);\n },\n });\n}\n\n/**\n * Creates a Transport that uses native the native 'http' and 'https' modules to send events to Sentry.\n */\nexport function makeNodeTransport(options: NodeTransportOptions): Transport {\n let urlSegments: URL;\n\n try {\n urlSegments = new URL(options.url);\n } catch (e) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn(\n '[@sentry/node]: Invalid dsn or tunnel option, will not send any events. The tunnel option must be a full URL when used.',\n );\n });\n return createTransport(options, () => Promise.resolve({}));\n }\n\n const isHttps = urlSegments.protocol === 'https:';\n\n // Proxy prioritization: http => `options.proxy` | `process.env.http_proxy`\n // Proxy prioritization: https => `options.proxy` | `process.env.https_proxy` | `process.env.http_proxy`\n const proxy = applyNoProxyOption(\n urlSegments,\n options.proxy || (isHttps ? process.env.https_proxy : undefined) || process.env.http_proxy,\n );\n\n const nativeHttpModule = isHttps ? https : http;\n const keepAlive = options.keepAlive === undefined ? false : options.keepAlive;\n\n // TODO(v9): Evaluate if we can set keepAlive to true. This would involve testing for memory leaks in older node\n // versions(>= 8) as they had memory leaks when using it: #2555\n const agent = proxy\n ? (new HttpsProxyAgent(proxy) as http.Agent)\n : new nativeHttpModule.Agent({ keepAlive, maxSockets: 30, timeout: 2000 });\n\n const requestExecutor = createRequestExecutor(options, options.httpModule ?? nativeHttpModule, agent);\n return createTransport(options, requestExecutor);\n}\n\n/**\n * Honors the `no_proxy` env variable with the highest priority to allow for hosts exclusion.\n *\n * @param transportUrl The URL the transport intends to send events to.\n * @param proxy The client configured proxy.\n * @returns A proxy the transport should use.\n */\nfunction applyNoProxyOption(transportUrlSegments: URL, proxy: string | undefined): string | undefined {\n const { no_proxy } = process.env;\n\n const urlIsExemptFromProxy =\n no_proxy &&\n no_proxy\n .split(',')\n .some(\n exemption => transportUrlSegments.host.endsWith(exemption) || transportUrlSegments.hostname.endsWith(exemption),\n );\n\n if (urlIsExemptFromProxy) {\n return undefined;\n } else {\n return proxy;\n }\n}\n\n/**\n * Creates a RequestExecutor to be used with `createTransport`.\n */\nfunction createRequestExecutor(\n options: NodeTransportOptions,\n httpModule: HTTPModule,\n agent: http.Agent,\n): TransportRequestExecutor {\n const { hostname, pathname, port, protocol, search } = new URL(options.url);\n return function makeRequest(request: TransportRequest): Promise<TransportMakeRequestResponse> {\n return new Promise((resolve, reject) => {\n // This ensures we do not generate any spans in OpenTelemetry for the transport\n suppressTracing(() => {\n let body = streamFromBody(request.body);\n\n const headers: Record<string, string> = { ...options.headers };\n\n if (request.body.length > GZIP_THRESHOLD) {\n headers['content-encoding'] = 'gzip';\n body = body.pipe(createGzip());\n }\n\n const req = httpModule.request(\n {\n method: 'POST',\n agent,\n headers,\n hostname,\n path: `${pathname}${search}`,\n port,\n protocol,\n ca: options.caCerts,\n },\n res => {\n res.on('data', () => {\n // Drain socket\n });\n\n res.on('end', () => {\n // Drain socket\n });\n\n res.setEncoding('utf8');\n\n // \"Key-value pairs of header names and values. Header names are lower-cased.\"\n // https://nodejs.org/api/http.html#http_message_headers\n const retryAfterHeader = res.headers['retry-after'] ?? null;\n const rateLimitsHeader = res.headers['x-sentry-rate-limits'] ?? null;\n\n resolve({\n statusCode: res.statusCode,\n headers: {\n 'retry-after': retryAfterHeader,\n 'x-sentry-rate-limits': Array.isArray(rateLimitsHeader)\n ? rateLimitsHeader[0] || null\n : rateLimitsHeader,\n },\n });\n },\n );\n\n req.on('error', reject);\n body.pipe(req);\n });\n });\n };\n}\n"],"names":["Readable","consoleSandbox","createTransport","HttpsProxyAgent","suppressTracing","createGzip"],"mappings":";;;;;;;;;;;;;AA4BA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,C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AAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;gBACA,sBAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;kBACA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA;kBACA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;cACA,CAAA;YACA,CAAA,CAAA;UACA,CAAA;QACA,CAAA;;QAEA,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,MAAA,CAAA;QACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,CAAA;MACA,CAAA,CAAA;IACA,CAAA,CAAA;EACA,CAAA;AACA;;"}
1
+ {"version":3,"file":"http.js","sources":["../../../src/transports/http.ts"],"sourcesContent":["import * as http from 'node:http';\nimport * as https from 'node:https';\nimport { Readable } from 'node:stream';\nimport { createGzip } from 'node:zlib';\nimport type {\n BaseTransportOptions,\n Transport,\n TransportMakeRequestResponse,\n TransportRequest,\n TransportRequestExecutor,\n} from '@sentry/core';\nimport { consoleSandbox, createTransport, suppressTracing } from '@sentry/core';\nimport { HttpsProxyAgent } from '../proxy';\nimport type { HTTPModule } from './http-module';\n\nexport interface NodeTransportOptions extends BaseTransportOptions {\n /** Define custom headers */\n headers?: Record<string, string>;\n /** Set a proxy that should be used for outbound requests. */\n proxy?: string;\n /** HTTPS proxy CA certificates */\n caCerts?: string | Buffer | Array<string | Buffer>;\n /** Custom HTTP module. Defaults to the native 'http' and 'https' modules. */\n httpModule?: HTTPModule;\n /** Allow overriding connection keepAlive, defaults to false */\n keepAlive?: boolean;\n}\n\n// Estimated maximum size for reasonable standalone event\nconst GZIP_THRESHOLD = 1024 * 32;\n\n/**\n * Gets a stream from a Uint8Array or string\n * Readable.from is ideal but was added in node.js v12.3.0 and v10.17.0\n */\nfunction streamFromBody(body: Uint8Array | string): Readable {\n return new Readable({\n read() {\n this.push(body);\n this.push(null);\n },\n });\n}\n\n/**\n * Creates a Transport that uses native the native 'http' and 'https' modules to send events to Sentry.\n */\nexport function makeNodeTransport(options: NodeTransportOptions): Transport {\n let urlSegments: URL;\n\n try {\n urlSegments = new URL(options.url);\n } catch (e) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn(\n '[@sentry/node]: Invalid dsn or tunnel option, will not send any events. The tunnel option must be a full URL when used.',\n );\n });\n return createTransport(options, () => Promise.resolve({}));\n }\n\n const isHttps = urlSegments.protocol === 'https:';\n\n // Proxy prioritization: http => `options.proxy` | `process.env.http_proxy`\n // Proxy prioritization: https => `options.proxy` | `process.env.https_proxy` | `process.env.http_proxy`\n const proxy = applyNoProxyOption(\n urlSegments,\n options.proxy || (isHttps ? process.env.https_proxy : undefined) || process.env.http_proxy,\n );\n\n const nativeHttpModule = isHttps ? https : http;\n const keepAlive = options.keepAlive === undefined ? false : options.keepAlive;\n\n // TODO(v10): Evaluate if we can set keepAlive to true. This would involve testing for memory leaks in older node\n // versions(>= 8) as they had memory leaks when using it: #2555\n const agent = proxy\n ? (new HttpsProxyAgent(proxy) as http.Agent)\n : new nativeHttpModule.Agent({ keepAlive, maxSockets: 30, timeout: 2000 });\n\n const requestExecutor = createRequestExecutor(options, options.httpModule ?? nativeHttpModule, agent);\n return createTransport(options, requestExecutor);\n}\n\n/**\n * Honors the `no_proxy` env variable with the highest priority to allow for hosts exclusion.\n *\n * @param transportUrl The URL the transport intends to send events to.\n * @param proxy The client configured proxy.\n * @returns A proxy the transport should use.\n */\nfunction applyNoProxyOption(transportUrlSegments: URL, proxy: string | undefined): string | undefined {\n const { no_proxy } = process.env;\n\n const urlIsExemptFromProxy = no_proxy\n ?.split(',')\n .some(\n exemption => transportUrlSegments.host.endsWith(exemption) || transportUrlSegments.hostname.endsWith(exemption),\n );\n\n if (urlIsExemptFromProxy) {\n return undefined;\n } else {\n return proxy;\n }\n}\n\n/**\n * Creates a RequestExecutor to be used with `createTransport`.\n */\nfunction createRequestExecutor(\n options: NodeTransportOptions,\n httpModule: HTTPModule,\n agent: http.Agent,\n): TransportRequestExecutor {\n const { hostname, pathname, port, protocol, search } = new URL(options.url);\n return function makeRequest(request: TransportRequest): Promise<TransportMakeRequestResponse> {\n return new Promise((resolve, reject) => {\n // This ensures we do not generate any spans in OpenTelemetry for the transport\n suppressTracing(() => {\n let body = streamFromBody(request.body);\n\n const headers: Record<string, string> = { ...options.headers };\n\n if (request.body.length > GZIP_THRESHOLD) {\n headers['content-encoding'] = 'gzip';\n body = body.pipe(createGzip());\n }\n\n const req = httpModule.request(\n {\n method: 'POST',\n agent,\n headers,\n hostname,\n path: `${pathname}${search}`,\n port,\n protocol,\n ca: options.caCerts,\n },\n res => {\n res.on('data', () => {\n // Drain socket\n });\n\n res.on('end', () => {\n // Drain socket\n });\n\n res.setEncoding('utf8');\n\n // \"Key-value pairs of header names and values. Header names are lower-cased.\"\n // https://nodejs.org/api/http.html#http_message_headers\n const retryAfterHeader = res.headers['retry-after'] ?? null;\n const rateLimitsHeader = res.headers['x-sentry-rate-limits'] ?? null;\n\n resolve({\n statusCode: res.statusCode,\n headers: {\n 'retry-after': retryAfterHeader,\n 'x-sentry-rate-limits': Array.isArray(rateLimitsHeader)\n ? rateLimitsHeader[0] || null\n : rateLimitsHeader,\n },\n });\n },\n );\n\n req.on('error', reject);\n body.pipe(req);\n });\n });\n };\n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AAA,IAAA;AACA,oBAAA,gBAAA;AACA,eAAA;AACA,aAAA,CAAA;AACA,WAAA;AACA,SAAA;;AAEA,QAAA,GAAA,CAAA,EAAA,CAAA,OAAA,EAAA,MAAA,CAAA;AACA,QAAA,IAAA,CAAA,IAAA,CAAA,GAAA,CAAA;AACA,OAAA,CAAA;AACA,KAAA,CAAA;AACA,GAAA;AACA;;;;"}
@@ -1,4 +1,4 @@
1
- Object.defineProperty(exports, '__esModule', { value: true });
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
 
3
3
  const core = require('@sentry/core');
4
4
 
@@ -1,4 +1,4 @@
1
- Object.defineProperty(exports, '__esModule', { value: true });
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
 
3
3
  /** Detect CommonJS. */
4
4
  function isCjs() {
@@ -1,4 +1,4 @@
1
- Object.defineProperty(exports, '__esModule', { value: true });
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
 
3
3
  const commonjs = require('./commonjs.js');
4
4
 
@@ -1,4 +1,4 @@
1
- Object.defineProperty(exports, '__esModule', { value: true });
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
 
3
3
  let cachedDebuggerEnabled;
4
4
 
@@ -1,8 +1,4 @@
1
- var {
2
- _optionalChain
3
- } = require('@sentry/core');
4
-
5
- Object.defineProperty(exports, '__esModule', { value: true });
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
6
2
 
7
3
  const core$1 = require('@opentelemetry/core');
8
4
  const core = require('@sentry/core');
@@ -18,7 +14,7 @@ function ensureIsWrapped(
18
14
  ) {
19
15
  const client = core.getClient();
20
16
  if (
21
- !_optionalChain([client, 'optionalAccess', _ => _.getOptions, 'call', _2 => _2(), 'access', _3 => _3.disableInstrumentationWarnings]) &&
17
+ !client?.getOptions().disableInstrumentationWarnings &&
22
18
  !core$1.isWrapped(maybeWrappedFunction) &&
23
19
  core.isEnabled() &&
24
20
  core.hasTracingEnabled()
@@ -1 +1 @@
1
- {"version":3,"file":"ensureIsWrapped.js","sources":["../../../src/utils/ensureIsWrapped.ts"],"sourcesContent":["import { isWrapped } from '@opentelemetry/core';\nimport { consoleSandbox, getClient, getGlobalScope, hasTracingEnabled, isEnabled } from '@sentry/core';\nimport type { NodeClient } from '../sdk/client';\nimport { isCjs } from './commonjs';\nimport { createMissingInstrumentationContext } from './createMissingInstrumentationContext';\n\n/**\n * Checks and warns if a framework isn't wrapped by opentelemetry.\n */\nexport function ensureIsWrapped(\n maybeWrappedFunction: unknown,\n name: 'express' | 'connect' | 'fastify' | 'hapi' | 'koa',\n): void {\n const client = getClient<NodeClient>();\n if (\n !client?.getOptions().disableInstrumentationWarnings &&\n !isWrapped(maybeWrappedFunction) &&\n isEnabled() &&\n hasTracingEnabled()\n ) {\n consoleSandbox(() => {\n if (isCjs()) {\n // eslint-disable-next-line no-console\n console.warn(\n `[Sentry] ${name} is not instrumented. This is likely because you required/imported ${name} before calling \\`Sentry.init()\\`.`,\n );\n } else {\n // eslint-disable-next-line no-console\n console.warn(\n `[Sentry] ${name} is not instrumented. Please make sure to initialize Sentry in a separate file that you \\`--import\\` when running node, see: https://docs.sentry.io/platforms/javascript/guides/${name}/install/esm/.`,\n );\n }\n });\n\n getGlobalScope().setContext('missing_instrumentation', createMissingInstrumentationContext(name));\n }\n}\n"],"names":["getClient","isWrapped","isEnabled","hasTracingEnabled","consoleSandbox","isCjs","getGlobalScope","createMissingInstrumentationContext"],"mappings":";;;;;;;;;;;AAMA,CAAA,CAAA;CACA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CA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,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAC,CAAI,CAAA,CAAA,CAAA,CAAC,CAAC;EACrG;AACA;;"}
1
+ {"version":3,"file":"ensureIsWrapped.js","sources":["../../../src/utils/ensureIsWrapped.ts"],"sourcesContent":["import { isWrapped } from '@opentelemetry/core';\nimport { consoleSandbox, getClient, getGlobalScope, hasTracingEnabled, isEnabled } from '@sentry/core';\nimport type { NodeClient } from '../sdk/client';\nimport { isCjs } from './commonjs';\nimport { createMissingInstrumentationContext } from './createMissingInstrumentationContext';\n\n/**\n * Checks and warns if a framework isn't wrapped by opentelemetry.\n */\nexport function ensureIsWrapped(\n maybeWrappedFunction: unknown,\n name: 'express' | 'connect' | 'fastify' | 'hapi' | 'koa',\n): void {\n const client = getClient<NodeClient>();\n if (\n !client?.getOptions().disableInstrumentationWarnings &&\n !isWrapped(maybeWrappedFunction) &&\n isEnabled() &&\n hasTracingEnabled()\n ) {\n consoleSandbox(() => {\n if (isCjs()) {\n // eslint-disable-next-line no-console\n console.warn(\n `[Sentry] ${name} is not instrumented. This is likely because you required/imported ${name} before calling \\`Sentry.init()\\`.`,\n );\n } else {\n // eslint-disable-next-line no-console\n console.warn(\n `[Sentry] ${name} is not instrumented. Please make sure to initialize Sentry in a separate file that you \\`--import\\` when running node, see: https://docs.sentry.io/platforms/javascript/guides/${name}/install/esm/.`,\n );\n }\n });\n\n getGlobalScope().setContext('missing_instrumentation', createMissingInstrumentationContext(name));\n }\n}\n"],"names":["getClient","isWrapped","isEnabled","hasTracingEnabled","consoleSandbox","isCjs","getGlobalScope","createMissingInstrumentationContext"],"mappings":";;;;;;;AAMA;AACA;AACA;AACO,SAAS,eAAe;AAC/B,EAAE,oBAAoB;AACtB,EAAE,IAAI;AACN,EAAQ;AACR,EAAE,MAAM,MAAA,GAASA,cAAS,EAAc;AACxC,EAAE;AACF,IAAI,CAAC,MAAM,EAAE,UAAU,EAAE,CAAC,8BAA+B;AACzD,IAAI,CAACC,gBAAS,CAAC,oBAAoB,CAAE;AACrC,IAAIC,cAAS,EAAG;AAChB,IAAIC,sBAAiB;AACrB,IAAI;AACJ,IAAIC,mBAAc,CAAC,MAAM;AACzB,MAAM,IAAIC,cAAK,EAAE,EAAE;AACnB;AACA,QAAQ,OAAO,CAAC,IAAI;AACpB,UAAU,CAAC,SAAS,EAAE,IAAI,CAAC,mEAAmE,EAAE,IAAI,CAAC,kCAAkC,CAAC;AACxI,SAAS;AACT,aAAa;AACb;AACA,QAAQ,OAAO,CAAC,IAAI;AACpB,UAAU,CAAC,SAAS,EAAE,IAAI,CAAC,gLAAgL,EAAE,IAAI,CAAC,cAAc,CAAC;AACjO,SAAS;AACT;AACA,KAAK,CAAC;;AAEN,IAAIC,mBAAc,EAAE,CAAC,UAAU,CAAC,yBAAyB,EAAEC,uEAAmC,CAAC,IAAI,CAAC,CAAC;AACrG;AACA;;;;"}
@@ -1,4 +1,4 @@
1
- Object.defineProperty(exports, '__esModule', { value: true });
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
 
3
3
  const FALSY_ENV_VALUES = new Set(['false', 'f', 'n', 'no', 'off', '0']);
4
4
  const TRUTHY_ENV_VALUES = new Set(['true', 't', 'y', 'yes', 'on', '1']);
@@ -23,7 +23,7 @@ function envToBool(value, options) {
23
23
  return true;
24
24
  }
25
25
 
26
- return options && options.strict ? null : Boolean(value);
26
+ return options?.strict ? null : Boolean(value);
27
27
  }
28
28
 
29
29
  exports.FALSY_ENV_VALUES = FALSY_ENV_VALUES;
@@ -1 +1 @@
1
- {"version":3,"file":"envToBool.js","sources":["../../../src/utils/envToBool.ts"],"sourcesContent":["export const FALSY_ENV_VALUES = new Set(['false', 'f', 'n', 'no', 'off', '0']);\nexport const TRUTHY_ENV_VALUES = new Set(['true', 't', 'y', 'yes', 'on', '1']);\n\nexport type StrictBoolCast = {\n strict: true;\n};\n\nexport type LooseBoolCast = {\n strict?: false;\n};\n\nexport type BoolCastOptions = StrictBoolCast | LooseBoolCast;\n\nexport function envToBool(value: unknown, options?: LooseBoolCast): boolean;\nexport function envToBool(value: unknown, options: StrictBoolCast): boolean | null;\nexport function envToBool(value: unknown, options?: BoolCastOptions): boolean | null;\n/**\n * A helper function which casts an ENV variable value to `true` or `false` using the constants defined above.\n * In strict mode, it may return `null` if the value doesn't match any of the predefined values.\n *\n * @param value The value of the env variable\n * @param options -- Only has `strict` key for now, which requires a strict match for `true` in TRUTHY_ENV_VALUES\n * @returns true/false if the lowercase value matches the predefined values above. If not, null in strict mode,\n * and Boolean(value) in loose mode.\n */\nexport function envToBool(value: unknown, options?: BoolCastOptions): boolean | null {\n const normalized = String(value).toLowerCase();\n\n if (FALSY_ENV_VALUES.has(normalized)) {\n return false;\n }\n\n if (TRUTHY_ENV_VALUES.has(normalized)) {\n return true;\n }\n\n return options && options.strict ? null : Boolean(value);\n}\n"],"names":[],"mappings":";;MAAa,gBAAiB,GAAE,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC;MAChE,iBAAkB,GAAE,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC;;AAe7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,SAAS,CAAC,KAAK,EAAW,OAAO,EAAoC;AACrF,EAAE,MAAM,UAAW,GAAE,MAAM,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE;;AAEhD,EAAE,IAAI,gBAAgB,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;AACxC,IAAI,OAAO,KAAK;AAChB;;AAEA,EAAE,IAAI,iBAAiB,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;AACzC,IAAI,OAAO,IAAI;AACf;;AAEA,EAAE,OAAO,OAAA,IAAW,OAAO,CAAC,MAAA,GAAS,IAAA,GAAO,OAAO,CAAC,KAAK,CAAC;AAC1D;;;;;;"}
1
+ {"version":3,"file":"envToBool.js","sources":["../../../src/utils/envToBool.ts"],"sourcesContent":["export const FALSY_ENV_VALUES = new Set(['false', 'f', 'n', 'no', 'off', '0']);\nexport const TRUTHY_ENV_VALUES = new Set(['true', 't', 'y', 'yes', 'on', '1']);\n\nexport type StrictBoolCast = {\n strict: true;\n};\n\nexport type LooseBoolCast = {\n strict?: false;\n};\n\nexport type BoolCastOptions = StrictBoolCast | LooseBoolCast;\n\nexport function envToBool(value: unknown, options?: LooseBoolCast): boolean;\nexport function envToBool(value: unknown, options: StrictBoolCast): boolean | null;\nexport function envToBool(value: unknown, options?: BoolCastOptions): boolean | null;\n/**\n * A helper function which casts an ENV variable value to `true` or `false` using the constants defined above.\n * In strict mode, it may return `null` if the value doesn't match any of the predefined values.\n *\n * @param value The value of the env variable\n * @param options -- Only has `strict` key for now, which requires a strict match for `true` in TRUTHY_ENV_VALUES\n * @returns true/false if the lowercase value matches the predefined values above. If not, null in strict mode,\n * and Boolean(value) in loose mode.\n */\nexport function envToBool(value: unknown, options?: BoolCastOptions): boolean | null {\n const normalized = String(value).toLowerCase();\n\n if (FALSY_ENV_VALUES.has(normalized)) {\n return false;\n }\n\n if (TRUTHY_ENV_VALUES.has(normalized)) {\n return true;\n }\n\n return options?.strict ? null : Boolean(value);\n}\n"],"names":[],"mappings":";;MAAa,gBAAiB,GAAE,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC;MAChE,iBAAkB,GAAE,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC;;AAe7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,SAAS,CAAC,KAAK,EAAW,OAAO,EAAoC;AACrF,EAAE,MAAM,UAAW,GAAE,MAAM,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE;;AAEhD,EAAE,IAAI,gBAAgB,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;AACxC,IAAI,OAAO,KAAK;AAChB;;AAEA,EAAE,IAAI,iBAAiB,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;AACzC,IAAI,OAAO,IAAI;AACf;;AAEA,EAAE,OAAO,OAAO,EAAE,MAAO,GAAE,OAAO,OAAO,CAAC,KAAK,CAAC;AAChD;;;;;;"}
@@ -1,4 +1,4 @@
1
- Object.defineProperty(exports, '__esModule', { value: true });
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
 
3
3
  const core = require('@sentry/core');
4
4
  const debugBuild = require('../debug-build.js');
@@ -24,8 +24,7 @@ function logAndExitProcess(error) {
24
24
 
25
25
  const options = client.getOptions();
26
26
  const timeout =
27
- (options && options.shutdownTimeout && options.shutdownTimeout > 0 && options.shutdownTimeout) ||
28
- DEFAULT_SHUTDOWN_TIMEOUT;
27
+ options?.shutdownTimeout && options.shutdownTimeout > 0 ? options.shutdownTimeout : DEFAULT_SHUTDOWN_TIMEOUT;
29
28
  client.close(timeout).then(
30
29
  (result) => {
31
30
  if (!result) {
@@ -1 +1 @@
1
- {"version":3,"file":"errorhandling.js","sources":["../../../src/utils/errorhandling.ts"],"sourcesContent":["import { consoleSandbox, getClient, logger } from '@sentry/core';\nimport { DEBUG_BUILD } from '../debug-build';\nimport type { NodeClient } from '../sdk/client';\n\nconst DEFAULT_SHUTDOWN_TIMEOUT = 2000;\n\n/**\n * @hidden\n */\nexport function logAndExitProcess(error: unknown): void {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.error(error);\n });\n\n const client = getClient<NodeClient>();\n\n if (client === undefined) {\n DEBUG_BUILD && logger.warn('No NodeClient was defined, we are exiting the process now.');\n global.process.exit(1);\n return;\n }\n\n const options = client.getOptions();\n const timeout =\n (options && options.shutdownTimeout && options.shutdownTimeout > 0 && options.shutdownTimeout) ||\n DEFAULT_SHUTDOWN_TIMEOUT;\n client.close(timeout).then(\n (result: boolean) => {\n if (!result) {\n DEBUG_BUILD && logger.warn('We reached the timeout for emptying the request buffer, still exiting now!');\n }\n global.process.exit(1);\n },\n error => {\n DEBUG_BUILD && logger.error(error);\n },\n );\n}\n"],"names":["consoleSandbox","getClient","DEBUG_BUILD","logger"],"mappings":";;;;;AAIA,MAAM,wBAAA,GAA2B,IAAI;;AAErC;AACA;AACA;AACO,SAAS,iBAAiB,CAAC,KAAK,EAAiB;AACxD,EAAEA,mBAAc,CAAC,MAAM;AACvB;AACA,IAAI,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC;AACxB,GAAG,CAAC;;AAEJ,EAAE,MAAM,MAAA,GAASC,cAAS,EAAc;;AAExC,EAAE,IAAI,MAAO,KAAI,SAAS,EAAE;AAC5B,IAAIC,0BAAeC,WAAM,CAAC,IAAI,CAAC,4DAA4D,CAAC;AAC5F,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;AAC1B,IAAI;AACJ;;AAEA,EAAE,MAAM,OAAQ,GAAE,MAAM,CAAC,UAAU,EAAE;AACrC,EAAE,MAAM,OAAQ;AAChB,IAAI,CAAC,OAAQ,IAAG,OAAO,CAAC,mBAAmB,OAAO,CAAC,eAAA,GAAkB,CAAE,IAAG,OAAO,CAAC,eAAe;AACjG,IAAI,wBAAwB;AAC5B,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI;AAC5B,IAAI,CAAC,MAAM,KAAc;AACzB,MAAM,IAAI,CAAC,MAAM,EAAE;AACnB,QAAQD,0BAAeC,WAAM,CAAC,IAAI,CAAC,4EAA4E,CAAC;AAChH;AACA,MAAM,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;AAC5B,KAAK;AACL,IAAI,SAAS;AACb,MAAMD,0BAAeC,WAAM,CAAC,KAAK,CAAC,KAAK,CAAC;AACxC,KAAK;AACL,GAAG;AACH;;;;"}
1
+ {"version":3,"file":"errorhandling.js","sources":["../../../src/utils/errorhandling.ts"],"sourcesContent":["import { consoleSandbox, getClient, logger } from '@sentry/core';\nimport { DEBUG_BUILD } from '../debug-build';\nimport type { NodeClient } from '../sdk/client';\n\nconst DEFAULT_SHUTDOWN_TIMEOUT = 2000;\n\n/**\n * @hidden\n */\nexport function logAndExitProcess(error: unknown): void {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.error(error);\n });\n\n const client = getClient<NodeClient>();\n\n if (client === undefined) {\n DEBUG_BUILD && logger.warn('No NodeClient was defined, we are exiting the process now.');\n global.process.exit(1);\n return;\n }\n\n const options = client.getOptions();\n const timeout =\n options?.shutdownTimeout && options.shutdownTimeout > 0 ? options.shutdownTimeout : DEFAULT_SHUTDOWN_TIMEOUT;\n client.close(timeout).then(\n (result: boolean) => {\n if (!result) {\n DEBUG_BUILD && logger.warn('We reached the timeout for emptying the request buffer, still exiting now!');\n }\n global.process.exit(1);\n },\n error => {\n DEBUG_BUILD && logger.error(error);\n },\n );\n}\n"],"names":["consoleSandbox","getClient","DEBUG_BUILD","logger"],"mappings":";;;;;AAIA,MAAM,wBAAA,GAA2B,IAAI;;AAErC;AACA;AACA;AACO,SAAS,iBAAiB,CAAC,KAAK,EAAiB;AACxD,EAAEA,mBAAc,CAAC,MAAM;AACvB;AACA,IAAI,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC;AACxB,GAAG,CAAC;;AAEJ,EAAE,MAAM,MAAA,GAASC,cAAS,EAAc;;AAExC,EAAE,IAAI,MAAO,KAAI,SAAS,EAAE;AAC5B,IAAIC,0BAAeC,WAAM,CAAC,IAAI,CAAC,4DAA4D,CAAC;AAC5F,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;AAC1B,IAAI;AACJ;;AAEA,EAAE,MAAM,OAAQ,GAAE,MAAM,CAAC,UAAU,EAAE;AACrC,EAAE,MAAM,OAAQ;AAChB,IAAI,OAAO,EAAE,eAAgB,IAAG,OAAO,CAAC,eAAA,GAAkB,CAAA,GAAI,OAAO,CAAC,eAAA,GAAkB,wBAAwB;AAChH,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI;AAC5B,IAAI,CAAC,MAAM,KAAc;AACzB,MAAM,IAAI,CAAC,MAAM,EAAE;AACnB,QAAQD,0BAAeC,WAAM,CAAC,IAAI,CAAC,4EAA4E,CAAC;AAChH;AACA,MAAM,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;AAC5B,KAAK;AACL,IAAI,SAAS;AACb,MAAMD,0BAAeC,WAAM,CAAC,KAAK,CAAC,KAAK,CAAC;AACxC,KAAK;AACL,GAAG;AACH;;;;"}
@@ -1,4 +1,4 @@
1
- Object.defineProperty(exports, '__esModule', { value: true });
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
 
3
3
  /** Build a full URL from request options. */
4
4
  function getRequestUrl(requestOptions) {
@@ -1,4 +1,4 @@
1
- Object.defineProperty(exports, '__esModule', { value: true });
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
 
3
3
  const node_path = require('node:path');
4
4
  const core = require('@sentry/core');
@@ -1 +1 @@
1
- {"version":3,"file":"module.js","sources":["../../../src/utils/module.ts"],"sourcesContent":["import { posix, sep } from 'node:path';\nimport { dirname } from '@sentry/core';\n\n/** normalizes Windows paths */\nfunction normalizeWindowsPath(path: string): string {\n return path\n .replace(/^[A-Z]:/, '') // remove Windows-style prefix\n .replace(/\\\\/g, '/'); // replace all `\\` instances with `/`\n}\n\n/** Creates a function that gets the module name from a filename */\nexport function createGetModuleFromFilename(\n basePath: string = process.argv[1] ? dirname(process.argv[1]) : process.cwd(),\n isWindows: boolean = sep === '\\\\',\n): (filename: string | undefined) => string | undefined {\n const normalizedBase = isWindows ? normalizeWindowsPath(basePath) : basePath;\n\n return (filename: string | undefined) => {\n if (!filename) {\n return;\n }\n\n const normalizedFilename = isWindows ? normalizeWindowsPath(filename) : filename;\n\n // eslint-disable-next-line prefer-const\n let { dir, base: file, ext } = posix.parse(normalizedFilename);\n\n if (ext === '.js' || ext === '.mjs' || ext === '.cjs') {\n file = file.slice(0, ext.length * -1);\n }\n\n // The file name might be URI-encoded which we want to decode to\n // the original file name.\n const decodedFile = decodeURIComponent(file);\n\n if (!dir) {\n // No dirname whatsoever\n dir = '.';\n }\n\n const n = dir.lastIndexOf('/node_modules');\n if (n > -1) {\n return `${dir.slice(n + 14).replace(/\\//g, '.')}:${decodedFile}`;\n }\n\n // Let's see if it's a part of the main module\n // To be a part of main module, it has to share the same base\n if (dir.startsWith(normalizedBase)) {\n const moduleName = dir.slice(normalizedBase.length + 1).replace(/\\//g, '.');\n return moduleName ? `${moduleName}:${decodedFile}` : decodedFile;\n }\n\n return decodedFile;\n };\n}\n"],"names":["dirname","sep","posix"],"mappings":";;;;;AAGA;AACA,SAAS,oBAAoB,CAAC,IAAI,EAAkB;AACpD,EAAE,OAAO;AACT,KAAK,OAAO,CAAC,SAAS,EAAE,EAAE,CAAA;AAC1B,KAAK,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;AACxB;;AAEA;AACO,SAAS,2BAA2B;AAC3C,EAAE,QAAQ,GAAW,OAAO,CAAC,IAAI,CAAC,CAAC,CAAE,GAAEA,YAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA,GAAI,OAAO,CAAC,GAAG,EAAE;AAC/E,EAAE,SAAS,GAAYC,aAAA,KAAQ,IAAI;AACnC,EAAwD;AACxD,EAAE,MAAM,cAAe,GAAE,SAAU,GAAE,oBAAoB,CA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AA,CAAA,GAAA,WAAA;AACA;;AAEA,IAAA,OAAA,WAAA;AACA,GAAA;AACA;;;;"}
1
+ {"version":3,"file":"module.js","sources":["../../../src/utils/module.ts"],"sourcesContent":["import { posix, sep } from 'node:path';\nimport { dirname } from '@sentry/core';\n\n/** normalizes Windows paths */\nfunction normalizeWindowsPath(path: string): string {\n return path\n .replace(/^[A-Z]:/, '') // remove Windows-style prefix\n .replace(/\\\\/g, '/'); // replace all `\\` instances with `/`\n}\n\n/** Creates a function that gets the module name from a filename */\nexport function createGetModuleFromFilename(\n basePath: string = process.argv[1] ? dirname(process.argv[1]) : process.cwd(),\n isWindows: boolean = sep === '\\\\',\n): (filename: string | undefined) => string | undefined {\n const normalizedBase = isWindows ? normalizeWindowsPath(basePath) : basePath;\n\n return (filename: string | undefined) => {\n if (!filename) {\n return;\n }\n\n const normalizedFilename = isWindows ? normalizeWindowsPath(filename) : filename;\n\n // eslint-disable-next-line prefer-const\n let { dir, base: file, ext } = posix.parse(normalizedFilename);\n\n if (ext === '.js' || ext === '.mjs' || ext === '.cjs') {\n file = file.slice(0, ext.length * -1);\n }\n\n // The file name might be URI-encoded which we want to decode to\n // the original file name.\n const decodedFile = decodeURIComponent(file);\n\n if (!dir) {\n // No dirname whatsoever\n dir = '.';\n }\n\n const n = dir.lastIndexOf('/node_modules');\n if (n > -1) {\n return `${dir.slice(n + 14).replace(/\\//g, '.')}:${decodedFile}`;\n }\n\n // Let's see if it's a part of the main module\n // To be a part of main module, it has to share the same base\n if (dir.startsWith(normalizedBase)) {\n const moduleName = dir.slice(normalizedBase.length + 1).replace(/\\//g, '.');\n return moduleName ? `${moduleName}:${decodedFile}` : decodedFile;\n }\n\n return decodedFile;\n };\n}\n"],"names":["dirname","sep","posix"],"mappings":";;;;;AAGA;AACA,SAAS,oBAAoB,CAAC,IAAI,EAAkB;AACpD,EAAE,OAAO;AACT,KAAK,OAAO,CAAC,SAAS,EAAE,EAAE,CAAA;AAC1B,KAAK,OAAO,CAAC,K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AAA,CAAA,EAAA,WAAA,CAAA,CAAA;AACA;;AAEA;AACA;AACA,IAAA,IAAA,GAAA,CAAA,UAAA,CAAA,cAAA,CAAA,EAAA;AACA,MAAA,MAAA,UAAA,GAAA,GAAA,CAAA,KAAA,CAAA,cAAA,CAAA,MAAA,GAAA,CAAA,CAAA,CAAA,OAAA,CAAA,KAAA,EAAA,GAAA,CAAA;AACA,MAAA,OAAA,UAAA,GAAA,CAAA,EAAA,UAAA,CAAA,CAAA,EAAA,WAAA,CAAA,CAAA,GAAA,WAAA;AACA;;AAEA,IAAA,OAAA,WAAA;AACA,GAAA;AACA;;;;"}
@@ -1,4 +1,4 @@
1
- Object.defineProperty(exports, '__esModule', { value: true });
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
 
3
3
  const SINGLE_ARG_COMMANDS = ['get', 'set', 'setex'];
4
4
 
@@ -95,9 +95,6 @@ function calculateCacheItemSize(response) {
95
95
  : getSize(response);
96
96
  }
97
97
 
98
- // TODO(v9): This is inlined from core so we can deprecate `flatten`.
99
- // It's usage can be replaced with `Array.flat` in v9.
100
-
101
98
  function flatten(input) {
102
99
  const result = [];
103
100
 
@@ -1 +1 @@
1
- {"version":3,"file":"redisCache.js","sources":["../../../src/utils/redisCache.ts"],"sourcesContent":["import type { CommandArgs as IORedisCommandArgs } from '@opentelemetry/instrumentation-ioredis';\n\nconst SINGLE_ARG_COMMANDS = ['get', 'set', 'setex'];\n\nexport const GET_COMMANDS = ['get', 'mget'];\nexport const SET_COMMANDS = ['set', 'setex'];\n// todo: del, expire\n\n/** Checks if a given command is in the list of redis commands.\n * Useful because commands can come in lowercase or uppercase (depending on the library). */\nexport function isInCommands(redisCommands: string[], command: string): boolean {\n return redisCommands.includes(command.toLowerCase());\n}\n\n/** Determine cache operation based on redis statement */\nexport function getCacheOperation(\n command: string,\n): 'cache.get' | 'cache.put' | 'cache.remove' | 'cache.flush' | undefined {\n if (isInCommands(GET_COMMANDS, command)) {\n return 'cache.get';\n } else if (isInCommands(SET_COMMANDS, command)) {\n return 'cache.put';\n } else {\n return undefined;\n }\n}\n\nfunction keyHasPrefix(key: string, prefixes: string[]): boolean {\n return prefixes.some(prefix => key.startsWith(prefix));\n}\n\n/** Safely converts a redis key to a string (comma-separated if there are multiple keys) */\nexport function getCacheKeySafely(redisCommand: string, cmdArgs: IORedisCommandArgs): string[] | undefined {\n try {\n if (cmdArgs.length === 0) {\n return undefined;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const processArg = (arg: string | Buffer | number | any[]): string[] => {\n if (typeof arg === 'string' || typeof arg === 'number' || Buffer.isBuffer(arg)) {\n return [arg.toString()];\n } else if (Array.isArray(arg)) {\n return flatten(arg.map(arg => processArg(arg)));\n } else {\n return ['<unknown>'];\n }\n };\n\n const firstArg = cmdArgs[0];\n if (isInCommands(SINGLE_ARG_COMMANDS, redisCommand) && firstArg != null) {\n return processArg(firstArg);\n }\n\n return flatten(cmdArgs.map(arg => processArg(arg)));\n } catch (e) {\n return undefined;\n }\n}\n\n/** Determines whether a redis operation should be considered as \"cache operation\" by checking if a key is prefixed.\n * We only support certain commands (such as 'set', 'get', 'mget'). */\nexport function shouldConsiderForCache(redisCommand: string, keys: string[], prefixes: string[]): boolean {\n if (!getCacheOperation(redisCommand)) {\n return false;\n }\n\n for (const key of keys) {\n if (keyHasPrefix(key, prefixes)) {\n return true;\n }\n }\n return false;\n}\n\n/** Calculates size based on the cache response value */\nexport function calculateCacheItemSize(response: unknown): number | undefined {\n const getSize = (value: unknown): number | undefined => {\n try {\n if (Buffer.isBuffer(value)) return value.byteLength;\n else if (typeof value === 'string') return value.length;\n else if (typeof value === 'number') return value.toString().length;\n else if (value === null || value === undefined) return 0;\n return JSON.stringify(value).length;\n } catch (e) {\n return undefined;\n }\n };\n\n return Array.isArray(response)\n ? response.reduce((acc: number | undefined, curr) => {\n const size = getSize(curr);\n return typeof size === 'number' ? (acc !== undefined ? acc + size : size) : acc;\n }, 0)\n : getSize(response);\n}\n\n// TODO(v9): This is inlined from core so we can deprecate `flatten`.\n// It's usage can be replaced with `Array.flat` in v9.\ntype NestedArray<T> = Array<NestedArray<T> | T>;\nfunction flatten<T>(input: NestedArray<T>): T[] {\n const result: T[] = [];\n\n const flattenHelper = (input: NestedArray<T>): void => {\n input.forEach((el: T | NestedArray<T>) => {\n if (Array.isArray(el)) {\n flattenHelper(el as NestedArray<T>);\n } else {\n result.push(el as T);\n }\n });\n };\n\n flattenHelper(input);\n return result;\n}\n"],"names":[],"mappings":";;AAEA,MAAM,mBAAA,GAAsB,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC;;MAEtC,YAAa,GAAE,CAAC,KAAK,EAAE,MAAM;MAC7B,YAAa,GAAE,CAAC,KAAK,EAAE,OAAO;AAC3C;;AAEA;AACA;AACO,SAAS,YAAY,CAAC,aAAa,EAAY,OAAO,EAAmB;AAChF,EAAE,OAAO,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;AACtD;;AAEA;AACO,SAAS,iBAAiB;AACjC,EAAE,OAAO;AACT,EAA0E;AAC1E,EAAE,IAAI,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC,EAAE;AAC3C,IAAI,OAAO,WAAW;AACtB,GAAE,MAAO,IAAI,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC,EAAE;AAClD,IAAI,OAAO,WAAW;AACtB,SAAS;AACT,IAAI,OAAO,SAAS;AACpB;AACA;;AAEA,SAAS,YAAY,CAAC,GAAG,EAAU,QAAQ,EAAqB;AAChE,EAAE,OAAO,QAAQ,CAAC,IAAI,CAAC,MAAA,IAAU,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;AACxD;;AAEA;AACO,SAAS,iBAAiB,CAAC,YAAY,EAAU,OAAO,EAA4C;AAC3G,EAAE,IAAI;AACN,IAAI,IAAI,OAAO,CAAC,MAAO,KAAI,CAAC,EAAE;AAC9B,MAAM,OAAO,SAAS;AACtB;;AAE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;AACA,KAAK,CAAC;AACN,GAAG;;AAEH,EAAE,aAAa,CAAC,KAAK,CAAC;AACtB,EAAE,OAAO,MAAM;AACf;;;;;;;;;;"}
1
+ {"version":3,"file":"redisCache.js","sources":["../../../src/utils/redisCache.ts"],"sourcesContent":["import type { CommandArgs as IORedisCommandArgs } from '@opentelemetry/instrumentation-ioredis';\n\nconst SINGLE_ARG_COMMANDS = ['get', 'set', 'setex'];\n\nexport const GET_COMMANDS = ['get', 'mget'];\nexport const SET_COMMANDS = ['set', 'setex'];\n// todo: del, expire\n\n/** Checks if a given command is in the list of redis commands.\n * Useful because commands can come in lowercase or uppercase (depending on the library). */\nexport function isInCommands(redisCommands: string[], command: string): boolean {\n return redisCommands.includes(command.toLowerCase());\n}\n\n/** Determine cache operation based on redis statement */\nexport function getCacheOperation(\n command: string,\n): 'cache.get' | 'cache.put' | 'cache.remove' | 'cache.flush' | undefined {\n if (isInCommands(GET_COMMANDS, command)) {\n return 'cache.get';\n } else if (isInCommands(SET_COMMANDS, command)) {\n return 'cache.put';\n } else {\n return undefined;\n }\n}\n\nfunction keyHasPrefix(key: string, prefixes: string[]): boolean {\n return prefixes.some(prefix => key.startsWith(prefix));\n}\n\n/** Safely converts a redis key to a string (comma-separated if there are multiple keys) */\nexport function getCacheKeySafely(redisCommand: string, cmdArgs: IORedisCommandArgs): string[] | undefined {\n try {\n if (cmdArgs.length === 0) {\n return undefined;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const processArg = (arg: string | Buffer | number | any[]): string[] => {\n if (typeof arg === 'string' || typeof arg === 'number' || Buffer.isBuffer(arg)) {\n return [arg.toString()];\n } else if (Array.isArray(arg)) {\n return flatten(arg.map(arg => processArg(arg)));\n } else {\n return ['<unknown>'];\n }\n };\n\n const firstArg = cmdArgs[0];\n if (isInCommands(SINGLE_ARG_COMMANDS, redisCommand) && firstArg != null) {\n return processArg(firstArg);\n }\n\n return flatten(cmdArgs.map(arg => processArg(arg)));\n } catch (e) {\n return undefined;\n }\n}\n\n/** Determines whether a redis operation should be considered as \"cache operation\" by checking if a key is prefixed.\n * We only support certain commands (such as 'set', 'get', 'mget'). */\nexport function shouldConsiderForCache(redisCommand: string, keys: string[], prefixes: string[]): boolean {\n if (!getCacheOperation(redisCommand)) {\n return false;\n }\n\n for (const key of keys) {\n if (keyHasPrefix(key, prefixes)) {\n return true;\n }\n }\n return false;\n}\n\n/** Calculates size based on the cache response value */\nexport function calculateCacheItemSize(response: unknown): number | undefined {\n const getSize = (value: unknown): number | undefined => {\n try {\n if (Buffer.isBuffer(value)) return value.byteLength;\n else if (typeof value === 'string') return value.length;\n else if (typeof value === 'number') return value.toString().length;\n else if (value === null || value === undefined) return 0;\n return JSON.stringify(value).length;\n } catch (e) {\n return undefined;\n }\n };\n\n return Array.isArray(response)\n ? response.reduce((acc: number | undefined, curr) => {\n const size = getSize(curr);\n return typeof size === 'number' ? (acc !== undefined ? acc + size : size) : acc;\n }, 0)\n : getSize(response);\n}\n\ntype NestedArray<T> = Array<NestedArray<T> | T>;\n\nfunction flatten<T>(input: NestedArray<T>): T[] {\n const result: T[] = [];\n\n const flattenHelper = (input: NestedArray<T>): void => {\n input.forEach((el: T | NestedArray<T>) => {\n if (Array.isArray(el)) {\n flattenHelper(el as NestedArray<T>);\n } else {\n result.push(el as T);\n }\n });\n };\n\n flattenHelper(input);\n return result;\n}\n"],"names":[],"mappings":";;AAEA,MAAM,mBAAA,GAAsB,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC;;MAEtC,YAAa,GAAE,CAAC,KAAK,EAAE,MAAM;MAC7B,YAAa,GAAE,CAAC,KAAK,EAAE,OAAO;AAC3C;;AAEA;AACA;AACO,SAAS,YAAY,CAAC,aAAa,EAAY,OAAO,EAAmB;AAChF,EAAE,OAAO,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;AACtD;;AAEA;AACO,SAAS,iBAAiB;AACjC,EAAE,OAAO;AACT,EAA0E;AAC1E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AC;AAClC,QAAQ,OAAO,OAAO,IAAA,KAAS,QAAS,IAAG,GAAI,KAAI,SAAU,GAAE,MAAM,IAAA,GAAO,IAAI,IAAI,GAAG;AACvF,OAAO,EAAE,CAAC;AACV,MAAM,OAAO,CAAC,QAAQ,CAAC;AACvB;;AAIA,SAAS,OAAO,CAAI,KAAK,EAAuB;AAChD,EAAE,MAAM,MAAM,GAAQ,EAAE;;AAExB,EAAE,MAAM,aAAA,GAAgB,CAAC,KAAK,KAA2B;AACzD,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,KAAyB;AAC9C,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE;AAC7B,QAAQ,aAAa,CAAC,EAAA,EAAqB;AAC3C,aAAa;AACb,QAAQ,MAAM,CAAC,IAAI,CAAC,IAAQ;AAC5B;AACA,KAAK,CAAC;AACN,GAAG;;AAEH,EAAE,aAAa,CAAC,KAAK,CAAC;AACtB,EAAE,OAAO,MAAM;AACf;;;;;;;;;;"}
@@ -1,4 +1,3 @@
1
- import { _optionalChain } from '@sentry/core';
2
1
  import { withMonitor, captureException } from '@sentry/core';
3
2
  import { replaceCronNames } from './common.js';
4
3
 
@@ -29,13 +28,16 @@ function instrumentNodeCron(lib) {
29
28
  apply(target, thisArg, argArray) {
30
29
  const [expression, callback, options] = argArray;
31
30
 
32
- if (!_optionalChain([options, 'optionalAccess', _ => _.name])) {
31
+ const name = options?.name;
32
+ const timezone = options?.timezone;
33
+
34
+ if (!name) {
33
35
  throw new Error('Missing "name" for scheduled job. A name is required for Sentry check-in monitoring.');
34
36
  }
35
37
 
36
- async function monitoredCallback() {
38
+ const monitoredCallback = async () => {
37
39
  return withMonitor(
38
- options.name,
40
+ name,
39
41
  async () => {
40
42
  // We have to manually catch here and capture the exception because node-cron swallows errors
41
43
  // https://github.com/node-cron/node-cron/issues/399
@@ -48,16 +50,16 @@ function instrumentNodeCron(lib) {
48
50
  },
49
51
  {
50
52
  schedule: { type: 'crontab', value: replaceCronNames(expression) },
51
- timezone: _optionalChain([options, 'optionalAccess', _2 => _2.timezone]),
53
+ timezone,
52
54
  },
53
55
  );
54
- }
56
+ };
55
57
 
56
58
  return target.apply(thisArg, [expression, monitoredCallback, options]);
57
59
  },
58
60
  });
59
61
  } else {
60
- return target[prop];
62
+ return target[prop ];
61
63
  }
62
64
  },
63
65
  });
@@ -1 +1 @@
1
- {"version":3,"file":"node-cron.js","sources":["../../../src/cron/node-cron.ts"],"sourcesContent":["import { captureException, withMonitor } from '@sentry/core';\nimport { replaceCronNames } from './common';\n\nexport interface NodeCronOptions {\n name: string;\n timezone?: string;\n}\n\nexport interface NodeCron {\n schedule: (cronExpression: string, callback: () => void, options: NodeCronOptions) => unknown;\n}\n\n/**\n * Wraps the `node-cron` library with check-in monitoring.\n *\n * ```ts\n * import * as Sentry from \"@sentry/node\";\n * import * as cron from \"node-cron\";\n *\n * const cronWithCheckIn = Sentry.cron.instrumentNodeCron(cron);\n *\n * cronWithCheckIn.schedule(\n * \"* * * * *\",\n * () => {\n * console.log(\"running a task every minute\");\n * },\n * { name: \"my-cron-job\" },\n * );\n * ```\n */\nexport function instrumentNodeCron<T>(lib: Partial<NodeCron> & T): T {\n return new Proxy(lib, {\n get(target, prop: keyof NodeCron) {\n if (prop === 'schedule' && target.schedule) {\n // When 'get' is called for schedule, return a proxied version of the schedule function\n return new Proxy(target.schedule, {\n apply(target, thisArg, argArray: Parameters<NodeCron['schedule']>) {\n const [expression, callback, options] = argArray;\n\n if (!options?.name) {\n throw new Error('Missing \"name\" for scheduled job. A name is required for Sentry check-in monitoring.');\n }\n\n async function monitoredCallback(): Promise<void> {\n return withMonitor(\n options.name,\n async () => {\n // We have to manually catch here and capture the exception because node-cron swallows errors\n // https://github.com/node-cron/node-cron/issues/399\n try {\n return await callback();\n } catch (e) {\n captureException(e);\n throw e;\n }\n },\n {\n schedule: { type: 'crontab', value: replaceCronNames(expression) },\n timezone: options?.timezone,\n },\n );\n }\n\n return target.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AAA,CAAA,CAAA,EAAE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,EAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAiB,EAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAC,CAAC;UACvE,CAAA;QACX,CAAS,CAAC;MACV,EAAa,CAAA,CAAA,CAAA,EAAA;QACL,CAAO,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAC,CAAA,CAAA,CAAA,CAAI,CAAC;MAC3B;IACK,CAAA;EACL,CAAG,CAAC;AACJ;;"}
1
+ {"version":3,"file":"node-cron.js","sources":["../../../src/cron/node-cron.ts"],"sourcesContent":["import { captureException, withMonitor } from '@sentry/core';\nimport { replaceCronNames } from './common';\n\nexport interface NodeCronOptions {\n name: string;\n timezone?: string;\n}\n\nexport interface NodeCron {\n schedule: (cronExpression: string, callback: () => void, options: NodeCronOptions | undefined) => unknown;\n}\n\n/**\n * Wraps the `node-cron` library with check-in monitoring.\n *\n * ```ts\n * import * as Sentry from \"@sentry/node\";\n * import * as cron from \"node-cron\";\n *\n * const cronWithCheckIn = Sentry.cron.instrumentNodeCron(cron);\n *\n * cronWithCheckIn.schedule(\n * \"* * * * *\",\n * () => {\n * console.log(\"running a task every minute\");\n * },\n * { name: \"my-cron-job\" },\n * );\n * ```\n */\nexport function instrumentNodeCron<T>(lib: Partial<NodeCron> & T): T {\n return new Proxy(lib, {\n get(target, prop) {\n if (prop === 'schedule' && target.schedule) {\n // When 'get' is called for schedule, return a proxied version of the schedule function\n return new Proxy(target.schedule, {\n apply(target, thisArg, argArray: Parameters<NodeCron['schedule']>) {\n const [expression, callback, options] = argArray;\n\n const name = options?.name;\n const timezone = options?.timezone;\n\n if (!name) {\n throw new Error('Missing \"name\" for scheduled job. A name is required for Sentry check-in monitoring.');\n }\n\n const monitoredCallback = async (): Promise<void> => {\n return withMonitor(\n name,\n async () => {\n // We have to manually catch here and capture the exception because node-cron swallows errors\n // https://github.com/node-cron/node-cron/issues/399\n try {\n return await callback();\n } catch (e) {\n captureException(e);\n throw e;\n }\n },\n {\n schedule: { type: 'crontab', value: replaceCronNames(expression) },\n timezone,\n },\n );\n };\n\n return target.apply(thisArg, [expression, monitoredCallback, options]);\n },\n });\n } else {\n return target[prop as keyof T];\n }\n },\n });\n}\n"],"names":[],"mappings":";;;AAYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,kBAAkB,CAAI,GAAG,EAA4B;AACrE,EAAE,OAAO,IAAI,KAAK,CAAC,GAAG,EAAE;AACxB,IAAI,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE;AACtB,MAAM,IAAI,IAAK,KAAI,cAAc,MAAM,CAAC,QAAQ,EAAE;AAClD;AACA,QAAQ,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE;AAC1C,UAAU,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAoC;AAC7E,YAAY,MAAM,CAAC,UAAU,EAAE,QAAQ,EAAE,OAAO,CAAE,GAAE,QAAQ;;AAE5D,YAAY,MAAM,IAAA,GAAO,OAAO,EAAE,IAAI;AACtC,YAAY,MAAM,QAAA,GAAW,OAAO,EAAE,QAAQ;;AAE9C,YAAY,IAAI,CAAC,IAAI,EAAE;AACvB,cAAc,MAAM,IAAI,KAAK,CAAC,sFAAsF,CAAC;AACrH;;AAEA,YAAY,MAAM,iBAAA,GAAoB,YAA2B;AACjE,cAAc,OAAO,WAAW;AAChC,gBAAgB,IAAI;AACpB,gBAAgB,YAAY;AAC5B;AACA;AACA,kBAAkB,IAAI;AACtB,oBAAoB,OAAO,MAAM,QAAQ,EAAE;AAC3C,mBAAoB,CAAA,OAAO,CAAC,EAAE;AAC9B,oBAAoB,gBAAgB,CAAC,CAAC,CAAC;AACvC,oBAAoB,MAAM,CAAC;AAC3B;AACA,iBAAiB;AACjB,gBAAgB;AAChB,kBAAkB,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,gBAAgB,CAAC,UAAU,GAAG;AACpF,kBAAkB,QAAQ;AAC1B,iBAAiB;AACjB,eAAe;AACf,aAAa;;AAEb,YAAY,OAAO,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,UAAU,EAAE,iBAAiB,EAAE,OAAO,CAAC,CAAC;AAClF,WAAW;AACX,SAAS,CAAC;AACV,aAAa;AACb,QAAQ,OAAO,MAAM,CAAC,IAAA,EAAgB;AACtC;AACA,KAAK;AACL,GAAG,CAAC;AACJ;;;;"}
@@ -1,4 +1,3 @@
1
- import { _optionalChain } from '@sentry/core';
2
1
  import { withMonitor } from '@sentry/core';
3
2
  import { replaceCronNames } from './common.js';
4
3
 
@@ -42,7 +41,7 @@ function instrumentNodeSchedule(lib) {
42
41
  return withMonitor(
43
42
  monitorSlug,
44
43
  async () => {
45
- await _optionalChain([callback, 'optionalCall', _ => _()]);
44
+ await callback?.();
46
45
  },
47
46
  {
48
47
  schedule: { type: 'crontab', value: replaceCronNames(expression) },
@@ -1 +1 @@
1
- {"version":3,"file":"node-schedule.js","sources":["../../../src/cron/node-schedule.ts"],"sourcesContent":["import { withMonitor } from '@sentry/core';\nimport { replaceCronNames } from './common';\n\nexport interface NodeSchedule {\n scheduleJob(\n nameOrExpression: string | Date | object,\n expressionOrCallback: string | Date | object | (() => void),\n callback?: () => void,\n ): unknown;\n}\n\n/**\n * Instruments the `node-schedule` library to send a check-in event to Sentry for each job execution.\n *\n * ```ts\n * import * as Sentry from '@sentry/node';\n * import * as schedule from 'node-schedule';\n *\n * const scheduleWithCheckIn = Sentry.cron.instrumentNodeSchedule(schedule);\n *\n * const job = scheduleWithCheckIn.scheduleJob('my-cron-job', '* * * * *', () => {\n * console.log('You will see this message every minute');\n * });\n * ```\n */\nexport function instrumentNodeSchedule<T>(lib: T & NodeSchedule): T {\n return new Proxy(lib, {\n get(target, prop: keyof NodeSchedule) {\n if (prop === 'scheduleJob') {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n return new Proxy(target.scheduleJob, {\n apply(target, thisArg, argArray: Parameters<NodeSchedule['scheduleJob']>) {\n const [nameOrExpression, expressionOrCallback, callback] = argArray;\n\n if (\n typeof nameOrExpression !== 'string' ||\n typeof expressionOrCallback !== 'string' ||\n typeof callback !== 'function'\n ) {\n throw new Error(\n \"Automatic instrumentation of 'node-schedule' requires the first parameter of 'scheduleJob' to be a job name string and the second parameter to be a crontab string\",\n );\n }\n\n const monitorSlug = nameOrExpression;\n const expression = expressionOrCallback;\n\n async function monitoredCallback(): Promise<void> {\n return withMonitor(\n monitorSlug,\n async () => {\n await callback?.();\n },\n {\n schedule: { type: 'crontab', value: replaceCronNames(expression) },\n },\n );\n }\n\n return target.apply(thisArg, [monitorSlug, expression, monitoredCallback]);\n },\n });\n }\n\n return target[prop];\n },\n });\n}\n"],"names":[],"mappings":";;;;AAWA,CAAA,CAAA;CACA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;CACA;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AA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAC,CAAA,CAAA,CAAA,CAAA,CAAK,CAAC,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,EAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,EAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAiB,CAAC,CAAC;UAC3E,CAAA;QACX,CAAS,CAAC;MACV;;MAEM,CAAO,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAC,CAAA,CAAA,CAAA,CAAI,CAAC;IACpB,CAAA;EACL,CAAG,CAAC;AACJ;;"}
1
+ {"version":3,"file":"node-schedule.js","sources":["../../../src/cron/node-schedule.ts"],"sourcesContent":["import { withMonitor } from '@sentry/core';\nimport { replaceCronNames } from './common';\n\nexport interface NodeSchedule {\n scheduleJob(\n nameOrExpression: string | Date | object,\n expressionOrCallback: string | Date | object | (() => void),\n callback?: () => void,\n ): unknown;\n}\n\n/**\n * Instruments the `node-schedule` library to send a check-in event to Sentry for each job execution.\n *\n * ```ts\n * import * as Sentry from '@sentry/node';\n * import * as schedule from 'node-schedule';\n *\n * const scheduleWithCheckIn = Sentry.cron.instrumentNodeSchedule(schedule);\n *\n * const job = scheduleWithCheckIn.scheduleJob('my-cron-job', '* * * * *', () => {\n * console.log('You will see this message every minute');\n * });\n * ```\n */\nexport function instrumentNodeSchedule<T>(lib: T & NodeSchedule): T {\n return new Proxy(lib, {\n get(target, prop: keyof NodeSchedule) {\n if (prop === 'scheduleJob') {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n return new Proxy(target.scheduleJob, {\n apply(target, thisArg, argArray: Parameters<NodeSchedule['scheduleJob']>) {\n const [nameOrExpression, expressionOrCallback, callback] = argArray;\n\n if (\n typeof nameOrExpression !== 'string' ||\n typeof expressionOrCallback !== 'string' ||\n typeof callback !== 'function'\n ) {\n throw new Error(\n \"Automatic instrumentation of 'node-schedule' requires the first parameter of 'scheduleJob' to be a job name string and the second parameter to be a crontab string\",\n );\n }\n\n const monitorSlug = nameOrExpression;\n const expression = expressionOrCallback;\n\n async function monitoredCallback(): Promise<void> {\n return withMonitor(\n monitorSlug,\n async () => {\n await callback?.();\n },\n {\n schedule: { type: 'crontab', value: replaceCronNames(expression) },\n },\n );\n }\n\n return target.apply(thisArg, [monitorSlug, expression, monitoredCallback]);\n },\n });\n }\n\n return target[prop];\n },\n });\n}\n"],"names":[],"mappings":";;;AAWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,sBAAsB,CAAI,GAAG,EAAuB;AACpE,EAAE,OAAO,IAAI,KAAK,CAAC,GAAG,EAAE;AACxB,IAAI,GAAG,CAAC,MAAM,EAAE,IAAI,EAAsB;AAC1C,MAAM,IAAI,IAAK,KAAI,aAAa,EAAE;AAClC;AACA,QAAQ,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE;AAC7C,UAAU,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAA2C;AACpF,YAAY,MAAM,CAAC,gBAAgB,EAAE,oBAAoB,EAAE,QAAQ,CAAE,GAAE,QAAQ;;AAE/E,YAAY;AACZ,cAAc,OAAO,gBAAiB,KAAI,QAAS;AACnD,cAAc,OAAO,oBAAqB,KAAI,QAAS;AACvD,cAAc,OAAO,aAAa;AAClC,cAAc;AACd,cAAc,MAAM,IAAI,KAAK;AAC7B,gBAAgB,oKAAoK;AACpL,eAAe;AACf;;AAEA,YAAY,MAAM,WAAY,GAAE,gBAAgB;AAChD,YAAY,MAAM,UAAW,GAAE,oBAAoB;;AAEnD,YAAY,eAAe,iBAAiB,GAAkB;AAC9D,cAAc,OAAO,WAAW;AAChC,gBAAgB,WAAW;AAC3B,gBAAgB,YAAY;AAC5B,kBAAkB,MAAM,QAAQ,IAAI;AACpC,iBAAiB;AACjB,gBAAgB;AAChB,kBAAkB,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,gBAAgB,CAAC,UAAU,GAAG;AACpF,iBAAiB;AACjB,eAAe;AACf;;AAEA,YAAY,OAAO,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,WAAW,EAAE,UAAU,EAAE,iBAAiB,CAAC,CAAC;AACtF,WAAW;AACX,SAAS,CAAC;AACV;;AAEA,MAAM,OAAO,MAAM,CAAC,IAAI,CAAC;AACzB,KAAK;AACL,GAAG,CAAC;AACJ;;;;"}
@@ -19,7 +19,6 @@ export { mongooseIntegration } from './integrations/tracing/mongoose.js';
19
19
  export { mysqlIntegration } from './integrations/tracing/mysql.js';
20
20
  export { mysql2Integration } from './integrations/tracing/mysql2.js';
21
21
  export { redisIntegration } from './integrations/tracing/redis.js';
22
- export { nestIntegration, setupNestErrorHandler } from './integrations/tracing/nest/nest.js';
23
22
  export { postgresIntegration } from './integrations/tracing/postgres.js';
24
23
  export { prismaIntegration } from './integrations/tracing/prisma.js';
25
24
  export { hapiIntegration, setupHapiErrorHandler } from './integrations/tracing/hapi/index.js';
@@ -31,7 +30,7 @@ export { tediousIntegration } from './integrations/tracing/tedious.js';
31
30
  export { genericPoolIntegration } from './integrations/tracing/genericPool.js';
32
31
  export { dataloaderIntegration } from './integrations/tracing/dataloader.js';
33
32
  export { amqplibIntegration } from './integrations/tracing/amqplib.js';
34
- export { childProcessIntegration, processThreadBreadcrumbIntegration } from './integrations/childProcess.js';
33
+ export { childProcessIntegration } from './integrations/childProcess.js';
35
34
  export { SentryContextManager } from './otel/contextManager.js';
36
35
  export { generateInstrumentOnce } from './otel/instrument.js';
37
36
  export { getDefaultIntegrations, getDefaultIntegrationsWithoutPerformance, init, initWithoutDefaultIntegrations, validateOpenTelemetrySetup } from './sdk/index.js';
@@ -42,6 +41,6 @@ export { createGetModuleFromFilename } from './utils/module.js';
42
41
  export { makeNodeTransport } from './transports/http.js';
43
42
  export { NodeClient } from './sdk/client.js';
44
43
  export { cron } from './cron/index.js';
45
- export { DEFAULT_USER_INCLUDES, SDK_VERSION, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, Scope, addBreadcrumb, addEventProcessor, addIntegration, addRequestDataToEvent, captureCheckIn, captureConsoleIntegration, captureEvent, captureException, captureFeedback, captureMessage, captureSession, close, continueTrace, createTransport, debugIntegration, dedupeIntegration, endSession, extraErrorDataIntegration, extractRequestData, flush, functionToStringIntegration, getActiveSpan, getClient, getCurrentHub, getCurrentScope, getGlobalScope, getIsolationScope, getRootSpan, getSpanDescendants, getSpanStatusFromHttpCode, getTraceData, getTraceMetaTags, inboundFiltersIntegration, isInitialized, lastEventId, linkedErrorsIntegration, metricsDefault as metrics, parameterize, profiler, requestDataIntegration, rewriteFramesIntegration, sessionTimingIntegration, setContext, setCurrentClient, setExtra, setExtras, setHttpStatus, setMeasurement, setTag, setTags, setUser, spanToBaggageHeader, spanToJSON, spanToTraceHeader, startInactiveSpan, startNewTrace, startSession, startSpan, startSpanManual, suppressTracing, trpcMiddleware, updateSpanName, withActiveSpan, withIsolationScope, withMonitor, withScope, zodErrorsIntegration } from '@sentry/core';
46
- export { addOpenTelemetryInstrumentation, setOpenTelemetryContextAsyncContextStrategy as setNodeAsyncContextStrategy } from '@sentry/opentelemetry';
44
+ export { setOpenTelemetryContextAsyncContextStrategy as setNodeAsyncContextStrategy } from '@sentry/opentelemetry';
45
+ export { SDK_VERSION, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, Scope, addBreadcrumb, addEventProcessor, addIntegration, captureCheckIn, captureConsoleIntegration, captureEvent, captureException, captureFeedback, captureMessage, captureSession, close, continueTrace, createTransport, dedupeIntegration, endSession, extraErrorDataIntegration, flush, functionToStringIntegration, getActiveSpan, getClient, getCurrentScope, getGlobalScope, getIsolationScope, getRootSpan, getSpanDescendants, getSpanStatusFromHttpCode, getTraceData, getTraceMetaTags, inboundFiltersIntegration, isInitialized, lastEventId, linkedErrorsIntegration, parameterize, profiler, requestDataIntegration, rewriteFramesIntegration, setContext, setCurrentClient, setExtra, setExtras, setHttpStatus, setMeasurement, setTag, setTags, setUser, spanToBaggageHeader, spanToJSON, spanToTraceHeader, startInactiveSpan, startNewTrace, startSession, startSpan, startSpanManual, suppressTracing, trpcMiddleware, updateSpanName, withActiveSpan, withIsolationScope, withMonitor, withScope, zodErrorsIntegration } from '@sentry/core';
47
46
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}