@sentry/node 9.35.0 → 9.36.0-alpha.1

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 (474) hide show
  1. package/build/cjs/index.js +38 -56
  2. package/build/cjs/index.js.map +1 -1
  3. package/build/cjs/integrations/fs.js +2 -2
  4. package/build/cjs/integrations/fs.js.map +1 -1
  5. package/build/cjs/integrations/http/index.js +7 -11
  6. package/build/cjs/integrations/http/index.js.map +1 -1
  7. package/build/cjs/integrations/node-fetch/index.js +4 -5
  8. package/build/cjs/integrations/node-fetch/index.js.map +1 -1
  9. package/build/cjs/integrations/tracing/amqplib.js +4 -5
  10. package/build/cjs/integrations/tracing/amqplib.js.map +1 -1
  11. package/build/cjs/integrations/tracing/connect.js +3 -4
  12. package/build/cjs/integrations/tracing/connect.js.map +1 -1
  13. package/build/cjs/integrations/tracing/dataloader.js +3 -3
  14. package/build/cjs/integrations/tracing/dataloader.js.map +1 -1
  15. package/build/cjs/integrations/tracing/express.js +5 -7
  16. package/build/cjs/integrations/tracing/express.js.map +1 -1
  17. package/build/cjs/integrations/tracing/fastify/fastify-otel/index.js +3 -3
  18. package/build/cjs/integrations/tracing/fastify/fastify-otel/index.js.map +1 -1
  19. package/build/cjs/integrations/tracing/fastify/index.js +6 -6
  20. package/build/cjs/integrations/tracing/fastify/index.js.map +1 -1
  21. package/build/cjs/integrations/tracing/genericPool.js +3 -3
  22. package/build/cjs/integrations/tracing/genericPool.js.map +1 -1
  23. package/build/cjs/integrations/tracing/graphql.js +3 -4
  24. package/build/cjs/integrations/tracing/graphql.js.map +1 -1
  25. package/build/cjs/integrations/tracing/hapi/index.js +3 -4
  26. package/build/cjs/integrations/tracing/hapi/index.js.map +1 -1
  27. package/build/cjs/integrations/tracing/kafka.js +4 -5
  28. package/build/cjs/integrations/tracing/kafka.js.map +1 -1
  29. package/build/cjs/integrations/tracing/knex.js +3 -3
  30. package/build/cjs/integrations/tracing/knex.js.map +1 -1
  31. package/build/cjs/integrations/tracing/koa.js +4 -6
  32. package/build/cjs/integrations/tracing/koa.js.map +1 -1
  33. package/build/cjs/integrations/tracing/lrumemoizer.js +2 -2
  34. package/build/cjs/integrations/tracing/lrumemoizer.js.map +1 -1
  35. package/build/cjs/integrations/tracing/mongo.js +3 -4
  36. package/build/cjs/integrations/tracing/mongo.js.map +1 -1
  37. package/build/cjs/integrations/tracing/mongoose.js +3 -4
  38. package/build/cjs/integrations/tracing/mongoose.js.map +1 -1
  39. package/build/cjs/integrations/tracing/mysql.js +2 -2
  40. package/build/cjs/integrations/tracing/mysql.js.map +1 -1
  41. package/build/cjs/integrations/tracing/mysql2.js +3 -4
  42. package/build/cjs/integrations/tracing/mysql2.js.map +1 -1
  43. package/build/cjs/integrations/tracing/postgres.js +3 -4
  44. package/build/cjs/integrations/tracing/postgres.js.map +1 -1
  45. package/build/cjs/integrations/tracing/postgresjs.js +3 -4
  46. package/build/cjs/integrations/tracing/postgresjs.js.map +1 -1
  47. package/build/cjs/integrations/tracing/prisma.js +2 -2
  48. package/build/cjs/integrations/tracing/prisma.js.map +1 -1
  49. package/build/cjs/integrations/tracing/redis.js +3 -3
  50. package/build/cjs/integrations/tracing/redis.js.map +1 -1
  51. package/build/cjs/integrations/tracing/tedious.js +3 -3
  52. package/build/cjs/integrations/tracing/tedious.js.map +1 -1
  53. package/build/cjs/integrations/tracing/vercelai/index.js +2 -2
  54. package/build/cjs/integrations/tracing/vercelai/index.js.map +1 -1
  55. package/build/cjs/preload.js +2 -2
  56. package/build/cjs/preload.js.map +1 -1
  57. package/build/cjs/sdk/index.js +22 -203
  58. package/build/cjs/sdk/index.js.map +1 -1
  59. package/build/cjs/sdk/initOtel.js +4 -22
  60. package/build/cjs/sdk/initOtel.js.map +1 -1
  61. package/build/esm/index.js +2 -21
  62. package/build/esm/index.js.map +1 -1
  63. package/build/esm/integrations/fs.js +1 -1
  64. package/build/esm/integrations/fs.js.map +1 -1
  65. package/build/esm/integrations/http/index.js +1 -5
  66. package/build/esm/integrations/http/index.js.map +1 -1
  67. package/build/esm/integrations/node-fetch/index.js +2 -3
  68. package/build/esm/integrations/node-fetch/index.js.map +1 -1
  69. package/build/esm/integrations/tracing/amqplib.js +1 -2
  70. package/build/esm/integrations/tracing/amqplib.js.map +1 -1
  71. package/build/esm/integrations/tracing/connect.js +1 -2
  72. package/build/esm/integrations/tracing/connect.js.map +1 -1
  73. package/build/esm/integrations/tracing/dataloader.js +1 -1
  74. package/build/esm/integrations/tracing/dataloader.js.map +1 -1
  75. package/build/esm/integrations/tracing/express.js +2 -4
  76. package/build/esm/integrations/tracing/express.js.map +1 -1
  77. package/build/esm/integrations/tracing/fastify/fastify-otel/index.js +3 -3
  78. package/build/esm/integrations/tracing/fastify/fastify-otel/index.js.map +1 -1
  79. package/build/esm/integrations/tracing/fastify/index.js +5 -5
  80. package/build/esm/integrations/tracing/fastify/index.js.map +1 -1
  81. package/build/esm/integrations/tracing/genericPool.js +1 -1
  82. package/build/esm/integrations/tracing/genericPool.js.map +1 -1
  83. package/build/esm/integrations/tracing/graphql.js +2 -3
  84. package/build/esm/integrations/tracing/graphql.js.map +1 -1
  85. package/build/esm/integrations/tracing/hapi/index.js +1 -2
  86. package/build/esm/integrations/tracing/hapi/index.js.map +1 -1
  87. package/build/esm/integrations/tracing/kafka.js +1 -2
  88. package/build/esm/integrations/tracing/kafka.js.map +1 -1
  89. package/build/esm/integrations/tracing/knex.js +1 -1
  90. package/build/esm/integrations/tracing/knex.js.map +1 -1
  91. package/build/esm/integrations/tracing/koa.js +2 -4
  92. package/build/esm/integrations/tracing/koa.js.map +1 -1
  93. package/build/esm/integrations/tracing/lrumemoizer.js +1 -1
  94. package/build/esm/integrations/tracing/lrumemoizer.js.map +1 -1
  95. package/build/esm/integrations/tracing/mongo.js +1 -2
  96. package/build/esm/integrations/tracing/mongo.js.map +1 -1
  97. package/build/esm/integrations/tracing/mongoose.js +1 -2
  98. package/build/esm/integrations/tracing/mongoose.js.map +1 -1
  99. package/build/esm/integrations/tracing/mysql.js +1 -1
  100. package/build/esm/integrations/tracing/mysql.js.map +1 -1
  101. package/build/esm/integrations/tracing/mysql2.js +1 -2
  102. package/build/esm/integrations/tracing/mysql2.js.map +1 -1
  103. package/build/esm/integrations/tracing/postgres.js +1 -2
  104. package/build/esm/integrations/tracing/postgres.js.map +1 -1
  105. package/build/esm/integrations/tracing/postgresjs.js +2 -3
  106. package/build/esm/integrations/tracing/postgresjs.js.map +1 -1
  107. package/build/esm/integrations/tracing/prisma.js +1 -1
  108. package/build/esm/integrations/tracing/prisma.js.map +1 -1
  109. package/build/esm/integrations/tracing/redis.js +1 -1
  110. package/build/esm/integrations/tracing/redis.js.map +1 -1
  111. package/build/esm/integrations/tracing/tedious.js +1 -1
  112. package/build/esm/integrations/tracing/tedious.js.map +1 -1
  113. package/build/esm/integrations/tracing/vercelai/index.js +1 -1
  114. package/build/esm/integrations/tracing/vercelai/index.js.map +1 -1
  115. package/build/esm/package.json +1 -1
  116. package/build/esm/preload.js +1 -1
  117. package/build/esm/preload.js.map +1 -1
  118. package/build/esm/sdk/index.js +22 -202
  119. package/build/esm/sdk/index.js.map +1 -1
  120. package/build/esm/sdk/initOtel.js +3 -21
  121. package/build/esm/sdk/initOtel.js.map +1 -1
  122. package/build/types/index.d.ts +2 -21
  123. package/build/types/index.d.ts.map +1 -1
  124. package/build/types/integrations/http/index.d.ts +1 -1
  125. package/build/types/integrations/http/index.d.ts.map +1 -1
  126. package/build/types/integrations/node-fetch/index.d.ts.map +1 -1
  127. package/build/types/integrations/tracing/amqplib.d.ts.map +1 -1
  128. package/build/types/integrations/tracing/connect.d.ts.map +1 -1
  129. package/build/types/integrations/tracing/express.d.ts.map +1 -1
  130. package/build/types/integrations/tracing/graphql.d.ts.map +1 -1
  131. package/build/types/integrations/tracing/hapi/index.d.ts.map +1 -1
  132. package/build/types/integrations/tracing/kafka.d.ts.map +1 -1
  133. package/build/types/integrations/tracing/koa.d.ts.map +1 -1
  134. package/build/types/integrations/tracing/mongo.d.ts.map +1 -1
  135. package/build/types/integrations/tracing/mongoose.d.ts.map +1 -1
  136. package/build/types/integrations/tracing/mysql2.d.ts.map +1 -1
  137. package/build/types/integrations/tracing/postgres.d.ts.map +1 -1
  138. package/build/types/integrations/tracing/postgresjs.d.ts.map +1 -1
  139. package/build/types/integrations/tracing/vercelai/index.d.ts.map +1 -1
  140. package/build/types/sdk/index.d.ts +2 -6
  141. package/build/types/sdk/index.d.ts.map +1 -1
  142. package/build/types/sdk/initOtel.d.ts +1 -1
  143. package/build/types/sdk/initOtel.d.ts.map +1 -1
  144. package/build/types/types.d.ts +1 -1
  145. package/build/types/types.d.ts.map +1 -1
  146. package/build/types-ts3.8/index.d.ts +2 -21
  147. package/build/types-ts3.8/integrations/http/index.d.ts +1 -1
  148. package/build/types-ts3.8/sdk/index.d.ts +2 -6
  149. package/build/types-ts3.8/sdk/initOtel.d.ts +1 -1
  150. package/build/types-ts3.8/types.d.ts +1 -1
  151. package/package.json +4 -3
  152. package/build/cjs/cron/common.js +0 -56
  153. package/build/cjs/cron/common.js.map +0 -1
  154. package/build/cjs/cron/cron.js +0 -112
  155. package/build/cjs/cron/cron.js.map +0 -1
  156. package/build/cjs/cron/index.js +0 -15
  157. package/build/cjs/cron/index.js.map +0 -1
  158. package/build/cjs/cron/node-cron.js +0 -71
  159. package/build/cjs/cron/node-cron.js.map +0 -1
  160. package/build/cjs/cron/node-schedule.js +0 -65
  161. package/build/cjs/cron/node-schedule.js.map +0 -1
  162. package/build/cjs/integrations/anr/index.js +0 -238
  163. package/build/cjs/integrations/anr/index.js.map +0 -1
  164. package/build/cjs/integrations/childProcess.js +0 -100
  165. package/build/cjs/integrations/childProcess.js.map +0 -1
  166. package/build/cjs/integrations/context.js +0 -457
  167. package/build/cjs/integrations/context.js.map +0 -1
  168. package/build/cjs/integrations/contextlines.js +0 -405
  169. package/build/cjs/integrations/contextlines.js.map +0 -1
  170. package/build/cjs/integrations/http/SentryHttpInstrumentation.js +0 -558
  171. package/build/cjs/integrations/http/SentryHttpInstrumentation.js.map +0 -1
  172. package/build/cjs/integrations/local-variables/common.js +0 -69
  173. package/build/cjs/integrations/local-variables/common.js.map +0 -1
  174. package/build/cjs/integrations/local-variables/index.js +0 -12
  175. package/build/cjs/integrations/local-variables/index.js.map +0 -1
  176. package/build/cjs/integrations/local-variables/local-variables-async.js +0 -143
  177. package/build/cjs/integrations/local-variables/local-variables-async.js.map +0 -1
  178. package/build/cjs/integrations/local-variables/local-variables-sync.js +0 -410
  179. package/build/cjs/integrations/local-variables/local-variables-sync.js.map +0 -1
  180. package/build/cjs/integrations/modules.js +0 -135
  181. package/build/cjs/integrations/modules.js.map +0 -1
  182. package/build/cjs/integrations/node-fetch/SentryNodeFetchInstrumentation.js +0 -291
  183. package/build/cjs/integrations/node-fetch/SentryNodeFetchInstrumentation.js.map +0 -1
  184. package/build/cjs/integrations/onuncaughtexception.js +0 -134
  185. package/build/cjs/integrations/onuncaughtexception.js.map +0 -1
  186. package/build/cjs/integrations/onunhandledrejection.js +0 -89
  187. package/build/cjs/integrations/onunhandledrejection.js.map +0 -1
  188. package/build/cjs/integrations/processSession.js +0 -36
  189. package/build/cjs/integrations/processSession.js.map +0 -1
  190. package/build/cjs/integrations/spotlight.js +0 -101
  191. package/build/cjs/integrations/spotlight.js.map +0 -1
  192. package/build/cjs/integrations/winston.js +0 -151
  193. package/build/cjs/integrations/winston.js.map +0 -1
  194. package/build/cjs/logs/capture.js +0 -29
  195. package/build/cjs/logs/capture.js.map +0 -1
  196. package/build/cjs/logs/exports.js +0 -178
  197. package/build/cjs/logs/exports.js.map +0 -1
  198. package/build/cjs/nodeVersion.js +0 -12
  199. package/build/cjs/nodeVersion.js.map +0 -1
  200. package/build/cjs/otel/contextManager.js +0 -16
  201. package/build/cjs/otel/contextManager.js.map +0 -1
  202. package/build/cjs/otel/instrument.js +0 -139
  203. package/build/cjs/otel/instrument.js.map +0 -1
  204. package/build/cjs/proxy/base.js +0 -122
  205. package/build/cjs/proxy/base.js.map +0 -1
  206. package/build/cjs/proxy/index.js +0 -173
  207. package/build/cjs/proxy/index.js.map +0 -1
  208. package/build/cjs/proxy/parse-proxy-response.js +0 -104
  209. package/build/cjs/proxy/parse-proxy-response.js.map +0 -1
  210. package/build/cjs/sdk/api.js +0 -117
  211. package/build/cjs/sdk/api.js.map +0 -1
  212. package/build/cjs/sdk/client.js +0 -156
  213. package/build/cjs/sdk/client.js.map +0 -1
  214. package/build/cjs/transports/http.js +0 -158
  215. package/build/cjs/transports/http.js.map +0 -1
  216. package/build/cjs/utils/addOriginToSpan.js +0 -11
  217. package/build/cjs/utils/addOriginToSpan.js.map +0 -1
  218. package/build/cjs/utils/baggage.js +0 -36
  219. package/build/cjs/utils/baggage.js.map +0 -1
  220. package/build/cjs/utils/commonjs.js +0 -13
  221. package/build/cjs/utils/commonjs.js.map +0 -1
  222. package/build/cjs/utils/createMissingInstrumentationContext.js +0 -11
  223. package/build/cjs/utils/createMissingInstrumentationContext.js.map +0 -1
  224. package/build/cjs/utils/debug.js +0 -23
  225. package/build/cjs/utils/debug.js.map +0 -1
  226. package/build/cjs/utils/ensureIsWrapped.js +0 -41
  227. package/build/cjs/utils/ensureIsWrapped.js.map +0 -1
  228. package/build/cjs/utils/envToBool.js +0 -32
  229. package/build/cjs/utils/envToBool.js.map +0 -1
  230. package/build/cjs/utils/errorhandling.js +0 -42
  231. package/build/cjs/utils/errorhandling.js.map +0 -1
  232. package/build/cjs/utils/getRequestUrl.js +0 -18
  233. package/build/cjs/utils/getRequestUrl.js.map +0 -1
  234. package/build/cjs/utils/module.js +0 -60
  235. package/build/cjs/utils/module.js.map +0 -1
  236. package/build/esm/cron/common.js +0 -54
  237. package/build/esm/cron/common.js.map +0 -1
  238. package/build/esm/cron/cron.js +0 -110
  239. package/build/esm/cron/cron.js.map +0 -1
  240. package/build/esm/cron/index.js +0 -13
  241. package/build/esm/cron/index.js.map +0 -1
  242. package/build/esm/cron/node-cron.js +0 -69
  243. package/build/esm/cron/node-cron.js.map +0 -1
  244. package/build/esm/cron/node-schedule.js +0 -63
  245. package/build/esm/cron/node-schedule.js.map +0 -1
  246. package/build/esm/integrations/anr/index.js +0 -234
  247. package/build/esm/integrations/anr/index.js.map +0 -1
  248. package/build/esm/integrations/anr/worker-script.js +0 -2
  249. package/build/esm/integrations/childProcess.js +0 -98
  250. package/build/esm/integrations/childProcess.js.map +0 -1
  251. package/build/esm/integrations/context.js +0 -451
  252. package/build/esm/integrations/context.js.map +0 -1
  253. package/build/esm/integrations/contextlines.js +0 -399
  254. package/build/esm/integrations/contextlines.js.map +0 -1
  255. package/build/esm/integrations/http/SentryHttpInstrumentation.js +0 -555
  256. package/build/esm/integrations/http/SentryHttpInstrumentation.js.map +0 -1
  257. package/build/esm/integrations/local-variables/common.js +0 -64
  258. package/build/esm/integrations/local-variables/common.js.map +0 -1
  259. package/build/esm/integrations/local-variables/index.js +0 -10
  260. package/build/esm/integrations/local-variables/index.js.map +0 -1
  261. package/build/esm/integrations/local-variables/local-variables-async.js +0 -140
  262. package/build/esm/integrations/local-variables/local-variables-async.js.map +0 -1
  263. package/build/esm/integrations/local-variables/local-variables-sync.js +0 -405
  264. package/build/esm/integrations/local-variables/local-variables-sync.js.map +0 -1
  265. package/build/esm/integrations/local-variables/worker-script.js +0 -2
  266. package/build/esm/integrations/modules.js +0 -133
  267. package/build/esm/integrations/modules.js.map +0 -1
  268. package/build/esm/integrations/node-fetch/SentryNodeFetchInstrumentation.js +0 -289
  269. package/build/esm/integrations/node-fetch/SentryNodeFetchInstrumentation.js.map +0 -1
  270. package/build/esm/integrations/onuncaughtexception.js +0 -131
  271. package/build/esm/integrations/onuncaughtexception.js.map +0 -1
  272. package/build/esm/integrations/onunhandledrejection.js +0 -86
  273. package/build/esm/integrations/onunhandledrejection.js.map +0 -1
  274. package/build/esm/integrations/processSession.js +0 -34
  275. package/build/esm/integrations/processSession.js.map +0 -1
  276. package/build/esm/integrations/spotlight.js +0 -98
  277. package/build/esm/integrations/spotlight.js.map +0 -1
  278. package/build/esm/integrations/winston.js +0 -149
  279. package/build/esm/integrations/winston.js.map +0 -1
  280. package/build/esm/logs/capture.js +0 -27
  281. package/build/esm/logs/capture.js.map +0 -1
  282. package/build/esm/logs/exports.js +0 -170
  283. package/build/esm/logs/exports.js.map +0 -1
  284. package/build/esm/nodeVersion.js +0 -8
  285. package/build/esm/nodeVersion.js.map +0 -1
  286. package/build/esm/otel/contextManager.js +0 -14
  287. package/build/esm/otel/contextManager.js.map +0 -1
  288. package/build/esm/otel/instrument.js +0 -135
  289. package/build/esm/otel/instrument.js.map +0 -1
  290. package/build/esm/proxy/base.js +0 -120
  291. package/build/esm/proxy/base.js.map +0 -1
  292. package/build/esm/proxy/index.js +0 -171
  293. package/build/esm/proxy/index.js.map +0 -1
  294. package/build/esm/proxy/parse-proxy-response.js +0 -102
  295. package/build/esm/proxy/parse-proxy-response.js.map +0 -1
  296. package/build/esm/sdk/api.js +0 -114
  297. package/build/esm/sdk/api.js.map +0 -1
  298. package/build/esm/sdk/client.js +0 -154
  299. package/build/esm/sdk/client.js.map +0 -1
  300. package/build/esm/transports/http.js +0 -156
  301. package/build/esm/transports/http.js.map +0 -1
  302. package/build/esm/utils/addOriginToSpan.js +0 -9
  303. package/build/esm/utils/addOriginToSpan.js.map +0 -1
  304. package/build/esm/utils/baggage.js +0 -34
  305. package/build/esm/utils/baggage.js.map +0 -1
  306. package/build/esm/utils/commonjs.js +0 -11
  307. package/build/esm/utils/commonjs.js.map +0 -1
  308. package/build/esm/utils/createMissingInstrumentationContext.js +0 -9
  309. package/build/esm/utils/createMissingInstrumentationContext.js.map +0 -1
  310. package/build/esm/utils/debug.js +0 -21
  311. package/build/esm/utils/debug.js.map +0 -1
  312. package/build/esm/utils/ensureIsWrapped.js +0 -39
  313. package/build/esm/utils/ensureIsWrapped.js.map +0 -1
  314. package/build/esm/utils/envToBool.js +0 -28
  315. package/build/esm/utils/envToBool.js.map +0 -1
  316. package/build/esm/utils/errorhandling.js +0 -40
  317. package/build/esm/utils/errorhandling.js.map +0 -1
  318. package/build/esm/utils/getRequestUrl.js +0 -16
  319. package/build/esm/utils/getRequestUrl.js.map +0 -1
  320. package/build/esm/utils/module.js +0 -58
  321. package/build/esm/utils/module.js.map +0 -1
  322. package/build/types/cron/common.d.ts +0 -5
  323. package/build/types/cron/common.d.ts.map +0 -1
  324. package/build/types/cron/cron.d.ts +0 -43
  325. package/build/types/cron/cron.d.ts.map +0 -1
  326. package/build/types/cron/index.d.ts +0 -10
  327. package/build/types/cron/index.d.ts.map +0 -1
  328. package/build/types/cron/node-cron.d.ts +0 -27
  329. package/build/types/cron/node-cron.d.ts.map +0 -1
  330. package/build/types/cron/node-schedule.d.ts +0 -19
  331. package/build/types/cron/node-schedule.d.ts.map +0 -1
  332. package/build/types/integrations/anr/common.d.ts +0 -52
  333. package/build/types/integrations/anr/common.d.ts.map +0 -1
  334. package/build/types/integrations/anr/index.d.ts +0 -13
  335. package/build/types/integrations/anr/index.d.ts.map +0 -1
  336. package/build/types/integrations/anr/worker.d.ts +0 -2
  337. package/build/types/integrations/anr/worker.d.ts.map +0 -1
  338. package/build/types/integrations/childProcess.d.ts +0 -20
  339. package/build/types/integrations/childProcess.d.ts.map +0 -1
  340. package/build/types/integrations/context.d.ts +0 -30
  341. package/build/types/integrations/context.d.ts.map +0 -1
  342. package/build/types/integrations/contextlines.d.ts +0 -31
  343. package/build/types/integrations/contextlines.d.ts.map +0 -1
  344. package/build/types/integrations/http/SentryHttpInstrumentation.d.ts +0 -131
  345. package/build/types/integrations/http/SentryHttpInstrumentation.d.ts.map +0 -1
  346. package/build/types/integrations/local-variables/common.d.ts +0 -66
  347. package/build/types/integrations/local-variables/common.d.ts.map +0 -1
  348. package/build/types/integrations/local-variables/index.d.ts +0 -4
  349. package/build/types/integrations/local-variables/index.d.ts.map +0 -1
  350. package/build/types/integrations/local-variables/local-variables-async.d.ts +0 -7
  351. package/build/types/integrations/local-variables/local-variables-async.d.ts.map +0 -1
  352. package/build/types/integrations/local-variables/local-variables-sync.d.ts +0 -34
  353. package/build/types/integrations/local-variables/local-variables-sync.d.ts.map +0 -1
  354. package/build/types/integrations/local-variables/worker.d.ts +0 -2
  355. package/build/types/integrations/local-variables/worker.d.ts.map +0 -1
  356. package/build/types/integrations/modules.d.ts +0 -17
  357. package/build/types/integrations/modules.d.ts.map +0 -1
  358. package/build/types/integrations/node-fetch/SentryNodeFetchInstrumentation.d.ts +0 -56
  359. package/build/types/integrations/node-fetch/SentryNodeFetchInstrumentation.d.ts.map +0 -1
  360. package/build/types/integrations/onuncaughtexception.d.ts +0 -31
  361. package/build/types/integrations/onuncaughtexception.d.ts.map +0 -1
  362. package/build/types/integrations/onunhandledrejection.d.ts +0 -23
  363. package/build/types/integrations/onunhandledrejection.d.ts.map +0 -1
  364. package/build/types/integrations/processSession.d.ts +0 -5
  365. package/build/types/integrations/processSession.d.ts.map +0 -1
  366. package/build/types/integrations/spotlight.d.ts +0 -18
  367. package/build/types/integrations/spotlight.d.ts.map +0 -1
  368. package/build/types/integrations/winston.d.ts +0 -44
  369. package/build/types/integrations/winston.d.ts.map +0 -1
  370. package/build/types/logs/capture.d.ts +0 -11
  371. package/build/types/logs/capture.d.ts.map +0 -1
  372. package/build/types/logs/exports.d.ts +0 -150
  373. package/build/types/logs/exports.d.ts.map +0 -1
  374. package/build/types/nodeVersion.d.ts +0 -8
  375. package/build/types/nodeVersion.d.ts.map +0 -1
  376. package/build/types/otel/contextManager.d.ts +0 -10
  377. package/build/types/otel/contextManager.d.ts.map +0 -1
  378. package/build/types/otel/instrument.d.ts +0 -23
  379. package/build/types/otel/instrument.d.ts.map +0 -1
  380. package/build/types/proxy/base.d.ts +0 -65
  381. package/build/types/proxy/base.d.ts.map +0 -1
  382. package/build/types/proxy/helpers.d.ts +0 -42
  383. package/build/types/proxy/helpers.d.ts.map +0 -1
  384. package/build/types/proxy/index.d.ts +0 -73
  385. package/build/types/proxy/index.d.ts.map +0 -1
  386. package/build/types/proxy/parse-proxy-response.d.ts +0 -43
  387. package/build/types/proxy/parse-proxy-response.d.ts.map +0 -1
  388. package/build/types/sdk/api.d.ts +0 -8
  389. package/build/types/sdk/api.d.ts.map +0 -1
  390. package/build/types/sdk/client.d.ts +0 -29
  391. package/build/types/sdk/client.d.ts.map +0 -1
  392. package/build/types/sdk/scope.d.ts +0 -7
  393. package/build/types/sdk/scope.d.ts.map +0 -1
  394. package/build/types/transports/http-module.d.ts +0 -31
  395. package/build/types/transports/http-module.d.ts.map +0 -1
  396. package/build/types/transports/http.d.ts +0 -21
  397. package/build/types/transports/http.d.ts.map +0 -1
  398. package/build/types/transports/index.d.ts +0 -3
  399. package/build/types/transports/index.d.ts.map +0 -1
  400. package/build/types/utils/addOriginToSpan.d.ts +0 -5
  401. package/build/types/utils/addOriginToSpan.d.ts.map +0 -1
  402. package/build/types/utils/baggage.d.ts +0 -6
  403. package/build/types/utils/baggage.d.ts.map +0 -1
  404. package/build/types/utils/commonjs.d.ts +0 -3
  405. package/build/types/utils/commonjs.d.ts.map +0 -1
  406. package/build/types/utils/createMissingInstrumentationContext.d.ts +0 -3
  407. package/build/types/utils/createMissingInstrumentationContext.d.ts.map +0 -1
  408. package/build/types/utils/debug.d.ts +0 -5
  409. package/build/types/utils/debug.d.ts.map +0 -1
  410. package/build/types/utils/ensureIsWrapped.d.ts +0 -5
  411. package/build/types/utils/ensureIsWrapped.d.ts.map +0 -1
  412. package/build/types/utils/entry-point.d.ts +0 -24
  413. package/build/types/utils/entry-point.d.ts.map +0 -1
  414. package/build/types/utils/envToBool.d.ts +0 -13
  415. package/build/types/utils/envToBool.d.ts.map +0 -1
  416. package/build/types/utils/errorhandling.d.ts +0 -5
  417. package/build/types/utils/errorhandling.d.ts.map +0 -1
  418. package/build/types/utils/getRequestUrl.d.ts +0 -5
  419. package/build/types/utils/getRequestUrl.d.ts.map +0 -1
  420. package/build/types/utils/module.d.ts +0 -3
  421. package/build/types/utils/module.d.ts.map +0 -1
  422. package/build/types/utils/prepareEvent.d.ts +0 -17
  423. package/build/types/utils/prepareEvent.d.ts.map +0 -1
  424. package/build/types-ts3.8/cron/common.d.ts +0 -5
  425. package/build/types-ts3.8/cron/cron.d.ts +0 -43
  426. package/build/types-ts3.8/cron/index.d.ts +0 -10
  427. package/build/types-ts3.8/cron/node-cron.d.ts +0 -27
  428. package/build/types-ts3.8/cron/node-schedule.d.ts +0 -19
  429. package/build/types-ts3.8/integrations/anr/common.d.ts +0 -52
  430. package/build/types-ts3.8/integrations/anr/index.d.ts +0 -13
  431. package/build/types-ts3.8/integrations/anr/worker.d.ts +0 -2
  432. package/build/types-ts3.8/integrations/childProcess.d.ts +0 -20
  433. package/build/types-ts3.8/integrations/context.d.ts +0 -30
  434. package/build/types-ts3.8/integrations/contextlines.d.ts +0 -31
  435. package/build/types-ts3.8/integrations/http/SentryHttpInstrumentation.d.ts +0 -133
  436. package/build/types-ts3.8/integrations/local-variables/common.d.ts +0 -66
  437. package/build/types-ts3.8/integrations/local-variables/index.d.ts +0 -4
  438. package/build/types-ts3.8/integrations/local-variables/local-variables-async.d.ts +0 -7
  439. package/build/types-ts3.8/integrations/local-variables/local-variables-sync.d.ts +0 -34
  440. package/build/types-ts3.8/integrations/local-variables/worker.d.ts +0 -2
  441. package/build/types-ts3.8/integrations/modules.d.ts +0 -17
  442. package/build/types-ts3.8/integrations/node-fetch/SentryNodeFetchInstrumentation.d.ts +0 -56
  443. package/build/types-ts3.8/integrations/onuncaughtexception.d.ts +0 -31
  444. package/build/types-ts3.8/integrations/onunhandledrejection.d.ts +0 -23
  445. package/build/types-ts3.8/integrations/processSession.d.ts +0 -5
  446. package/build/types-ts3.8/integrations/spotlight.d.ts +0 -18
  447. package/build/types-ts3.8/integrations/winston.d.ts +0 -44
  448. package/build/types-ts3.8/logs/capture.d.ts +0 -18
  449. package/build/types-ts3.8/logs/exports.d.ts +0 -150
  450. package/build/types-ts3.8/nodeVersion.d.ts +0 -8
  451. package/build/types-ts3.8/otel/contextManager.d.ts +0 -10
  452. package/build/types-ts3.8/otel/instrument.d.ts +0 -23
  453. package/build/types-ts3.8/proxy/base.d.ts +0 -60
  454. package/build/types-ts3.8/proxy/helpers.d.ts +0 -38
  455. package/build/types-ts3.8/proxy/index.d.ts +0 -74
  456. package/build/types-ts3.8/proxy/parse-proxy-response.d.ts +0 -40
  457. package/build/types-ts3.8/sdk/api.d.ts +0 -8
  458. package/build/types-ts3.8/sdk/client.d.ts +0 -32
  459. package/build/types-ts3.8/sdk/scope.d.ts +0 -7
  460. package/build/types-ts3.8/transports/http-module.d.ts +0 -28
  461. package/build/types-ts3.8/transports/http.d.ts +0 -20
  462. package/build/types-ts3.8/transports/index.d.ts +0 -3
  463. package/build/types-ts3.8/utils/addOriginToSpan.d.ts +0 -5
  464. package/build/types-ts3.8/utils/baggage.d.ts +0 -6
  465. package/build/types-ts3.8/utils/commonjs.d.ts +0 -3
  466. package/build/types-ts3.8/utils/createMissingInstrumentationContext.d.ts +0 -3
  467. package/build/types-ts3.8/utils/debug.d.ts +0 -5
  468. package/build/types-ts3.8/utils/ensureIsWrapped.d.ts +0 -5
  469. package/build/types-ts3.8/utils/entry-point.d.ts +0 -24
  470. package/build/types-ts3.8/utils/envToBool.d.ts +0 -13
  471. package/build/types-ts3.8/utils/errorhandling.d.ts +0 -5
  472. package/build/types-ts3.8/utils/getRequestUrl.d.ts +0 -5
  473. package/build/types-ts3.8/utils/module.d.ts +0 -3
  474. package/build/types-ts3.8/utils/prepareEvent.d.ts +0 -17
@@ -1 +1 @@
1
- {"version":3,"file":"redis.js","sources":["../../../../src/integrations/tracing/redis.ts"],"sourcesContent":["import type { Span } from '@opentelemetry/api';\nimport type { RedisResponseCustomAttributeFunction } from '@opentelemetry/instrumentation-ioredis';\nimport { IORedisInstrumentation } from '@opentelemetry/instrumentation-ioredis';\nimport { RedisInstrumentation } from '@opentelemetry/instrumentation-redis-4';\nimport type { IntegrationFn } from '@sentry/core';\nimport {\n defineIntegration,\n SEMANTIC_ATTRIBUTE_CACHE_HIT,\n SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE,\n SEMANTIC_ATTRIBUTE_CACHE_KEY,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n spanToJSON,\n truncate,\n} from '@sentry/core';\nimport { generateInstrumentOnce } from '../../otel/instrument';\nimport {\n calculateCacheItemSize,\n GET_COMMANDS,\n getCacheKeySafely,\n getCacheOperation,\n isInCommands,\n shouldConsiderForCache,\n} from '../../utils/redisCache';\n\ninterface RedisOptions {\n cachePrefixes?: string[];\n}\n\nconst INTEGRATION_NAME = 'Redis';\n\nlet _redisOptions: RedisOptions = {};\n\nconst cacheResponseHook: RedisResponseCustomAttributeFunction = (span: Span, redisCommand, cmdArgs, response) => {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, 'auto.db.otel.redis');\n\n const safeKey = getCacheKeySafely(redisCommand, cmdArgs);\n const cacheOperation = getCacheOperation(redisCommand);\n\n if (\n !safeKey ||\n !cacheOperation ||\n !_redisOptions.cachePrefixes ||\n !shouldConsiderForCache(redisCommand, safeKey, _redisOptions.cachePrefixes)\n ) {\n // not relevant for cache\n return;\n }\n\n // otel/ioredis seems to be using the old standard, as there was a change to those params: https://github.com/open-telemetry/opentelemetry-specification/issues/3199\n // We are using params based on the docs: https://opentelemetry.io/docs/specs/semconv/attributes-registry/network/\n const networkPeerAddress = spanToJSON(span).data['net.peer.name'];\n const networkPeerPort = spanToJSON(span).data['net.peer.port'];\n if (networkPeerPort && networkPeerAddress) {\n span.setAttributes({ 'network.peer.address': networkPeerAddress, 'network.peer.port': networkPeerPort });\n }\n\n const cacheItemSize = calculateCacheItemSize(response);\n\n if (cacheItemSize) {\n span.setAttribute(SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE, cacheItemSize);\n }\n\n if (isInCommands(GET_COMMANDS, redisCommand) && cacheItemSize !== undefined) {\n span.setAttribute(SEMANTIC_ATTRIBUTE_CACHE_HIT, cacheItemSize > 0);\n }\n\n span.setAttributes({\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: cacheOperation,\n [SEMANTIC_ATTRIBUTE_CACHE_KEY]: safeKey,\n });\n\n const spanDescription = safeKey.join(', ');\n\n span.updateName(truncate(spanDescription, 1024));\n};\n\nconst instrumentIORedis = generateInstrumentOnce('IORedis', () => {\n return new IORedisInstrumentation({\n responseHook: cacheResponseHook,\n });\n});\n\nconst instrumentRedis4 = generateInstrumentOnce('Redis-4', () => {\n return new RedisInstrumentation({\n responseHook: cacheResponseHook,\n });\n});\n\n/** To be able to preload all Redis OTel instrumentations with just one ID (\"Redis\"), all the instrumentations are generated in this one function */\nexport const instrumentRedis = Object.assign(\n (): void => {\n instrumentIORedis();\n instrumentRedis4();\n\n // todo: implement them gradually\n // new LegacyRedisInstrumentation({}),\n },\n { id: INTEGRATION_NAME },\n);\n\nconst _redisIntegration = ((options: RedisOptions = {}) => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n _redisOptions = options;\n instrumentRedis();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [redis](https://www.npmjs.com/package/redis) and\n * [ioredis](https://www.npmjs.com/package/ioredis) libraries.\n *\n * For more information, see the [`redisIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/redis/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.redisIntegration()],\n * });\n * ```\n */\nexport const redisIntegration = defineIntegration(_redisIntegration);\n"],"names":["SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","getCacheKeySafely","getCacheOperation","shouldConsiderForCache","spanToJSON","calculateCacheItemSize","SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE","isInCommands","GET_COMMANDS","SEMANTIC_ATTRIBUTE_CACHE_HIT","SEMANTIC_ATTRIBUTE_SENTRY_OP","SEMANTIC_ATTRIBUTE_CACHE_K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C,iBAAiB;;;;;"}
1
+ {"version":3,"file":"redis.js","sources":["../../../../src/integrations/tracing/redis.ts"],"sourcesContent":["import type { Span } from '@opentelemetry/api';\nimport type { RedisResponseCustomAttributeFunction } from '@opentelemetry/instrumentation-ioredis';\nimport { IORedisInstrumentation } from '@opentelemetry/instrumentation-ioredis';\nimport { RedisInstrumentation } from '@opentelemetry/instrumentation-redis-4';\nimport type { IntegrationFn } from '@sentry/core';\nimport {\n defineIntegration,\n SEMANTIC_ATTRIBUTE_CACHE_HIT,\n SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE,\n SEMANTIC_ATTRIBUTE_CACHE_KEY,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n spanToJSON,\n truncate,\n} from '@sentry/core';\nimport { generateInstrumentOnce } from '@sentry/node-core';\nimport {\n calculateCacheItemSize,\n GET_COMMANDS,\n getCacheKeySafely,\n getCacheOperation,\n isInCommands,\n shouldConsiderForCache,\n} from '../../utils/redisCache';\n\ninterface RedisOptions {\n cachePrefixes?: string[];\n}\n\nconst INTEGRATION_NAME = 'Redis';\n\nlet _redisOptions: RedisOptions = {};\n\nconst cacheResponseHook: RedisResponseCustomAttributeFunction = (span: Span, redisCommand, cmdArgs, response) => {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, 'auto.db.otel.redis');\n\n const safeKey = getCacheKeySafely(redisCommand, cmdArgs);\n const cacheOperation = getCacheOperation(redisCommand);\n\n if (\n !safeKey ||\n !cacheOperation ||\n !_redisOptions.cachePrefixes ||\n !shouldConsiderForCache(redisCommand, safeKey, _redisOptions.cachePrefixes)\n ) {\n // not relevant for cache\n return;\n }\n\n // otel/ioredis seems to be using the old standard, as there was a change to those params: https://github.com/open-telemetry/opentelemetry-specification/issues/3199\n // We are using params based on the docs: https://opentelemetry.io/docs/specs/semconv/attributes-registry/network/\n const networkPeerAddress = spanToJSON(span).data['net.peer.name'];\n const networkPeerPort = spanToJSON(span).data['net.peer.port'];\n if (networkPeerPort && networkPeerAddress) {\n span.setAttributes({ 'network.peer.address': networkPeerAddress, 'network.peer.port': networkPeerPort });\n }\n\n const cacheItemSize = calculateCacheItemSize(response);\n\n if (cacheItemSize) {\n span.setAttribute(SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE, cacheItemSize);\n }\n\n if (isInCommands(GET_COMMANDS, redisCommand) && cacheItemSize !== undefined) {\n span.setAttribute(SEMANTIC_ATTRIBUTE_CACHE_HIT, cacheItemSize > 0);\n }\n\n span.setAttributes({\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: cacheOperation,\n [SEMANTIC_ATTRIBUTE_CACHE_KEY]: safeKey,\n });\n\n const spanDescription = safeKey.join(', ');\n\n span.updateName(truncate(spanDescription, 1024));\n};\n\nconst instrumentIORedis = generateInstrumentOnce('IORedis', () => {\n return new IORedisInstrumentation({\n responseHook: cacheResponseHook,\n });\n});\n\nconst instrumentRedis4 = generateInstrumentOnce('Redis-4', () => {\n return new RedisInstrumentation({\n responseHook: cacheResponseHook,\n });\n});\n\n/** To be able to preload all Redis OTel instrumentations with just one ID (\"Redis\"), all the instrumentations are generated in this one function */\nexport const instrumentRedis = Object.assign(\n (): void => {\n instrumentIORedis();\n instrumentRedis4();\n\n // todo: implement them gradually\n // new LegacyRedisInstrumentation({}),\n },\n { id: INTEGRATION_NAME },\n);\n\nconst _redisIntegration = ((options: RedisOptions = {}) => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n _redisOptions = options;\n instrumentRedis();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [redis](https://www.npmjs.com/package/redis) and\n * [ioredis](https://www.npmjs.com/package/ioredis) libraries.\n *\n * For more information, see the [`redisIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/redis/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.redisIntegration()],\n * });\n * ```\n */\nexport const redisIntegration = defineIntegration(_redisIntegration);\n"],"names":["SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","getCacheKeySafely","getCacheOperation","shouldConsiderForCache","spanToJSON","calculateCacheItemSize","SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE","isInCommands","GET_COMMANDS","SEMANTIC_ATTRIBUTE_CACHE_HIT","SEMANTIC_ATTRIBUTE_SENTRY_OP","SEMANTIC_ATTRIBUTE_CACHE_KEY","truncate","generateInstrumentOnce","IORedisInstrumentation","RedisInstrumentation","defineIntegration"],"mappings":";;;;;;;;AA6BA,MAAM,gBAAA,GAAmB,OAAO;;AAEhC,IAAI,aAAa,GAAiB,EAAE;;AAEpC,MAAM,iBAAiB,GAAyC,CAAC,IAAI,EAAQ,YAAY,EAAE,OAAO,EAAE,QAAQ,KAAK;AACjH,EAAE,IAAI,CAAC,YAAY,CAACA,qCAAgC,EAAE,oBAAoB,CAAC;;AAE3E,EAAE,MAAM,UAAUC,4BAAiB,CAAC,YAAY,EAAE,OAAO,CAAC;AAC1D,EAAE,MAAM,cAAe,GAAEC,4BAAiB,CAAC,YAAY,CAAC;;AAExD,EAAE;AACF,IAAI,CAAC,OAAQ;AACb,IAAI,CAAC,cAAe;AACpB,IAAI,CAAC,aAAa,CAAC,aAAc;AACjC,IAAI,CAACC,iCAAsB,CAAC,YAAY,EAAE,OAAO,EAAE,aAAa,CAAC,aAAa;AAC9E,IAAI;AACJ;AACA,IAAI;AACJ;;AAEA;AACA;AACA,EAAE,MAAM,kBAAmB,GAAEC,eAAU,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC;AACnE,EAAE,MAAM,eAAgB,GAAEA,eAAU,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC;AAChE,EAAE,IAAI,eAAgB,IAAG,kBAAkB,EAAE;AAC7C,IAAI,IAAI,CAAC,aAAa,CAAC,EAAE,sBAAsB,EAAE,kBAA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AqB,CAAC,OAAO,GAAiB,EAAE,KAAK;AAC3D,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,GAAG;AAChB,MAAM,aAAA,GAAgB,OAAO;AAC7B,MAAM,eAAe,EAAE;AACvB,KAAK;AACL,GAAG;AACH,CAAC,CAAE;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,gBAAiB,GAAEC,sBAAiB,CAAC,iBAAiB;;;;;"}
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
 
3
3
  const instrumentationTedious = require('@opentelemetry/instrumentation-tedious');
4
4
  const core = require('@sentry/core');
5
- const instrument = require('../../otel/instrument.js');
5
+ const nodeCore = require('@sentry/node-core');
6
6
 
7
7
  const TEDIUS_INSTRUMENTED_METHODS = new Set([
8
8
  'callProcedure',
@@ -15,7 +15,7 @@ const TEDIUS_INSTRUMENTED_METHODS = new Set([
15
15
 
16
16
  const INTEGRATION_NAME = 'Tedious';
17
17
 
18
- const instrumentTedious = instrument.generateInstrumentOnce(INTEGRATION_NAME, () => new instrumentationTedious.TediousInstrumentation({}));
18
+ const instrumentTedious = nodeCore.generateInstrumentOnce(INTEGRATION_NAME, () => new instrumentationTedious.TediousInstrumentation({}));
19
19
 
20
20
  const _tediousIntegration = (() => {
21
21
  let instrumentationWrappedCallback;
@@ -24,7 +24,7 @@ const _tediousIntegration = (() => {
24
24
  name: INTEGRATION_NAME,
25
25
  setupOnce() {
26
26
  const instrumentation = instrumentTedious();
27
- instrumentationWrappedCallback = instrument.instrumentWhenWrapped(instrumentation);
27
+ instrumentationWrappedCallback = nodeCore.instrumentWhenWrapped(instrumentation);
28
28
  },
29
29
 
30
30
  setup(client) {
@@ -1 +1 @@
1
- {"version":3,"file":"tedious.js","sources":["../../../../src/integrations/tracing/tedious.ts"],"sourcesContent":["import { TediousInstrumentation } from '@opentelemetry/instrumentation-tedious';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, spanToJSON } from '@sentry/core';\nimport { generateInstrumentOnce, instrumentWhenWrapped } from '../../otel/instrument';\n\nconst TEDIUS_INSTRUMENTED_METHODS = new Set([\n 'callProcedure',\n 'execSql',\n 'execSqlBatch',\n 'execBulkLoad',\n 'prepare',\n 'execute',\n]);\n\nconst INTEGRATION_NAME = 'Tedious';\n\nexport const instrumentTedious = generateInstrumentOnce(INTEGRATION_NAME, () => new TediousInstrumentation({}));\n\nconst _tediousIntegration = (() => {\n let instrumentationWrappedCallback: undefined | ((callback: () => void) => void);\n\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n const instrumentation = instrumentTedious();\n instrumentationWrappedCallback = instrumentWhenWrapped(instrumentation);\n },\n\n setup(client) {\n instrumentationWrappedCallback?.(() =>\n client.on('spanStart', span => {\n const { description, data } = spanToJSON(span);\n // Tedius integration always set a span name and `db.system` attribute to `mssql`.\n if (!description || data['db.system'] !== 'mssql') {\n return;\n }\n\n const operation = description.split(' ')[0] || '';\n if (TEDIUS_INSTRUMENTED_METHODS.has(operation)) {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, 'auto.db.otel.tedious');\n }\n }),\n );\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [tedious](https://www.npmjs.com/package/tedious) library.\n *\n * For more information, see the [`tediousIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/tedious/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.tediousIntegration()],\n * });\n * ```\n */\nexport const tediousIntegration = defineIntegration(_tediousIntegration);\n"],"names":["generateInstrumentOnce","TediousInstrumentation","instrumentWhenWrapped","spanToJSON","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","defineIntegration"],"mappings":";;;;;;AAKA,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CAAC,mBAAmB;;;;;"}
1
+ {"version":3,"file":"tedious.js","sources":["../../../../src/integrations/tracing/tedious.ts"],"sourcesContent":["import { TediousInstrumentation } from '@opentelemetry/instrumentation-tedious';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, spanToJSON } from '@sentry/core';\nimport { generateInstrumentOnce, instrumentWhenWrapped } from '@sentry/node-core';\n\nconst TEDIUS_INSTRUMENTED_METHODS = new Set([\n 'callProcedure',\n 'execSql',\n 'execSqlBatch',\n 'execBulkLoad',\n 'prepare',\n 'execute',\n]);\n\nconst INTEGRATION_NAME = 'Tedious';\n\nexport const instrumentTedious = generateInstrumentOnce(INTEGRATION_NAME, () => new TediousInstrumentation({}));\n\nconst _tediousIntegration = (() => {\n let instrumentationWrappedCallback: undefined | ((callback: () => void) => void);\n\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n const instrumentation = instrumentTedious();\n instrumentationWrappedCallback = instrumentWhenWrapped(instrumentation);\n },\n\n setup(client) {\n instrumentationWrappedCallback?.(() =>\n client.on('spanStart', span => {\n const { description, data } = spanToJSON(span);\n // Tedius integration always set a span name and `db.system` attribute to `mssql`.\n if (!description || data['db.system'] !== 'mssql') {\n return;\n }\n\n const operation = description.split(' ')[0] || '';\n if (TEDIUS_INSTRUMENTED_METHODS.has(operation)) {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, 'auto.db.otel.tedious');\n }\n }),\n );\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [tedious](https://www.npmjs.com/package/tedious) library.\n *\n * For more information, see the [`tediousIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/tedious/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.tediousIntegration()],\n * });\n * ```\n */\nexport const tediousIntegration = defineIntegration(_tediousIntegration);\n"],"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G;AACH,CAAC,CAAE;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,kBAAmB,GAAEC,sBAAiB,CAAC,mBAAmB;;;;;"}
@@ -1,11 +1,11 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
 
3
3
  const core = require('@sentry/core');
4
- const instrument = require('../../../otel/instrument.js');
4
+ const nodeCore = require('@sentry/node-core');
5
5
  const constants = require('./constants.js');
6
6
  const instrumentation = require('./instrumentation.js');
7
7
 
8
- const instrumentVercelAi = instrument.generateInstrumentOnce(constants.INTEGRATION_NAME, () => new instrumentation.SentryVercelAiInstrumentation({}));
8
+ const instrumentVercelAi = nodeCore.generateInstrumentOnce(constants.INTEGRATION_NAME, () => new instrumentation.SentryVercelAiInstrumentation({}));
9
9
 
10
10
  /**
11
11
  * Determines if the integration should be forced based on environment and package availability.
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/vercelai/index.ts"],"sourcesContent":["import type { Client, IntegrationFn } from '@sentry/core';\nimport { addVercelAiProcessors, defineIntegration } from '@sentry/core';\nimport { generateInstrumentOnce } from '../../../otel/instrument';\nimport type { modulesIntegration } from '../../modules';\nimport { INTEGRATION_NAME } from './constants';\nimport { SentryVercelAiInstrumentation } from './instrumentation';\nimport type { VercelAiOptions } from './types';\n\nexport const instrumentVercelAi = generateInstrumentOnce(INTEGRATION_NAME, () => new SentryVercelAiInstrumentation({}));\n\n/**\n * Determines if the integration should be forced based on environment and package availability.\n * Returns true if the 'ai' package is available.\n */\nfunction shouldForceIntegration(client: Client): boolean {\n const modules = client.getIntegrationByName<ReturnType<typeof modulesIntegration>>('Modules');\n return !!modules?.getModules?.()?.ai;\n}\n\nconst _vercelAIIntegration = ((options: VercelAiOptions = {}) => {\n let instrumentation: undefined | SentryVercelAiInstrumentation;\n\n return {\n name: INTEGRATION_NAME,\n options,\n setupOnce() {\n instrumentation = instrumentVercelAi();\n },\n afterAllSetup(client) {\n // Auto-detect if we should force the integration when running with 'ai' package available\n // Note that this can only be detected if the 'Modules' integration is available, and running in CJS mode\n const shouldForce = options.force ?? shouldForceIntegration(client);\n\n if (shouldForce) {\n addVercelAiProcessors(client);\n } else {\n instrumentation?.callWhenPatched(() => addVercelAiProcessors(client));\n }\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [ai](https://www.npmjs.com/package/ai) library.\n * This integration is not enabled by default, you need to manually add it.\n *\n * For more information, see the [`ai` documentation](https://sdk.vercel.ai/docs/ai-sdk-core/telemetry).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.vercelAIIntegration()],\n * });\n * ```\n *\n * This integration adds tracing support to all `ai` function calls.\n * You need to opt-in to collecting spans for a specific call,\n * you can do so by setting `experimental_telemetry.isEnabled` to `true` in the first argument of the function call.\n *\n * ```javascript\n * const result = await generateText({\n * model: openai('gpt-4-turbo'),\n * experimental_telemetry: { isEnabled: true },\n * });\n * ```\n *\n * If you want to collect inputs and outputs for a specific call, you must specifically opt-in to each\n * function call by setting `experimental_telemetry.recordInputs` and `experimental_telemetry.recordOutputs`\n * to `true`.\n *\n * ```javascript\n * const result = await generateText({\n * model: openai('gpt-4-turbo'),\n * experimental_telemetry: { isEnabled: true, recordInputs: true, recordOutputs: true },\n * });\n */\nexport const vercelAIIntegration = defineIntegration(_vercelAIIntegration);\n"],"names":["generateInstrumentOnce","INTEGRATION_NAME","SentryVercelAiInstrumentation","addVercelAiProcessors","defineIntegration"],"mappings":";;;;;;;MAQa,kBAAmB,GAAEA,iCAAsB,CAACC,0BAAgB,EAAE,MAAM,IAAIC,6CAA6B,CAAC,EAAE,CAAC;;AAEtH;AACA;AACA;AACA;AACA,SAAS,sBAAsB,CAAC,MAAM,EAAmB;AACzD,EAAE,MAAM,UAAU,MAAM,CAAC,oBAAoB,CAAwC,SAAS,CAAC;AAC/F,EAAE,OAAO,CAAC,CAAC,OAAO,EAAE,UAAU,IAAI,EAAE,EAAE;AACtC;;AAEA,MAAM,oBAAA,IAAwB,CAAC,OAAO,GAAoB,EAAE,KAAK;AACjE,EAAE,IAAI,eAAe;;AAErB,EAAE,OAAO;AACT,IAAI,IAAI,EAAED,0BAAgB;AAC1B,IAAI,OAAO;AACX,IAAI,SAAS,GAAG;AAChB,MAAM,eAAgB,GAAE,kBAAkB,EAAE;AAC5C,KAAK;AACL,IAAI,aAAa,CAAC,MAAM,EAAE;AAC1B;AACA;AACA,MAAM,MAAM,WAAY,GAAE,OAAO,CAAC,SAAS,sBAAsB,CAAC,MAAM,CAAC;;AAEzE,MAAM,IAAI,WAAW,EAAE;AACvB,QAAQE,0BAAqB,CAAC,MAAM,CAAC;AACrC,aAAa;AACb,QAAQ,eAAe,EAAE,eAAe,CAAC,MAAMA,0BAAqB,CAAC,MAAM,CAAC,CAAC;AAC7E;AACA,KAAK;AACL,GAAG;AACH,CAAC,CAAE;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,mBAAoB,GAAEC,sBAAiB,CAAC,oBAAoB;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/vercelai/index.ts"],"sourcesContent":["import type { Client, IntegrationFn } from '@sentry/core';\nimport { addVercelAiProcessors, defineIntegration } from '@sentry/core';\nimport { type modulesIntegration, generateInstrumentOnce } from '@sentry/node-core';\nimport { INTEGRATION_NAME } from './constants';\nimport { SentryVercelAiInstrumentation } from './instrumentation';\nimport type { VercelAiOptions } from './types';\n\nexport const instrumentVercelAi = generateInstrumentOnce(INTEGRATION_NAME, () => new SentryVercelAiInstrumentation({}));\n\n/**\n * Determines if the integration should be forced based on environment and package availability.\n * Returns true if the 'ai' package is available.\n */\nfunction shouldForceIntegration(client: Client): boolean {\n const modules = client.getIntegrationByName<ReturnType<typeof modulesIntegration>>('Modules');\n return !!modules?.getModules?.()?.ai;\n}\n\nconst _vercelAIIntegration = ((options: VercelAiOptions = {}) => {\n let instrumentation: undefined | SentryVercelAiInstrumentation;\n\n return {\n name: INTEGRATION_NAME,\n options,\n setupOnce() {\n instrumentation = instrumentVercelAi();\n },\n afterAllSetup(client) {\n // Auto-detect if we should force the integration when running with 'ai' package available\n // Note that this can only be detected if the 'Modules' integration is available, and running in CJS mode\n const shouldForce = options.force ?? shouldForceIntegration(client);\n\n if (shouldForce) {\n addVercelAiProcessors(client);\n } else {\n instrumentation?.callWhenPatched(() => addVercelAiProcessors(client));\n }\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [ai](https://www.npmjs.com/package/ai) library.\n * This integration is not enabled by default, you need to manually add it.\n *\n * For more information, see the [`ai` documentation](https://sdk.vercel.ai/docs/ai-sdk-core/telemetry).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.vercelAIIntegration()],\n * });\n * ```\n *\n * This integration adds tracing support to all `ai` function calls.\n * You need to opt-in to collecting spans for a specific call,\n * you can do so by setting `experimental_telemetry.isEnabled` to `true` in the first argument of the function call.\n *\n * ```javascript\n * const result = await generateText({\n * model: openai('gpt-4-turbo'),\n * experimental_telemetry: { isEnabled: true },\n * });\n * ```\n *\n * If you want to collect inputs and outputs for a specific call, you must specifically opt-in to each\n * function call by setting `experimental_telemetry.recordInputs` and `experimental_telemetry.recordOutputs`\n * to `true`.\n *\n * ```javascript\n * const result = await generateText({\n * model: openai('gpt-4-turbo'),\n * experimental_telemetry: { isEnabled: true, recordInputs: true, recordOutputs: true },\n * });\n */\nexport const vercelAIIntegration = defineIntegration(_vercelAIIntegration);\n"],"names":["generateInstrumentOnce","INTEGRATION_NAME","SentryVercelAiInstrumentation","addVercelAiProcessors","defineIntegration"],"mappings":";;;;;;;MAOa,kBAAmB,GAAEA,+BAAsB,CAACC,0BAAgB,EAAE,MAAM,IAAIC,6CAA6B,CAAC,EAAE,CAAC;;AAEtH;AACA;AACA;AACA;AACA,SAAS,sBAAsB,CAAC,MAAM,EAAmB;AACzD,EAAE,MAAM,UAAU,MAAM,CAAC,oBAAoB,CAAwC,SAAS,CAAC;AAC/F,EAAE,OAAO,CAAC,CAAC,OAAO,EAAE,UAAU,IAAI,EAAE,EAAE;AACtC;;AAEA,MAAM,oBAAA,IAAwB,CAAC,OAAO,GAAoB,EAAE,KAAK;AACjE,EAAE,IAAI,eAAe;;AAErB,EAAE,OAAO;AACT,IAAI,IAAI,EAAED,0BAAgB;AAC1B,IAAI,OAAO;AACX,IAAI,SAAS,GAAG;AAChB,MAAM,eAAgB,GAAE,kBAAkB,EAAE;AAC5C,KAAK;AACL,IAAI,aAAa,CAAC,MAAM,EAAE;AAC1B;AACA;AACA,MAAM,MAAM,WAAY,GAAE,OAAO,CAAC,SAAS,sBAAsB,CAAC,MAAM,CAAC;;AAEzE,MAAM,IAAI,WAAW,EAAE;AACvB,QAAQE,0BAAqB,CAAC,MAAM,CAAC;AACrC,aAAa;AACb,QAAQ,eAAe,EAAE,eAAe,CAAC,MAAMA,0BAAqB,CAAC,MAAM,CAAC,CAAC;AAC7E;AACA,KAAK;AACL,GAAG;AACH,CAAC,CAAE;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,mBAAoB,GAAEC,sBAAiB,CAAC,oBAAoB;;;;;"}
@@ -1,7 +1,7 @@
1
+ const nodeCore = require('@sentry/node-core');
1
2
  const initOtel = require('./sdk/initOtel.js');
2
- const envToBool = require('./utils/envToBool.js');
3
3
 
4
- const debug = envToBool.envToBool(process.env.SENTRY_DEBUG);
4
+ const debug = nodeCore.envToBool(process.env.SENTRY_DEBUG);
5
5
  const integrationsStr = process.env.SENTRY_PRELOAD_INTEGRATIONS;
6
6
 
7
7
  const integrations = integrationsStr ? integrationsStr.split(',').map(integration => integration.trim()) : undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"preload.js","sources":["../../src/preload.ts"],"sourcesContent":["import { preloadOpenTelemetry } from './sdk/initOtel';\nimport { envToBool } from './utils/envToBool';\n\nconst debug = envToBool(process.env.SENTRY_DEBUG);\nconst integrationsStr = process.env.SENTRY_PRELOAD_INTEGRATIONS;\n\nconst integrations = integrationsStr ? integrationsStr.split(',').map(integration => integration.trim()) : undefined;\n\n/**\n * The @sentry/node/preload export can be used with the node --import and --require args to preload the OTEL\n * instrumentation, without initializing the Sentry SDK.\n *\n * This is useful if you cannot initialize the SDK immediately, but still want to preload the instrumentation,\n * e.g. if you have to load the DSN from somewhere else.\n *\n * You can configure this in two ways via environment variables:\n * - `SENTRY_DEBUG` to enable debug logging\n * - `SENTRY_PRELOAD_INTEGRATIONS` to preload specific integrations - e.g. `SENTRY_PRELOAD_INTEGRATIONS=\"Http,Express\"`\n */\npreloadOpenTelemetry({ debug, integrations });\n"],"names":["envToBool","preloadOpenTelemetry"],"mappings":";;;AAGA,MAAM,KAAA,GAAQA,mBAAS,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;AACjD,MAAM,kBAAkB,OAAO,CAAC,GAAG,CAAC,2BAA2B;;AAE/D,MAAM,YAAA,GAAe,eAAgB,GAAE,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,WAAA,IAAe,WAAW,CAAC,IAAI,EAAE,CAAE,GAAE,SAAS;;AAEpH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACAC,6BAAoB,CAAC,EAAE,KAAK,EAAE,YAAA,EAAc,CAAC;;"}
1
+ {"version":3,"file":"preload.js","sources":["../../src/preload.ts"],"sourcesContent":["import { envToBool } from '@sentry/node-core';\nimport { preloadOpenTelemetry } from './sdk/initOtel';\n\nconst debug = envToBool(process.env.SENTRY_DEBUG);\nconst integrationsStr = process.env.SENTRY_PRELOAD_INTEGRATIONS;\n\nconst integrations = integrationsStr ? integrationsStr.split(',').map(integration => integration.trim()) : undefined;\n\n/**\n * The @sentry/node/preload export can be used with the node --import and --require args to preload the OTEL\n * instrumentation, without initializing the Sentry SDK.\n *\n * This is useful if you cannot initialize the SDK immediately, but still want to preload the instrumentation,\n * e.g. if you have to load the DSN from somewhere else.\n *\n * You can configure this in two ways via environment variables:\n * - `SENTRY_DEBUG` to enable debug logging\n * - `SENTRY_PRELOAD_INTEGRATIONS` to preload specific integrations - e.g. `SENTRY_PRELOAD_INTEGRATIONS=\"Http,Express\"`\n */\npreloadOpenTelemetry({ debug, integrations });\n"],"names":["envToBool","preloadOpenTelemetry"],"mappings":";;;AAGA,MAAM,KAAA,GAAQA,kBAAS,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;AACjD,MAAM,kBAAkB,OAAO,CAAC,GAAG,CAAC,2BAA2B;;AAE/D,MAAM,YAAA,GAAe,eAAgB,GAAE,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,WAAA,IAAe,WAAW,CAAC,IAAI,EAAE,CAAE,GAAE,SAAS;;AAEpH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACAC,6BAAoB,CAAC,EAAE,KAAK,EAAE,YAAA,EAAc,CAAC;;"}
@@ -1,54 +1,22 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
 
3
3
  const core = require('@sentry/core');
4
- const opentelemetry = require('@sentry/opentelemetry');
5
- const debugBuild = require('../debug-build.js');
6
- const childProcess = require('../integrations/childProcess.js');
7
- const context = require('../integrations/context.js');
8
- const contextlines = require('../integrations/contextlines.js');
4
+ const nodeCore = require('@sentry/node-core');
9
5
  const index$1 = require('../integrations/http/index.js');
10
- const index$3 = require('../integrations/local-variables/index.js');
11
- const modules = require('../integrations/modules.js');
12
6
  const index$2 = require('../integrations/node-fetch/index.js');
13
- const onuncaughtexception = require('../integrations/onuncaughtexception.js');
14
- const onunhandledrejection = require('../integrations/onunhandledrejection.js');
15
- const processSession = require('../integrations/processSession.js');
16
- const spotlight = require('../integrations/spotlight.js');
17
7
  const index = require('../integrations/tracing/index.js');
18
- const http = require('../transports/http.js');
19
- const commonjs = require('../utils/commonjs.js');
20
- const envToBool = require('../utils/envToBool.js');
21
- const api = require('./api.js');
22
- const client = require('./client.js');
23
8
  const initOtel = require('./initOtel.js');
24
9
 
25
10
  /**
26
11
  * Get default integrations, excluding performance.
27
12
  */
28
13
  function getDefaultIntegrationsWithoutPerformance() {
29
- return [
30
- // Common
31
- // TODO(v10): Replace with `eventFiltersIntegration` once we remove the deprecated `inboundFiltersIntegration`
32
- // eslint-disable-next-line deprecation/deprecation
33
- core.inboundFiltersIntegration(),
34
- core.functionToStringIntegration(),
35
- core.linkedErrorsIntegration(),
36
- core.requestDataIntegration(),
37
- // Native Wrappers
38
- core.consoleIntegration(),
39
- index$1.httpIntegration(),
40
- index$2.nativeNodeFetchIntegration(),
41
- // Global Handlers
42
- onuncaughtexception.onUncaughtExceptionIntegration(),
43
- onunhandledrejection.onUnhandledRejectionIntegration(),
44
- // Event Info
45
- contextlines.contextLinesIntegration(),
46
- index$3.localVariablesIntegration(),
47
- context.nodeContextIntegration(),
48
- childProcess.childProcessIntegration(),
49
- processSession.processSessionIntegration(),
50
- modules.modulesIntegration(),
51
- ];
14
+ const nodeCoreIntegrations = nodeCore.getDefaultIntegrations();
15
+
16
+ // Filter out the node-core HTTP and NodeFetch integrations and replace them with Node SDK's composite versions
17
+ return nodeCoreIntegrations
18
+ .filter(integration => integration.name !== 'Http' && integration.name !== 'NodeFetch')
19
+ .concat(index$1.httpIntegration(), index$2.nativeNodeFetchIntegration());
52
20
  }
53
21
 
54
22
  /** Get the default integrations for the Node SDK. */
@@ -71,187 +39,38 @@ function init(options = {}) {
71
39
  }
72
40
 
73
41
  /**
74
- * Initialize Sentry for Node, without any integrations added by default.
75
- */
76
- function initWithoutDefaultIntegrations(options = {}) {
77
- return _init(options, () => []);
78
- }
79
-
80
- /**
81
- * Initialize Sentry for Node, without performance instrumentation.
42
+ * Internal initialization function.
82
43
  */
83
44
  function _init(
84
- _options = {},
45
+ options = {},
85
46
  getDefaultIntegrationsImpl,
86
47
  ) {
87
- const options = getClientOptions(_options, getDefaultIntegrationsImpl);
88
-
89
- if (options.debug === true) {
90
- if (debugBuild.DEBUG_BUILD) {
91
- core.logger.enable();
92
- } else {
93
- // use `console.warn` rather than `logger.warn` since by non-debug bundles have all `logger.x` statements stripped
94
- core.consoleSandbox(() => {
95
- // eslint-disable-next-line no-console
96
- console.warn('[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.');
97
- });
98
- }
99
- }
100
-
101
- if (!commonjs.isCjs() && options.registerEsmLoaderHooks !== false) {
102
- initOtel.maybeInitializeEsmLoader();
103
- }
104
-
105
- opentelemetry.setOpenTelemetryContextAsyncContextStrategy();
106
-
107
- const scope = core.getCurrentScope();
108
- scope.update(options.initialScope);
109
-
110
- if (options.spotlight && !options.integrations.some(({ name }) => name === spotlight.INTEGRATION_NAME)) {
111
- options.integrations.push(
112
- spotlight.spotlightIntegration({
113
- sidecarUrl: typeof options.spotlight === 'string' ? options.spotlight : undefined,
114
- }),
115
- );
116
- }
117
-
118
- const client$1 = new client.NodeClient(options);
119
- // The client is on the current scope, from where it generally is inherited
120
- core.getCurrentScope().setClient(client$1);
121
-
122
- client$1.init();
123
-
124
- core.logger.log(`Running in ${commonjs.isCjs() ? 'CommonJS' : 'ESM'} mode.`);
125
-
126
- client$1.startClientReportTracking();
127
-
128
- updateScopeFromEnvVariables();
48
+ const client = nodeCore.init({
49
+ ...options,
50
+ // Only use Node SDK defaults if none provided
51
+ defaultIntegrations: options.defaultIntegrations ?? getDefaultIntegrationsImpl(options),
52
+ });
129
53
 
130
- // If users opt-out of this, they _have_ to set up OpenTelemetry themselves
131
- // There is no way to use this SDK without OpenTelemetry!
132
- if (!options.skipOpenTelemetrySetup) {
133
- initOtel.initOpenTelemetry(client$1, {
54
+ // Add Node SDK specific OpenTelemetry setup
55
+ if (client && !options.skipOpenTelemetrySetup) {
56
+ initOtel.initOpenTelemetry(client, {
134
57
  spanProcessors: options.openTelemetrySpanProcessors,
135
58
  });
136
- validateOpenTelemetrySetup();
137
- }
138
-
139
- opentelemetry.enhanceDscWithOpenTelemetryRootSpanName(client$1);
140
- opentelemetry.setupEventContextTrace(client$1);
141
-
142
- return client$1;
143
- }
144
-
145
- /**
146
- * Validate that your OpenTelemetry setup is correct.
147
- */
148
- function validateOpenTelemetrySetup() {
149
- if (!debugBuild.DEBUG_BUILD) {
150
- return;
59
+ nodeCore.validateOpenTelemetrySetup();
151
60
  }
152
61
 
153
- const setup = opentelemetry.openTelemetrySetupCheck();
154
-
155
- const required = ['SentryContextManager', 'SentryPropagator'];
156
-
157
- if (core.hasSpansEnabled()) {
158
- required.push('SentrySpanProcessor');
159
- }
160
-
161
- for (const k of required) {
162
- if (!setup.includes(k)) {
163
- core.logger.error(
164
- `You have to set up the ${k}. Without this, the OpenTelemetry & Sentry integration will not work properly.`,
165
- );
166
- }
167
- }
168
-
169
- if (!setup.includes('SentrySampler')) {
170
- core.logger.warn(
171
- 'You have to set up the SentrySampler. Without this, the OpenTelemetry & Sentry integration may still work, but sample rates set for the Sentry SDK will not be respected. If you use a custom sampler, make sure to use `wrapSamplingDecision`.',
172
- );
173
- }
174
- }
175
-
176
- function getClientOptions(
177
- options,
178
- getDefaultIntegrationsImpl,
179
- ) {
180
- const release = getRelease(options.release);
181
- const spotlight =
182
- options.spotlight ?? envToBool.envToBool(process.env.SENTRY_SPOTLIGHT, { strict: true }) ?? process.env.SENTRY_SPOTLIGHT;
183
- const tracesSampleRate = getTracesSampleRate(options.tracesSampleRate);
184
-
185
- const mergedOptions = {
186
- ...options,
187
- dsn: options.dsn ?? process.env.SENTRY_DSN,
188
- environment: options.environment ?? process.env.SENTRY_ENVIRONMENT,
189
- sendClientReports: options.sendClientReports ?? true,
190
- transport: options.transport ?? http.makeNodeTransport,
191
- stackParser: core.stackParserFromStackParserOptions(options.stackParser || api.defaultStackParser),
192
- release,
193
- tracesSampleRate,
194
- spotlight,
195
- debug: envToBool.envToBool(options.debug ?? process.env.SENTRY_DEBUG),
196
- };
197
-
198
- const integrations = options.integrations;
199
- const defaultIntegrations = options.defaultIntegrations ?? getDefaultIntegrationsImpl(mergedOptions);
200
-
201
- return {
202
- ...mergedOptions,
203
- integrations: core.getIntegrationsToSetup({
204
- defaultIntegrations,
205
- integrations,
206
- }),
207
- };
208
- }
209
-
210
- function getRelease(release) {
211
- if (release !== undefined) {
212
- return release;
213
- }
214
-
215
- const detectedRelease = api.getSentryRelease();
216
- if (detectedRelease !== undefined) {
217
- return detectedRelease;
218
- }
219
-
220
- return undefined;
221
- }
222
-
223
- function getTracesSampleRate(tracesSampleRate) {
224
- if (tracesSampleRate !== undefined) {
225
- return tracesSampleRate;
226
- }
227
-
228
- const sampleRateFromEnv = process.env.SENTRY_TRACES_SAMPLE_RATE;
229
- if (!sampleRateFromEnv) {
230
- return undefined;
231
- }
232
-
233
- const parsed = parseFloat(sampleRateFromEnv);
234
- return isFinite(parsed) ? parsed : undefined;
62
+ return client;
235
63
  }
236
64
 
237
65
  /**
238
- * Update scope and propagation context based on environmental variables.
239
- *
240
- * See https://github.com/getsentry/rfcs/blob/main/text/0071-continue-trace-over-process-boundaries.md
241
- * for more details.
66
+ * Initialize Sentry for Node, without any integrations added by default.
242
67
  */
243
- function updateScopeFromEnvVariables() {
244
- if (envToBool.envToBool(process.env.SENTRY_USE_ENVIRONMENT) !== false) {
245
- const sentryTraceEnv = process.env.SENTRY_TRACE;
246
- const baggageEnv = process.env.SENTRY_BAGGAGE;
247
- const propagationContext = core.propagationContextFromHeaders(sentryTraceEnv, baggageEnv);
248
- core.getCurrentScope().setPropagationContext(propagationContext);
249
- }
68
+ function initWithoutDefaultIntegrations(options = {}) {
69
+ return _init(options, () => []);
250
70
  }
251
71
 
252
72
  exports.getDefaultIntegrations = getDefaultIntegrations;
253
73
  exports.getDefaultIntegrationsWithoutPerformance = getDefaultIntegrationsWithoutPerformance;
254
74
  exports.init = init;
255
75
  exports.initWithoutDefaultIntegrations = initWithoutDefaultIntegrations;
256
- exports.validateOpenTelemetrySetup = validateOpenTelemetrySetup;
257
76
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/sdk/index.ts"],"sourcesContent":["import type { Integration, Options } from '@sentry/core';\nimport {\n consoleIntegration,\n consoleSandbox,\n functionToStringIntegration,\n getCurrentScope,\n getIntegrationsToSetup,\n hasSpansEnabled,\n inboundFiltersIntegration,\n linkedErrorsIntegration,\n logger,\n propagationContextFromHeaders,\n requestDataIntegration,\n stackParserFromStackParserOptions,\n} from '@sentry/core';\nimport {\n enhanceDscWithOpenTelemetryRootSpanName,\n openTelemetrySetupCheck,\n setOpenTelemetryContextAsyncContextStrategy,\n setupEventContextTrace,\n} from '@sentry/opentelemetry';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { childProcessIntegration } from '../integrations/childProcess';\nimport { nodeContextIntegration } from '../integrations/context';\nimport { contextLinesIntegration } from '../integrations/contextlines';\nimport { httpIntegration } from '../integrations/http';\nimport { localVariablesIntegration } from '../integrations/local-variables';\nimport { modulesIntegration } from '../integrations/modules';\nimport { nativeNodeFetchIntegration } from '../integrations/node-fetch';\nimport { onUncaughtExceptionIntegration } from '../integrations/onuncaughtexception';\nimport { onUnhandledRejectionIntegration } from '../integrations/onunhandledrejection';\nimport { processSessionIntegration } from '../integrations/processSession';\nimport { INTEGRATION_NAME as SPOTLIGHT_INTEGRATION_NAME, spotlightIntegration } from '../integrations/spotlight';\nimport { getAutoPerformanceIntegrations } from '../integrations/tracing';\nimport { makeNodeTransport } from '../transports';\nimport type { NodeClientOptions, NodeOptions } from '../types';\nimport { isCjs } from '../utils/commonjs';\nimport { envToBool } from '../utils/envToBool';\nimport { defaultStackParser, getSentryRelease } from './api';\nimport { NodeClient } from './client';\nimport { initOpenTelemetry, maybeInitializeEsmLoader } from './initOtel';\n\n/**\n * Get default integrations, excluding performance.\n */\nexport function getDefaultIntegrationsWithoutPerformance(): Integration[] {\n return [\n // Common\n // TODO(v10): Replace with `eventFiltersIntegration` once we remove the deprecated `inboundFiltersIntegration`\n // eslint-disable-next-line deprecation/deprecation\n inboundFiltersIntegration(),\n functionToStringIntegration(),\n linkedErrorsIntegration(),\n requestDataIntegration(),\n // Native Wrappers\n consoleIntegration(),\n httpIntegration(),\n nativeNodeFetchIntegration(),\n // Global Handlers\n onUncaughtExceptionIntegration(),\n onUnhandledRejectionIntegration(),\n // Event Info\n contextLinesIntegration(),\n localVariablesIntegration(),\n nodeContextIntegration(),\n childProcessIntegration(),\n processSessionIntegration(),\n modulesIntegration(),\n ];\n}\n\n/** Get the default integrations for the Node SDK. */\nexport function getDefaultIntegrations(options: Options): Integration[] {\n return [\n ...getDefaultIntegrationsWithoutPerformance(),\n // We only add performance integrations if tracing is enabled\n // Note that this means that without tracing enabled, e.g. `expressIntegration()` will not be added\n // This means that generally request isolation will work (because that is done by httpIntegration)\n // But `transactionName` will not be set automatically\n ...(hasSpansEnabled(options) ? getAutoPerformanceIntegrations() : []),\n ];\n}\n\n/**\n * Initialize Sentry for Node.\n */\nexport function init(options: NodeOptions | undefined = {}): NodeClient | undefined {\n return _init(options, getDefaultIntegrations);\n}\n\n/**\n * Initialize Sentry for Node, without any integrations added by default.\n */\nexport function initWithoutDefaultIntegrations(options: NodeOptions | undefined = {}): NodeClient {\n return _init(options, () => []);\n}\n\n/**\n * Initialize Sentry for Node, without performance instrumentation.\n */\nfunction _init(\n _options: NodeOptions | undefined = {},\n getDefaultIntegrationsImpl: (options: Options) => Integration[],\n): NodeClient {\n const options = getClientOptions(_options, getDefaultIntegrationsImpl);\n\n if (options.debug === true) {\n if (DEBUG_BUILD) {\n logger.enable();\n } else {\n // use `console.warn` rather than `logger.warn` since by non-debug bundles have all `logger.x` statements stripped\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn('[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.');\n });\n }\n }\n\n if (!isCjs() && options.registerEsmLoaderHooks !== false) {\n maybeInitializeEsmLoader();\n }\n\n setOpenTelemetryContextAsyncContextStrategy();\n\n const scope = getCurrentScope();\n scope.update(options.initialScope);\n\n if (options.spotlight && !options.integrations.some(({ name }) => name === SPOTLIGHT_INTEGRATION_NAME)) {\n options.integrations.push(\n spotlightIntegration({\n sidecarUrl: typeof options.spotlight === 'string' ? options.spotlight : undefined,\n }),\n );\n }\n\n const client = new NodeClient(options);\n // The client is on the current scope, from where it generally is inherited\n getCurrentScope().setClient(client);\n\n client.init();\n\n logger.log(`Running in ${isCjs() ? 'CommonJS' : 'ESM'} mode.`);\n\n client.startClientReportTracking();\n\n updateScopeFromEnvVariables();\n\n // If users opt-out of this, they _have_ to set up OpenTelemetry themselves\n // There is no way to use this SDK without OpenTelemetry!\n if (!options.skipOpenTelemetrySetup) {\n initOpenTelemetry(client, {\n spanProcessors: options.openTelemetrySpanProcessors,\n });\n validateOpenTelemetrySetup();\n }\n\n enhanceDscWithOpenTelemetryRootSpanName(client);\n setupEventContextTrace(client);\n\n return client;\n}\n\n/**\n * Validate that your OpenTelemetry setup is correct.\n */\nexport function validateOpenTelemetrySetup(): void {\n if (!DEBUG_BUILD) {\n return;\n }\n\n const setup = openTelemetrySetupCheck();\n\n const required: ReturnType<typeof openTelemetrySetupCheck> = ['SentryContextManager', 'SentryPropagator'];\n\n if (hasSpansEnabled()) {\n required.push('SentrySpanProcessor');\n }\n\n for (const k of required) {\n if (!setup.includes(k)) {\n logger.error(\n `You have to set up the ${k}. Without this, the OpenTelemetry & Sentry integration will not work properly.`,\n );\n }\n }\n\n if (!setup.includes('SentrySampler')) {\n logger.warn(\n 'You have to set up the SentrySampler. Without this, the OpenTelemetry & Sentry integration may still work, but sample rates set for the Sentry SDK will not be respected. If you use a custom sampler, make sure to use `wrapSamplingDecision`.',\n );\n }\n}\n\nfunction getClientOptions(\n options: NodeOptions,\n getDefaultIntegrationsImpl: (options: Options) => Integration[],\n): NodeClientOptions {\n const release = getRelease(options.release);\n const spotlight =\n options.spotlight ?? envToBool(process.env.SENTRY_SPOTLIGHT, { strict: true }) ?? process.env.SENTRY_SPOTLIGHT;\n const tracesSampleRate = getTracesSampleRate(options.tracesSampleRate);\n\n const mergedOptions = {\n ...options,\n dsn: options.dsn ?? process.env.SENTRY_DSN,\n environment: options.environment ?? process.env.SENTRY_ENVIRONMENT,\n sendClientReports: options.sendClientReports ?? true,\n transport: options.transport ?? makeNodeTransport,\n stackParser: stackParserFromStackParserOptions(options.stackParser || defaultStackParser),\n release,\n tracesSampleRate,\n spotlight,\n debug: envToBool(options.debug ?? process.env.SENTRY_DEBUG),\n };\n\n const integrations = options.integrations;\n const defaultIntegrations = options.defaultIntegrations ?? getDefaultIntegrationsImpl(mergedOptions);\n\n return {\n ...mergedOptions,\n integrations: getIntegrationsToSetup({\n defaultIntegrations,\n integrations,\n }),\n };\n}\n\nfunction getRelease(release: NodeOptions['release']): string | undefined {\n if (release !== undefined) {\n return release;\n }\n\n const detectedRelease = getSentryRelease();\n if (detectedRelease !== undefined) {\n return detectedRelease;\n }\n\n return undefined;\n}\n\nfunction getTracesSampleRate(tracesSampleRate: NodeOptions['tracesSampleRate']): number | undefined {\n if (tracesSampleRate !== undefined) {\n return tracesSampleRate;\n }\n\n const sampleRateFromEnv = process.env.SENTRY_TRACES_SAMPLE_RATE;\n if (!sampleRateFromEnv) {\n return undefined;\n }\n\n const parsed = parseFloat(sampleRateFromEnv);\n return isFinite(parsed) ? parsed : undefined;\n}\n\n/**\n * Update scope and propagation context based on environmental variables.\n *\n * See https://github.com/getsentry/rfcs/blob/main/text/0071-continue-trace-over-process-boundaries.md\n * for more details.\n */\nfunction updateScopeFromEnvVariables(): void {\n if (envToBool(process.env.SENTRY_USE_ENVIRONMENT) !== false) {\n const sentryTraceEnv = process.env.SENTRY_TRACE;\n const baggageEnv = process.env.SENTRY_BAGGAGE;\n const propagationContext = propagationContextFromHeaders(sentryTraceEnv, baggageEnv);\n getCurrentScope().setPropagationContext(propagationContext);\n }\n}\n"],"names":["inboundFiltersIntegration","functionToStringIntegration","linkedErrorsIntegration","requestDataIntegration","consoleIntegration","httpIntegration","nativeNodeFetchIntegration","onUncaughtExceptionIntegration","onUnhandledRejectionIntegration","contextLinesIntegration","localVariablesIntegration","nodeContextIntegration","childProcessIntegration","processSessionIntegration","modulesIntegration","hasSpansEnabled","getAutoPerformanceIntegrations","DEBUG_BUILD","logger","consoleSandbox","isCjs","maybeInitializeEsmLoader","setOpenTelemetryContextAsyncContextStrategy","getCurrentScope","SPOTLIGHT_INTEGRATION_NAME","spotlightIntegration","client","NodeClient","initOpenTelemetry","enhanceDscWithOpenTelemetryRootSpanName","setupEventContextTrace","openTelemetrySetupCheck","envToBool","makeNodeTransport","stackParserFromStackParserOptions","defaultStackParser","getIntegrationsToSetup","getSentryRelease","propagationContextFromHeaders"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA0CA;AACA;AACA;AACO,SAAS,wCAAwC,GAAkB;AAC1E,EAAE,OAAO;AACT;AACA;AACA;AACA,IAAIA,8BAAyB,EAAE;AAC/B,IAAIC,gCAA2B,EAAE;AACjC,IAAIC,4BAAuB,EAAE;AAC7B,IAAIC,2BAAsB,EAAE;AAC5B;AACA,IAAIC,uBAAkB,EAAE;AACxB,IAAIC,uBAAe,EAAE;AACrB,IAAIC,kCAA0B,EAAE;AAChC;AACA,IAAIC,kDAA8B,EAAE;AACpC,IAAIC,oDAA+B,EAAE;AACrC;AACA,IAAIC,oCAAuB,EAAE;AAC7B,IAAIC,iCAAyB,EAAE;AAC/B,IAAIC,8BAAsB,EAAE;AAC5B,IAAIC,oCAAuB,EA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,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAA,KAAM,KAAK,EAAE;AAC/D,IAAI,MAAM,cAAe,GAAE,OAAO,CAAC,GAAG,CAAC,YAAY;AACnD,IAAI,MAAM,UAAW,GAAE,OAAO,CAAC,GAAG,CAAC,cAAc;AACjD,IAAI,MAAM,qBAAqBM,kCAA6B,CAAC,cAAc,EAAE,UAAU,CAAC;AACxF,IAAIf,oBAAe,EAAE,CAAC,qBAAqB,CAAC,kBAAkB,CAAC;AAC/D;AACA;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/sdk/index.ts"],"sourcesContent":["import type { Integration, Options } from '@sentry/core';\nimport { hasSpansEnabled } from '@sentry/core';\nimport type { NodeClient } from '@sentry/node-core';\nimport {\n getDefaultIntegrations as getNodeCoreDefaultIntegrations,\n init as initNodeCore,\n validateOpenTelemetrySetup,\n} from '@sentry/node-core';\nimport { httpIntegration } from '../integrations/http';\nimport { nativeNodeFetchIntegration } from '../integrations/node-fetch';\nimport { getAutoPerformanceIntegrations } from '../integrations/tracing';\nimport type { NodeOptions } from '../types';\nimport { initOpenTelemetry } from './initOtel';\n\n/**\n * Get default integrations, excluding performance.\n */\nexport function getDefaultIntegrationsWithoutPerformance(): Integration[] {\n const nodeCoreIntegrations = getNodeCoreDefaultIntegrations();\n\n // Filter out the node-core HTTP and NodeFetch integrations and replace them with Node SDK's composite versions\n return nodeCoreIntegrations\n .filter(integration => integration.name !== 'Http' && integration.name !== 'NodeFetch')\n .concat(httpIntegration(), nativeNodeFetchIntegration());\n}\n\n/** Get the default integrations for the Node SDK. */\nexport function getDefaultIntegrations(options: Options): Integration[] {\n return [\n ...getDefaultIntegrationsWithoutPerformance(),\n // We only add performance integrations if tracing is enabled\n // Note that this means that without tracing enabled, e.g. `expressIntegration()` will not be added\n // This means that generally request isolation will work (because that is done by httpIntegration)\n // But `transactionName` will not be set automatically\n ...(hasSpansEnabled(options) ? getAutoPerformanceIntegrations() : []),\n ];\n}\n\n/**\n * Initialize Sentry for Node.\n */\nexport function init(options: NodeOptions | undefined = {}): NodeClient | undefined {\n return _init(options, getDefaultIntegrations);\n}\n\n/**\n * Internal initialization function.\n */\nfunction _init(\n options: NodeOptions | undefined = {},\n getDefaultIntegrationsImpl: (options: Options) => Integration[],\n): NodeClient | undefined {\n const client = initNodeCore({\n ...options,\n // Only use Node SDK defaults if none provided\n defaultIntegrations: options.defaultIntegrations ?? getDefaultIntegrationsImpl(options),\n });\n\n // Add Node SDK specific OpenTelemetry setup\n if (client && !options.skipOpenTelemetrySetup) {\n initOpenTelemetry(client, {\n spanProcessors: options.openTelemetrySpanProcessors,\n });\n validateOpenTelemetrySetup();\n }\n\n return client;\n}\n\n/**\n * Initialize Sentry for Node, without any integrations added by default.\n */\nexport function initWithoutDefaultIntegrations(options: NodeOptions | undefined = {}): NodeClient | undefined {\n return _init(options, () => []);\n}\n"],"names":["getNodeCoreDefaultIntegrations","httpIntegration","nativeNodeFetchIntegration","hasSpansEnabled","getAutoPerformanceIntegrations","initNodeCore","initOpenTelemetry","validateOpenTelemetrySetup"],"mappings":";;;;;;;;;AAcA;AACA;AACA;AACO,SAAS,wCAAwC,GAAkB;AAC1E,EAAE,MAAM,oBAAA,GAAuBA,+BAA8B,EAAE;;AAE/D;AACA,EAAE,OAAO;AACT,KAAK,MAAM,CAAC,WAAA,IAAe,WAAW,CAAC,IAAK,KAAI,UAAU,WAAW,CAAC,IAAA,KAAS,WAAW;AAC1F,KAAK,MAAM,CAACC,uBAAe,EAAE,EAAEC,kCAA0B,EAAE,CAAC;AAC5D;;AAEA;AACO,SAAS,sBAAsB,CAAC,OAAO,EAA0B;AACxE,EAAE,OAAO;AACT,IAAI,GAAG,wCAAwC,EAAE;AACjD;AACA;AACA;AACA;AACA,IAAI,IAAIC,oBAAe,CAAC,OAAO,CAAA,GAAIC,oCAA8B,EAAC,GAAI,EAAE,CAAC;AACzE,GAAG;AACH;;AAEA;AACA;AACA;AACO,SAAS,IAAI,CAAC,OAAO,GAA4B,EAAE,EAA0B;AACpF,EAAE,OAAO,KAAK,CAAC,OAAO,EAAE,sBAAsB,CAAC;AAC/C;;AAEA;AACA;AACA;AACA,SAAS,KAAK;AACd,EAAE,OAAO,GAA4B,EAAE;AACvC,EAAE,0BAA0B;AAC5B,EAA0B;AAC1B,EAAE,MAAM,MAAA,GAASC,aAAY,CAAC;AAC9B,IAAI,GAAG,OAAO;AACd;AACA,IAAI,mBAAmB,EAAE,OAAO,CAAC,uBAAuB,0BAA0B,CAAC,OAAO,CAAC;AAC3F,GAAG,CAAC;;AAEJ;AACA,EAAE,IAAI,MAAO,IAAG,CAAC,OAAO,CAAC,sBAAsB,EAAE;AACjD,IAAIC,0BAAiB,CAAC,MAAM,EAAE;AAC9B,MAAM,cAAc,EAAE,OAAO,CAAC,2BAA2B;AACzD,KAAK,CAAC;AACN,IAAIC,mCAA0B,EAAE;AAChC;;AAEA,EAAE,OAAO,MAAM;AACf;;AAEA;AACA;AACA;AACO,SAAS,8BAA8B,CAAC,OAAO,GAA4B,EAAE,EAA0B;AAC9G,EAAE,OAAO,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC;AACjC;;;;;;;"}
@@ -5,13 +5,12 @@ const resources = require('@opentelemetry/resources');
5
5
  const sdkTraceBase = require('@opentelemetry/sdk-trace-base');
6
6
  const semanticConventions = require('@opentelemetry/semantic-conventions');
7
7
  const core = require('@sentry/core');
8
+ const nodeCore = require('@sentry/node-core');
8
9
  const opentelemetry = require('@sentry/opentelemetry');
9
10
  const importInTheMiddle = require('import-in-the-middle');
10
11
  const moduleModule = require('module');
11
12
  const debugBuild = require('../debug-build.js');
12
13
  const index = require('../integrations/tracing/index.js');
13
- const contextManager = require('../otel/contextManager.js');
14
- const commonjs = require('../utils/commonjs.js');
15
14
 
16
15
  var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
17
16
  // About 277h - this must fit into new Array(len)!
@@ -22,7 +21,7 @@ const MAX_MAX_SPAN_WAIT_DURATION = 1000000;
22
21
  */
23
22
  function initOpenTelemetry(client, options = {}) {
24
23
  if (client.getOptions().debug) {
25
- setupOpenTelemetryLogger();
24
+ nodeCore.setupOpenTelemetryLogger();
26
25
  }
27
26
 
28
27
  const provider = setupOtel(client, options);
@@ -67,10 +66,9 @@ function preloadOpenTelemetry(options = {}) {
67
66
 
68
67
  if (debug) {
69
68
  core.logger.enable();
70
- setupOpenTelemetryLogger();
71
69
  }
72
70
 
73
- if (!commonjs.isCjs()) {
71
+ if (!nodeCore.isCjs()) {
74
72
  maybeInitializeEsmLoader();
75
73
  }
76
74
 
@@ -117,7 +115,7 @@ function setupOtel(client, options = {}) {
117
115
  // Register as globals
118
116
  api.trace.setGlobalTracerProvider(provider);
119
117
  api.propagation.setGlobalPropagator(new opentelemetry.SentryPropagator());
120
- api.context.setGlobalContextManager(new contextManager.SentryContextManager());
118
+ api.context.setGlobalContextManager(new nodeCore.SentryContextManager());
121
119
 
122
120
  return provider;
123
121
  }
@@ -142,22 +140,6 @@ function _clampSpanProcessorTimeout(maxSpanWaitDuration) {
142
140
  return maxSpanWaitDuration;
143
141
  }
144
142
 
145
- /**
146
- * Setup the OTEL logger to use our own logger.
147
- */
148
- function setupOpenTelemetryLogger() {
149
- const otelLogger = new Proxy(core.logger , {
150
- get(target, prop, receiver) {
151
- const actualProp = prop === 'verbose' ? 'debug' : prop;
152
- return Reflect.get(target, actualProp, receiver);
153
- },
154
- });
155
-
156
- // Disable diag, to ensure this works even if called multiple times
157
- api.diag.disable();
158
- api.diag.setLogger(otelLogger, api.DiagLogLevel.DEBUG);
159
- }
160
-
161
143
  exports._clampSpanProcessorTimeout = _clampSpanProcessorTimeout;
162
144
  exports.initOpenTelemetry = initOpenTelemetry;
163
145
  exports.maybeInitializeEsmLoader = maybeInitializeEsmLoader;
@@ -1 +1 @@
1
- {"version":3,"file":"initOtel.js","sources":["../../../src/sdk/initOtel.ts"],"sourcesContent":["import { context, diag, DiagLogLevel, propagation, trace } from '@opentelemetry/api';\nimport { Resource } from '@opentelemetry/resources';\nimport type { SpanProcessor } from '@opentelemetry/sdk-trace-base';\nimport { BasicTracerProvider } from '@opentelemetry/sdk-trace-base';\nimport {\n ATTR_SERVICE_NAME,\n ATTR_SERVICE_VERSION,\n SEMRESATTRS_SERVICE_NAMESPACE,\n} from '@opentelemetry/semantic-conventions';\nimport { consoleSandbox, GLOBAL_OBJ, logger, SDK_VERSION } from '@sentry/core';\nimport { SentryPropagator, SentrySampler, SentrySpanProcessor } from '@sentry/opentelemetry';\nimport { createAddHookMessageChannel } from 'import-in-the-middle';\nimport moduleModule from 'module';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { getOpenTelemetryInstrumentationToPreload } from '../integrations/tracing';\nimport { SentryContextManager } from '../otel/contextManager';\nimport { isCjs } from '../utils/commonjs';\nimport type { NodeClient } from './client';\n\n// About 277h - this must fit into new Array(len)!\nconst MAX_MAX_SPAN_WAIT_DURATION = 1_000_000;\n\ninterface AdditionalOpenTelemetryOptions {\n /** Additional SpanProcessor instances that should be used. */\n spanProcessors?: SpanProcessor[];\n}\n\n/**\n * Initialize OpenTelemetry for Node.\n */\nexport function initOpenTelemetry(client: NodeClient, options: AdditionalOpenTelemetryOptions = {}): void {\n if (client.getOptions().debug) {\n setupOpenTelemetryLogger();\n }\n\n const provider = setupOtel(client, options);\n client.traceProvider = provider;\n}\n\n/** Initialize the ESM loader. */\nexport function maybeInitializeEsmLoader(): void {\n const [nodeMajor = 0, nodeMinor = 0] = process.versions.node.split('.').map(Number);\n\n // Register hook was added in v20.6.0 and v18.19.0\n if (nodeMajor >= 21 || (nodeMajor === 20 && nodeMinor >= 6) || (nodeMajor === 18 && nodeMinor >= 19)) {\n if (!GLOBAL_OBJ._sentryEsmLoaderHookRegistered) {\n try {\n const { addHookMessagePort } = createAddHookMessageChannel();\n // @ts-expect-error register is available in these versions\n moduleModule.register('import-in-the-middle/hook.mjs', import.meta.url, {\n data: { addHookMessagePort, include: [] },\n transferList: [addHookMessagePort],\n });\n } catch (error) {\n logger.warn('Failed to register ESM hook', error);\n }\n }\n } else {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn(\n `[Sentry] You are using Node.js v${process.versions.node} in ESM mode (\"import syntax\"). The Sentry Node.js SDK is not compatible with ESM in Node.js versions before 18.19.0 or before 20.6.0. Please either build your application with CommonJS (\"require() syntax\"), or upgrade your Node.js version.`,\n );\n });\n }\n}\n\ninterface NodePreloadOptions {\n debug?: boolean;\n integrations?: string[];\n}\n\n/**\n * Preload OpenTelemetry for Node.\n * This can be used to preload instrumentation early, but set up Sentry later.\n * By preloading the OTEL instrumentation wrapping still happens early enough that everything works.\n */\nexport function preloadOpenTelemetry(options: NodePreloadOptions = {}): void {\n const { debug } = options;\n\n if (debug) {\n logger.enable();\n setupOpenTelemetryLogger();\n }\n\n if (!isCjs()) {\n maybeInitializeEsmLoader();\n }\n\n // These are all integrations that we need to pre-load to ensure they are set up before any other code runs\n getPreloadMethods(options.integrations).forEach(fn => {\n fn();\n\n if (debug) {\n logger.log(`[Sentry] Preloaded ${fn.id} instrumentation`);\n }\n });\n}\n\nfunction getPreloadMethods(integrationNames?: string[]): ((() => void) & { id: string })[] {\n const instruments = getOpenTelemetryInstrumentationToPreload();\n\n if (!integrationNames) {\n return instruments;\n }\n\n return instruments.filter(instrumentation => integrationNames.includes(instrumentation.id));\n}\n\n/** Just exported for tests. */\nexport function setupOtel(client: NodeClient, options: AdditionalOpenTelemetryOptions = {}): BasicTracerProvider {\n // Create and configure NodeTracerProvider\n const provider = new BasicTracerProvider({\n sampler: new SentrySampler(client),\n resource: new Resource({\n [ATTR_SERVICE_NAME]: 'node',\n // eslint-disable-next-line deprecation/deprecation\n [SEMRESATTRS_SERVICE_NAMESPACE]: 'sentry',\n [ATTR_SERVICE_VERSION]: SDK_VERSION,\n }),\n forceFlushTimeoutMillis: 500,\n spanProcessors: [\n new SentrySpanProcessor({\n timeout: _clampSpanProcessorTimeout(client.getOptions().maxSpanWaitDuration),\n }),\n ...(options.spanProcessors || []),\n ],\n });\n\n // Register as globals\n trace.setGlobalTracerProvider(provider);\n propagation.setGlobalPropagator(new SentryPropagator());\n context.setGlobalContextManager(new SentryContextManager());\n\n return provider;\n}\n\n/** Just exported for tests. */\nexport function _clampSpanProcessorTimeout(maxSpanWaitDuration: number | undefined): number | undefined {\n if (maxSpanWaitDuration == null) {\n return undefined;\n }\n\n // We guard for a max. value here, because we create an array with this length\n // So if this value is too large, this would fail\n if (maxSpanWaitDuration > MAX_MAX_SPAN_WAIT_DURATION) {\n DEBUG_BUILD &&\n logger.warn(`\\`maxSpanWaitDuration\\` is too high, using the maximum value of ${MAX_MAX_SPAN_WAIT_DURATION}`);\n return MAX_MAX_SPAN_WAIT_DURATION;\n } else if (maxSpanWaitDuration <= 0 || Number.isNaN(maxSpanWaitDuration)) {\n DEBUG_BUILD && logger.warn('`maxSpanWaitDuration` must be a positive number, using default value instead.');\n return undefined;\n }\n\n return maxSpanWaitDuration;\n}\n\n/**\n * Setup the OTEL logger to use our own logger.\n */\nfunction setupOpenTelemetryLogger(): void {\n const otelLogger = new Proxy(logger as typeof logger & { verbose: (typeof logger)['debug'] }, {\n get(target, prop, receiver) {\n const actualProp = prop === 'verbose' ? 'debug' : prop;\n return Reflect.get(target, actualProp, receiver);\n },\n });\n\n // Disable diag, to ensure this works even if called multiple times\n diag.disable();\n diag.setLogger(otelLogger, DiagLogLevel.DEBUG);\n}\n"],"names":["GLOBAL_OBJ","createAddHookMessageChannel","moduleModule","logger","consoleSandbox","isCjs","getOpenTelemetryInstrumentationToPreload","BasicTracerProvider","SentrySampler","Resource","ATTR_SERVICE_NAME","SEMRESATTRS_SERVICE_NAMESPACE","ATTR_SERVICE_VERSION","SDK_VERSION","SentrySpanProcessor","trace","propagation","SentryPropagator","context","SentryContextManager","DEBUG_BUILD","diag","DiagLogLevel"],"mappings":";;;;;;;;;;;;;;;;AAmBA;AACA,MAAM,0BAAA,GAA6B,OAAS;;AAO5C;AACA;AACA;AACO,S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AA,UAAA,GAAA,IAAA,KAAA,SAAA,GAAA,OAAA,GAAA,IAAA;AACA,MAAA,OAAA,OAAA,CAAA,GAAA,CAAA,MAAA,EAAA,UAAA,EAAA,QAAA,CAAA;AACA,KAAA;AACA,GAAA,CAAA;;AAEA;AACA,EAAAkB,QAAA,CAAA,OAAA,EAAA;AACA,EAAAA,QAAA,CAAA,SAAA,CAAA,UAAA,EAAAC,gBAAA,CAAA,KAAA,CAAA;AACA;;;;;;;;"}
1
+ {"version":3,"file":"initOtel.js","sources":["../../../src/sdk/initOtel.ts"],"sourcesContent":["import { context, propagation, trace } from '@opentelemetry/api';\nimport { Resource } from '@opentelemetry/resources';\nimport type { SpanProcessor } from '@opentelemetry/sdk-trace-base';\nimport { BasicTracerProvider } from '@opentelemetry/sdk-trace-base';\nimport {\n ATTR_SERVICE_NAME,\n ATTR_SERVICE_VERSION,\n SEMRESATTRS_SERVICE_NAMESPACE,\n} from '@opentelemetry/semantic-conventions';\nimport { consoleSandbox, GLOBAL_OBJ, logger, SDK_VERSION } from '@sentry/core';\nimport { type NodeClient, isCjs, SentryContextManager, setupOpenTelemetryLogger } from '@sentry/node-core';\nimport { SentryPropagator, SentrySampler, SentrySpanProcessor } from '@sentry/opentelemetry';\nimport { createAddHookMessageChannel } from 'import-in-the-middle';\nimport moduleModule from 'module';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { getOpenTelemetryInstrumentationToPreload } from '../integrations/tracing';\n\n// About 277h - this must fit into new Array(len)!\nconst MAX_MAX_SPAN_WAIT_DURATION = 1_000_000;\n\ninterface AdditionalOpenTelemetryOptions {\n /** Additional SpanProcessor instances that should be used. */\n spanProcessors?: SpanProcessor[];\n}\n\n/**\n * Initialize OpenTelemetry for Node.\n */\nexport function initOpenTelemetry(client: NodeClient, options: AdditionalOpenTelemetryOptions = {}): void {\n if (client.getOptions().debug) {\n setupOpenTelemetryLogger();\n }\n\n const provider = setupOtel(client, options);\n client.traceProvider = provider;\n}\n\n/** Initialize the ESM loader. */\nexport function maybeInitializeEsmLoader(): void {\n const [nodeMajor = 0, nodeMinor = 0] = process.versions.node.split('.').map(Number);\n\n // Register hook was added in v20.6.0 and v18.19.0\n if (nodeMajor >= 21 || (nodeMajor === 20 && nodeMinor >= 6) || (nodeMajor === 18 && nodeMinor >= 19)) {\n if (!GLOBAL_OBJ._sentryEsmLoaderHookRegistered) {\n try {\n const { addHookMessagePort } = createAddHookMessageChannel();\n // @ts-expect-error register is available in these versions\n moduleModule.register('import-in-the-middle/hook.mjs', import.meta.url, {\n data: { addHookMessagePort, include: [] },\n transferList: [addHookMessagePort],\n });\n } catch (error) {\n logger.warn('Failed to register ESM hook', error);\n }\n }\n } else {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn(\n `[Sentry] You are using Node.js v${process.versions.node} in ESM mode (\"import syntax\"). The Sentry Node.js SDK is not compatible with ESM in Node.js versions before 18.19.0 or before 20.6.0. Please either build your application with CommonJS (\"require() syntax\"), or upgrade your Node.js version.`,\n );\n });\n }\n}\n\ninterface NodePreloadOptions {\n debug?: boolean;\n integrations?: string[];\n}\n\n/**\n * Preload OpenTelemetry for Node.\n * This can be used to preload instrumentation early, but set up Sentry later.\n * By preloading the OTEL instrumentation wrapping still happens early enough that everything works.\n */\nexport function preloadOpenTelemetry(options: NodePreloadOptions = {}): void {\n const { debug } = options;\n\n if (debug) {\n logger.enable();\n }\n\n if (!isCjs()) {\n maybeInitializeEsmLoader();\n }\n\n // These are all integrations that we need to pre-load to ensure they are set up before any other code runs\n getPreloadMethods(options.integrations).forEach(fn => {\n fn();\n\n if (debug) {\n logger.log(`[Sentry] Preloaded ${fn.id} instrumentation`);\n }\n });\n}\n\nfunction getPreloadMethods(integrationNames?: string[]): ((() => void) & { id: string })[] {\n const instruments = getOpenTelemetryInstrumentationToPreload();\n\n if (!integrationNames) {\n return instruments;\n }\n\n return instruments.filter(instrumentation => integrationNames.includes(instrumentation.id));\n}\n\n/** Just exported for tests. */\nexport function setupOtel(client: NodeClient, options: AdditionalOpenTelemetryOptions = {}): BasicTracerProvider {\n // Create and configure NodeTracerProvider\n const provider = new BasicTracerProvider({\n sampler: new SentrySampler(client),\n resource: new Resource({\n [ATTR_SERVICE_NAME]: 'node',\n // eslint-disable-next-line deprecation/deprecation\n [SEMRESATTRS_SERVICE_NAMESPACE]: 'sentry',\n [ATTR_SERVICE_VERSION]: SDK_VERSION,\n }),\n forceFlushTimeoutMillis: 500,\n spanProcessors: [\n new SentrySpanProcessor({\n timeout: _clampSpanProcessorTimeout(client.getOptions().maxSpanWaitDuration),\n }),\n ...(options.spanProcessors || []),\n ],\n });\n\n // Register as globals\n trace.setGlobalTracerProvider(provider);\n propagation.setGlobalPropagator(new SentryPropagator());\n context.setGlobalContextManager(new SentryContextManager());\n\n return provider;\n}\n\n/** Just exported for tests. */\nexport function _clampSpanProcessorTimeout(maxSpanWaitDuration: number | undefined): number | undefined {\n if (maxSpanWaitDuration == null) {\n return undefined;\n }\n\n // We guard for a max. value here, because we create an array with this length\n // So if this value is too large, this would fail\n if (maxSpanWaitDuration > MAX_MAX_SPAN_WAIT_DURATION) {\n DEBUG_BUILD &&\n logger.warn(`\\`maxSpanWaitDuration\\` is too high, using the maximum value of ${MAX_MAX_SPAN_WAIT_DURATION}`);\n return MAX_MAX_SPAN_WAIT_DURATION;\n } else if (maxSpanWaitDuration <= 0 || Number.isNaN(maxSpanWaitDuration)) {\n DEBUG_BUILD && logger.warn('`maxSpanWaitDuration` must be a positive number, using default value instead.');\n return undefined;\n }\n\n return maxSpanWaitDuration;\n}\n"],"names":["setupOpenTelemetryLogger","GLOBAL_OBJ","createAddHookMessageChannel","moduleModule","logger","consoleSandbox","isCjs","getOpenTelemetryInstrumentationToPreload","BasicTracerProvider","SentrySampler","Resource","ATTR_SERVICE_NAME","SEMRESATTRS_SERVICE_NAMESPACE","ATTR_SERVICE_VERSION","SDK_VERSION","SentrySpanProcessor","trace","propagation","SentryPropagator","context","SentryContextManager","DEBUG_BUILD"],"mappings":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