@sentry/node 9.32.0 → 9.34.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 (524) hide show
  1. package/build/cjs/index.js +50 -56
  2. package/build/cjs/index.js.map +1 -1
  3. package/build/cjs/integrations/featureFlagShims/launchDarkly.js +43 -0
  4. package/build/cjs/integrations/featureFlagShims/launchDarkly.js.map +1 -0
  5. package/build/cjs/integrations/featureFlagShims/openFeature.js +55 -0
  6. package/build/cjs/integrations/featureFlagShims/openFeature.js.map +1 -0
  7. package/build/cjs/integrations/featureFlagShims/statsig.js +23 -0
  8. package/build/cjs/integrations/featureFlagShims/statsig.js.map +1 -0
  9. package/build/cjs/integrations/featureFlagShims/unleash.js +23 -0
  10. package/build/cjs/integrations/featureFlagShims/unleash.js.map +1 -0
  11. package/build/cjs/integrations/fs.js +2 -2
  12. package/build/cjs/integrations/fs.js.map +1 -1
  13. package/build/cjs/integrations/http/index.js +7 -11
  14. package/build/cjs/integrations/http/index.js.map +1 -1
  15. package/build/cjs/integrations/node-fetch/index.js +4 -5
  16. package/build/cjs/integrations/node-fetch/index.js.map +1 -1
  17. package/build/cjs/integrations/tracing/amqplib.js +4 -5
  18. package/build/cjs/integrations/tracing/amqplib.js.map +1 -1
  19. package/build/cjs/integrations/tracing/connect.js +3 -4
  20. package/build/cjs/integrations/tracing/connect.js.map +1 -1
  21. package/build/cjs/integrations/tracing/dataloader.js +3 -3
  22. package/build/cjs/integrations/tracing/dataloader.js.map +1 -1
  23. package/build/cjs/integrations/tracing/express.js +5 -7
  24. package/build/cjs/integrations/tracing/express.js.map +1 -1
  25. package/build/cjs/integrations/tracing/fastify/fastify-otel/index.js +5 -10
  26. package/build/cjs/integrations/tracing/fastify/fastify-otel/index.js.map +1 -1
  27. package/build/cjs/integrations/tracing/fastify/index.js +47 -10
  28. package/build/cjs/integrations/tracing/fastify/index.js.map +1 -1
  29. package/build/cjs/integrations/tracing/genericPool.js +3 -3
  30. package/build/cjs/integrations/tracing/genericPool.js.map +1 -1
  31. package/build/cjs/integrations/tracing/graphql.js +3 -4
  32. package/build/cjs/integrations/tracing/graphql.js.map +1 -1
  33. package/build/cjs/integrations/tracing/hapi/index.js +3 -4
  34. package/build/cjs/integrations/tracing/hapi/index.js.map +1 -1
  35. package/build/cjs/integrations/tracing/index.js +3 -0
  36. package/build/cjs/integrations/tracing/index.js.map +1 -1
  37. package/build/cjs/integrations/tracing/kafka.js +4 -5
  38. package/build/cjs/integrations/tracing/kafka.js.map +1 -1
  39. package/build/cjs/integrations/tracing/knex.js +3 -3
  40. package/build/cjs/integrations/tracing/knex.js.map +1 -1
  41. package/build/cjs/integrations/tracing/koa.js +4 -6
  42. package/build/cjs/integrations/tracing/koa.js.map +1 -1
  43. package/build/cjs/integrations/tracing/lrumemoizer.js +2 -2
  44. package/build/cjs/integrations/tracing/lrumemoizer.js.map +1 -1
  45. package/build/cjs/integrations/tracing/mongo.js +3 -4
  46. package/build/cjs/integrations/tracing/mongo.js.map +1 -1
  47. package/build/cjs/integrations/tracing/mongoose.js +3 -4
  48. package/build/cjs/integrations/tracing/mongoose.js.map +1 -1
  49. package/build/cjs/integrations/tracing/mysql.js +2 -2
  50. package/build/cjs/integrations/tracing/mysql.js.map +1 -1
  51. package/build/cjs/integrations/tracing/mysql2.js +3 -4
  52. package/build/cjs/integrations/tracing/mysql2.js.map +1 -1
  53. package/build/cjs/integrations/tracing/postgres.js +3 -4
  54. package/build/cjs/integrations/tracing/postgres.js.map +1 -1
  55. package/build/cjs/integrations/tracing/postgresjs.js +282 -0
  56. package/build/cjs/integrations/tracing/postgresjs.js.map +1 -0
  57. package/build/cjs/integrations/tracing/prisma.js +2 -2
  58. package/build/cjs/integrations/tracing/prisma.js.map +1 -1
  59. package/build/cjs/integrations/tracing/redis.js +3 -3
  60. package/build/cjs/integrations/tracing/redis.js.map +1 -1
  61. package/build/cjs/integrations/tracing/tedious.js +3 -3
  62. package/build/cjs/integrations/tracing/tedious.js.map +1 -1
  63. package/build/cjs/integrations/tracing/vercelai/index.js +9 -185
  64. package/build/cjs/integrations/tracing/vercelai/index.js.map +1 -1
  65. package/build/cjs/preload.js +2 -2
  66. package/build/cjs/preload.js.map +1 -1
  67. package/build/cjs/sdk/index.js +22 -203
  68. package/build/cjs/sdk/index.js.map +1 -1
  69. package/build/cjs/sdk/initOtel.js +4 -22
  70. package/build/cjs/sdk/initOtel.js.map +1 -1
  71. package/build/esm/index.js +7 -21
  72. package/build/esm/index.js.map +1 -1
  73. package/build/esm/integrations/featureFlagShims/launchDarkly.js +40 -0
  74. package/build/esm/integrations/featureFlagShims/launchDarkly.js.map +1 -0
  75. package/build/esm/integrations/featureFlagShims/openFeature.js +52 -0
  76. package/build/esm/integrations/featureFlagShims/openFeature.js.map +1 -0
  77. package/build/esm/integrations/featureFlagShims/statsig.js +21 -0
  78. package/build/esm/integrations/featureFlagShims/statsig.js.map +1 -0
  79. package/build/esm/integrations/featureFlagShims/unleash.js +21 -0
  80. package/build/esm/integrations/featureFlagShims/unleash.js.map +1 -0
  81. package/build/esm/integrations/fs.js +1 -1
  82. package/build/esm/integrations/fs.js.map +1 -1
  83. package/build/esm/integrations/http/index.js +1 -5
  84. package/build/esm/integrations/http/index.js.map +1 -1
  85. package/build/esm/integrations/node-fetch/index.js +2 -3
  86. package/build/esm/integrations/node-fetch/index.js.map +1 -1
  87. package/build/esm/integrations/tracing/amqplib.js +1 -2
  88. package/build/esm/integrations/tracing/amqplib.js.map +1 -1
  89. package/build/esm/integrations/tracing/connect.js +1 -2
  90. package/build/esm/integrations/tracing/connect.js.map +1 -1
  91. package/build/esm/integrations/tracing/dataloader.js +1 -1
  92. package/build/esm/integrations/tracing/dataloader.js.map +1 -1
  93. package/build/esm/integrations/tracing/express.js +2 -4
  94. package/build/esm/integrations/tracing/express.js.map +1 -1
  95. package/build/esm/integrations/tracing/fastify/fastify-otel/index.js +5 -10
  96. package/build/esm/integrations/tracing/fastify/fastify-otel/index.js.map +1 -1
  97. package/build/esm/integrations/tracing/fastify/index.js +46 -9
  98. package/build/esm/integrations/tracing/fastify/index.js.map +1 -1
  99. package/build/esm/integrations/tracing/genericPool.js +1 -1
  100. package/build/esm/integrations/tracing/genericPool.js.map +1 -1
  101. package/build/esm/integrations/tracing/graphql.js +2 -3
  102. package/build/esm/integrations/tracing/graphql.js.map +1 -1
  103. package/build/esm/integrations/tracing/hapi/index.js +1 -2
  104. package/build/esm/integrations/tracing/hapi/index.js.map +1 -1
  105. package/build/esm/integrations/tracing/index.js +3 -0
  106. package/build/esm/integrations/tracing/index.js.map +1 -1
  107. package/build/esm/integrations/tracing/kafka.js +1 -2
  108. package/build/esm/integrations/tracing/kafka.js.map +1 -1
  109. package/build/esm/integrations/tracing/knex.js +1 -1
  110. package/build/esm/integrations/tracing/knex.js.map +1 -1
  111. package/build/esm/integrations/tracing/koa.js +2 -4
  112. package/build/esm/integrations/tracing/koa.js.map +1 -1
  113. package/build/esm/integrations/tracing/lrumemoizer.js +1 -1
  114. package/build/esm/integrations/tracing/lrumemoizer.js.map +1 -1
  115. package/build/esm/integrations/tracing/mongo.js +1 -2
  116. package/build/esm/integrations/tracing/mongo.js.map +1 -1
  117. package/build/esm/integrations/tracing/mongoose.js +1 -2
  118. package/build/esm/integrations/tracing/mongoose.js.map +1 -1
  119. package/build/esm/integrations/tracing/mysql.js +1 -1
  120. package/build/esm/integrations/tracing/mysql.js.map +1 -1
  121. package/build/esm/integrations/tracing/mysql2.js +1 -2
  122. package/build/esm/integrations/tracing/mysql2.js.map +1 -1
  123. package/build/esm/integrations/tracing/postgres.js +1 -2
  124. package/build/esm/integrations/tracing/postgres.js.map +1 -1
  125. package/build/esm/integrations/tracing/postgresjs.js +278 -0
  126. package/build/esm/integrations/tracing/postgresjs.js.map +1 -0
  127. package/build/esm/integrations/tracing/prisma.js +1 -1
  128. package/build/esm/integrations/tracing/prisma.js.map +1 -1
  129. package/build/esm/integrations/tracing/redis.js +1 -1
  130. package/build/esm/integrations/tracing/redis.js.map +1 -1
  131. package/build/esm/integrations/tracing/tedious.js +1 -1
  132. package/build/esm/integrations/tracing/tedious.js.map +1 -1
  133. package/build/esm/integrations/tracing/vercelai/index.js +9 -185
  134. package/build/esm/integrations/tracing/vercelai/index.js.map +1 -1
  135. package/build/esm/package.json +1 -1
  136. package/build/esm/preload.js +1 -1
  137. package/build/esm/preload.js.map +1 -1
  138. package/build/esm/sdk/index.js +22 -202
  139. package/build/esm/sdk/index.js.map +1 -1
  140. package/build/esm/sdk/initOtel.js +3 -21
  141. package/build/esm/sdk/initOtel.js.map +1 -1
  142. package/build/types/index.d.ts +4 -21
  143. package/build/types/index.d.ts.map +1 -1
  144. package/build/types/integrations/featureFlagShims/index.d.ts +5 -0
  145. package/build/types/integrations/featureFlagShims/index.d.ts.map +1 -0
  146. package/build/types/integrations/featureFlagShims/launchDarkly.d.ts +10 -0
  147. package/build/types/integrations/featureFlagShims/launchDarkly.d.ts.map +1 -0
  148. package/build/types/integrations/featureFlagShims/openFeature.d.ts +23 -0
  149. package/build/types/integrations/featureFlagShims/openFeature.d.ts.map +1 -0
  150. package/build/types/integrations/featureFlagShims/statsig.d.ts +6 -0
  151. package/build/types/integrations/featureFlagShims/statsig.d.ts.map +1 -0
  152. package/build/types/integrations/featureFlagShims/unleash.d.ts +6 -0
  153. package/build/types/integrations/featureFlagShims/unleash.d.ts.map +1 -0
  154. package/build/types/integrations/http/index.d.ts +1 -1
  155. package/build/types/integrations/http/index.d.ts.map +1 -1
  156. package/build/types/integrations/node-fetch/index.d.ts.map +1 -1
  157. package/build/types/integrations/tracing/amqplib.d.ts.map +1 -1
  158. package/build/types/integrations/tracing/connect.d.ts.map +1 -1
  159. package/build/types/integrations/tracing/express.d.ts.map +1 -1
  160. package/build/types/integrations/tracing/fastify/index.d.ts +1 -1
  161. package/build/types/integrations/tracing/fastify/index.d.ts.map +1 -1
  162. package/build/types/integrations/tracing/graphql.d.ts.map +1 -1
  163. package/build/types/integrations/tracing/hapi/index.d.ts.map +1 -1
  164. package/build/types/integrations/tracing/index.d.ts.map +1 -1
  165. package/build/types/integrations/tracing/kafka.d.ts.map +1 -1
  166. package/build/types/integrations/tracing/koa.d.ts.map +1 -1
  167. package/build/types/integrations/tracing/mongo.d.ts.map +1 -1
  168. package/build/types/integrations/tracing/mongoose.d.ts.map +1 -1
  169. package/build/types/integrations/tracing/mysql2.d.ts.map +1 -1
  170. package/build/types/integrations/tracing/postgres.d.ts.map +1 -1
  171. package/build/types/integrations/tracing/postgresjs.d.ts +81 -0
  172. package/build/types/integrations/tracing/postgresjs.d.ts.map +1 -0
  173. package/build/types/integrations/tracing/vercelai/index.d.ts +5 -7
  174. package/build/types/integrations/tracing/vercelai/index.d.ts.map +1 -1
  175. package/build/types/sdk/index.d.ts +2 -6
  176. package/build/types/sdk/index.d.ts.map +1 -1
  177. package/build/types/sdk/initOtel.d.ts +1 -1
  178. package/build/types/sdk/initOtel.d.ts.map +1 -1
  179. package/build/types/types.d.ts +1 -1
  180. package/build/types/types.d.ts.map +1 -1
  181. package/build/types-ts3.8/index.d.ts +4 -21
  182. package/build/types-ts3.8/integrations/featureFlagShims/index.d.ts +5 -0
  183. package/build/types-ts3.8/integrations/featureFlagShims/launchDarkly.d.ts +10 -0
  184. package/build/types-ts3.8/integrations/featureFlagShims/openFeature.d.ts +23 -0
  185. package/build/types-ts3.8/integrations/featureFlagShims/statsig.d.ts +6 -0
  186. package/build/types-ts3.8/integrations/featureFlagShims/unleash.d.ts +6 -0
  187. package/build/types-ts3.8/integrations/http/index.d.ts +1 -1
  188. package/build/types-ts3.8/integrations/tracing/fastify/index.d.ts +1 -1
  189. package/build/types-ts3.8/integrations/tracing/postgresjs.d.ts +81 -0
  190. package/build/types-ts3.8/integrations/tracing/vercelai/index.d.ts +5 -7
  191. package/build/types-ts3.8/sdk/index.d.ts +2 -6
  192. package/build/types-ts3.8/sdk/initOtel.d.ts +1 -1
  193. package/build/types-ts3.8/types.d.ts +1 -1
  194. package/package.json +4 -3
  195. package/build/cjs/cron/common.js +0 -56
  196. package/build/cjs/cron/common.js.map +0 -1
  197. package/build/cjs/cron/cron.js +0 -112
  198. package/build/cjs/cron/cron.js.map +0 -1
  199. package/build/cjs/cron/index.js +0 -15
  200. package/build/cjs/cron/index.js.map +0 -1
  201. package/build/cjs/cron/node-cron.js +0 -71
  202. package/build/cjs/cron/node-cron.js.map +0 -1
  203. package/build/cjs/cron/node-schedule.js +0 -65
  204. package/build/cjs/cron/node-schedule.js.map +0 -1
  205. package/build/cjs/integrations/anr/index.js +0 -238
  206. package/build/cjs/integrations/anr/index.js.map +0 -1
  207. package/build/cjs/integrations/childProcess.js +0 -100
  208. package/build/cjs/integrations/childProcess.js.map +0 -1
  209. package/build/cjs/integrations/context.js +0 -457
  210. package/build/cjs/integrations/context.js.map +0 -1
  211. package/build/cjs/integrations/contextlines.js +0 -405
  212. package/build/cjs/integrations/contextlines.js.map +0 -1
  213. package/build/cjs/integrations/http/SentryHttpInstrumentation.js +0 -558
  214. package/build/cjs/integrations/http/SentryHttpInstrumentation.js.map +0 -1
  215. package/build/cjs/integrations/local-variables/common.js +0 -69
  216. package/build/cjs/integrations/local-variables/common.js.map +0 -1
  217. package/build/cjs/integrations/local-variables/index.js +0 -12
  218. package/build/cjs/integrations/local-variables/index.js.map +0 -1
  219. package/build/cjs/integrations/local-variables/local-variables-async.js +0 -143
  220. package/build/cjs/integrations/local-variables/local-variables-async.js.map +0 -1
  221. package/build/cjs/integrations/local-variables/local-variables-sync.js +0 -410
  222. package/build/cjs/integrations/local-variables/local-variables-sync.js.map +0 -1
  223. package/build/cjs/integrations/modules.js +0 -135
  224. package/build/cjs/integrations/modules.js.map +0 -1
  225. package/build/cjs/integrations/node-fetch/SentryNodeFetchInstrumentation.js +0 -291
  226. package/build/cjs/integrations/node-fetch/SentryNodeFetchInstrumentation.js.map +0 -1
  227. package/build/cjs/integrations/onuncaughtexception.js +0 -134
  228. package/build/cjs/integrations/onuncaughtexception.js.map +0 -1
  229. package/build/cjs/integrations/onunhandledrejection.js +0 -89
  230. package/build/cjs/integrations/onunhandledrejection.js.map +0 -1
  231. package/build/cjs/integrations/processSession.js +0 -36
  232. package/build/cjs/integrations/processSession.js.map +0 -1
  233. package/build/cjs/integrations/spotlight.js +0 -101
  234. package/build/cjs/integrations/spotlight.js.map +0 -1
  235. package/build/cjs/integrations/tracing/vercelai/ai_sdk_attributes.js +0 -168
  236. package/build/cjs/integrations/tracing/vercelai/ai_sdk_attributes.js.map +0 -1
  237. package/build/cjs/integrations/winston.js +0 -151
  238. package/build/cjs/integrations/winston.js.map +0 -1
  239. package/build/cjs/logs/capture.js +0 -29
  240. package/build/cjs/logs/capture.js.map +0 -1
  241. package/build/cjs/logs/exports.js +0 -178
  242. package/build/cjs/logs/exports.js.map +0 -1
  243. package/build/cjs/nodeVersion.js +0 -12
  244. package/build/cjs/nodeVersion.js.map +0 -1
  245. package/build/cjs/otel/contextManager.js +0 -16
  246. package/build/cjs/otel/contextManager.js.map +0 -1
  247. package/build/cjs/otel/instrument.js +0 -139
  248. package/build/cjs/otel/instrument.js.map +0 -1
  249. package/build/cjs/proxy/base.js +0 -122
  250. package/build/cjs/proxy/base.js.map +0 -1
  251. package/build/cjs/proxy/index.js +0 -173
  252. package/build/cjs/proxy/index.js.map +0 -1
  253. package/build/cjs/proxy/parse-proxy-response.js +0 -104
  254. package/build/cjs/proxy/parse-proxy-response.js.map +0 -1
  255. package/build/cjs/sdk/api.js +0 -117
  256. package/build/cjs/sdk/api.js.map +0 -1
  257. package/build/cjs/sdk/client.js +0 -156
  258. package/build/cjs/sdk/client.js.map +0 -1
  259. package/build/cjs/transports/http.js +0 -158
  260. package/build/cjs/transports/http.js.map +0 -1
  261. package/build/cjs/utils/addOriginToSpan.js +0 -11
  262. package/build/cjs/utils/addOriginToSpan.js.map +0 -1
  263. package/build/cjs/utils/baggage.js +0 -36
  264. package/build/cjs/utils/baggage.js.map +0 -1
  265. package/build/cjs/utils/commonjs.js +0 -13
  266. package/build/cjs/utils/commonjs.js.map +0 -1
  267. package/build/cjs/utils/createMissingInstrumentationContext.js +0 -11
  268. package/build/cjs/utils/createMissingInstrumentationContext.js.map +0 -1
  269. package/build/cjs/utils/debug.js +0 -23
  270. package/build/cjs/utils/debug.js.map +0 -1
  271. package/build/cjs/utils/ensureIsWrapped.js +0 -41
  272. package/build/cjs/utils/ensureIsWrapped.js.map +0 -1
  273. package/build/cjs/utils/envToBool.js +0 -32
  274. package/build/cjs/utils/envToBool.js.map +0 -1
  275. package/build/cjs/utils/errorhandling.js +0 -42
  276. package/build/cjs/utils/errorhandling.js.map +0 -1
  277. package/build/cjs/utils/getRequestUrl.js +0 -18
  278. package/build/cjs/utils/getRequestUrl.js.map +0 -1
  279. package/build/cjs/utils/module.js +0 -60
  280. package/build/cjs/utils/module.js.map +0 -1
  281. package/build/esm/cron/common.js +0 -54
  282. package/build/esm/cron/common.js.map +0 -1
  283. package/build/esm/cron/cron.js +0 -110
  284. package/build/esm/cron/cron.js.map +0 -1
  285. package/build/esm/cron/index.js +0 -13
  286. package/build/esm/cron/index.js.map +0 -1
  287. package/build/esm/cron/node-cron.js +0 -69
  288. package/build/esm/cron/node-cron.js.map +0 -1
  289. package/build/esm/cron/node-schedule.js +0 -63
  290. package/build/esm/cron/node-schedule.js.map +0 -1
  291. package/build/esm/integrations/anr/index.js +0 -234
  292. package/build/esm/integrations/anr/index.js.map +0 -1
  293. package/build/esm/integrations/anr/worker-script.js +0 -2
  294. package/build/esm/integrations/childProcess.js +0 -98
  295. package/build/esm/integrations/childProcess.js.map +0 -1
  296. package/build/esm/integrations/context.js +0 -451
  297. package/build/esm/integrations/context.js.map +0 -1
  298. package/build/esm/integrations/contextlines.js +0 -399
  299. package/build/esm/integrations/contextlines.js.map +0 -1
  300. package/build/esm/integrations/http/SentryHttpInstrumentation.js +0 -555
  301. package/build/esm/integrations/http/SentryHttpInstrumentation.js.map +0 -1
  302. package/build/esm/integrations/local-variables/common.js +0 -64
  303. package/build/esm/integrations/local-variables/common.js.map +0 -1
  304. package/build/esm/integrations/local-variables/index.js +0 -10
  305. package/build/esm/integrations/local-variables/index.js.map +0 -1
  306. package/build/esm/integrations/local-variables/local-variables-async.js +0 -140
  307. package/build/esm/integrations/local-variables/local-variables-async.js.map +0 -1
  308. package/build/esm/integrations/local-variables/local-variables-sync.js +0 -405
  309. package/build/esm/integrations/local-variables/local-variables-sync.js.map +0 -1
  310. package/build/esm/integrations/local-variables/worker-script.js +0 -2
  311. package/build/esm/integrations/modules.js +0 -133
  312. package/build/esm/integrations/modules.js.map +0 -1
  313. package/build/esm/integrations/node-fetch/SentryNodeFetchInstrumentation.js +0 -289
  314. package/build/esm/integrations/node-fetch/SentryNodeFetchInstrumentation.js.map +0 -1
  315. package/build/esm/integrations/onuncaughtexception.js +0 -131
  316. package/build/esm/integrations/onuncaughtexception.js.map +0 -1
  317. package/build/esm/integrations/onunhandledrejection.js +0 -86
  318. package/build/esm/integrations/onunhandledrejection.js.map +0 -1
  319. package/build/esm/integrations/processSession.js +0 -34
  320. package/build/esm/integrations/processSession.js.map +0 -1
  321. package/build/esm/integrations/spotlight.js +0 -98
  322. package/build/esm/integrations/spotlight.js.map +0 -1
  323. package/build/esm/integrations/tracing/vercelai/ai_sdk_attributes.js +0 -152
  324. package/build/esm/integrations/tracing/vercelai/ai_sdk_attributes.js.map +0 -1
  325. package/build/esm/integrations/winston.js +0 -149
  326. package/build/esm/integrations/winston.js.map +0 -1
  327. package/build/esm/logs/capture.js +0 -27
  328. package/build/esm/logs/capture.js.map +0 -1
  329. package/build/esm/logs/exports.js +0 -170
  330. package/build/esm/logs/exports.js.map +0 -1
  331. package/build/esm/nodeVersion.js +0 -8
  332. package/build/esm/nodeVersion.js.map +0 -1
  333. package/build/esm/otel/contextManager.js +0 -14
  334. package/build/esm/otel/contextManager.js.map +0 -1
  335. package/build/esm/otel/instrument.js +0 -135
  336. package/build/esm/otel/instrument.js.map +0 -1
  337. package/build/esm/proxy/base.js +0 -120
  338. package/build/esm/proxy/base.js.map +0 -1
  339. package/build/esm/proxy/index.js +0 -171
  340. package/build/esm/proxy/index.js.map +0 -1
  341. package/build/esm/proxy/parse-proxy-response.js +0 -102
  342. package/build/esm/proxy/parse-proxy-response.js.map +0 -1
  343. package/build/esm/sdk/api.js +0 -114
  344. package/build/esm/sdk/api.js.map +0 -1
  345. package/build/esm/sdk/client.js +0 -154
  346. package/build/esm/sdk/client.js.map +0 -1
  347. package/build/esm/transports/http.js +0 -156
  348. package/build/esm/transports/http.js.map +0 -1
  349. package/build/esm/utils/addOriginToSpan.js +0 -9
  350. package/build/esm/utils/addOriginToSpan.js.map +0 -1
  351. package/build/esm/utils/baggage.js +0 -34
  352. package/build/esm/utils/baggage.js.map +0 -1
  353. package/build/esm/utils/commonjs.js +0 -11
  354. package/build/esm/utils/commonjs.js.map +0 -1
  355. package/build/esm/utils/createMissingInstrumentationContext.js +0 -9
  356. package/build/esm/utils/createMissingInstrumentationContext.js.map +0 -1
  357. package/build/esm/utils/debug.js +0 -21
  358. package/build/esm/utils/debug.js.map +0 -1
  359. package/build/esm/utils/ensureIsWrapped.js +0 -39
  360. package/build/esm/utils/ensureIsWrapped.js.map +0 -1
  361. package/build/esm/utils/envToBool.js +0 -28
  362. package/build/esm/utils/envToBool.js.map +0 -1
  363. package/build/esm/utils/errorhandling.js +0 -40
  364. package/build/esm/utils/errorhandling.js.map +0 -1
  365. package/build/esm/utils/getRequestUrl.js +0 -16
  366. package/build/esm/utils/getRequestUrl.js.map +0 -1
  367. package/build/esm/utils/module.js +0 -58
  368. package/build/esm/utils/module.js.map +0 -1
  369. package/build/types/cron/common.d.ts +0 -5
  370. package/build/types/cron/common.d.ts.map +0 -1
  371. package/build/types/cron/cron.d.ts +0 -43
  372. package/build/types/cron/cron.d.ts.map +0 -1
  373. package/build/types/cron/index.d.ts +0 -10
  374. package/build/types/cron/index.d.ts.map +0 -1
  375. package/build/types/cron/node-cron.d.ts +0 -27
  376. package/build/types/cron/node-cron.d.ts.map +0 -1
  377. package/build/types/cron/node-schedule.d.ts +0 -19
  378. package/build/types/cron/node-schedule.d.ts.map +0 -1
  379. package/build/types/integrations/anr/common.d.ts +0 -52
  380. package/build/types/integrations/anr/common.d.ts.map +0 -1
  381. package/build/types/integrations/anr/index.d.ts +0 -13
  382. package/build/types/integrations/anr/index.d.ts.map +0 -1
  383. package/build/types/integrations/anr/worker.d.ts +0 -2
  384. package/build/types/integrations/anr/worker.d.ts.map +0 -1
  385. package/build/types/integrations/childProcess.d.ts +0 -20
  386. package/build/types/integrations/childProcess.d.ts.map +0 -1
  387. package/build/types/integrations/context.d.ts +0 -30
  388. package/build/types/integrations/context.d.ts.map +0 -1
  389. package/build/types/integrations/contextlines.d.ts +0 -31
  390. package/build/types/integrations/contextlines.d.ts.map +0 -1
  391. package/build/types/integrations/http/SentryHttpInstrumentation.d.ts +0 -131
  392. package/build/types/integrations/http/SentryHttpInstrumentation.d.ts.map +0 -1
  393. package/build/types/integrations/local-variables/common.d.ts +0 -66
  394. package/build/types/integrations/local-variables/common.d.ts.map +0 -1
  395. package/build/types/integrations/local-variables/index.d.ts +0 -4
  396. package/build/types/integrations/local-variables/index.d.ts.map +0 -1
  397. package/build/types/integrations/local-variables/local-variables-async.d.ts +0 -7
  398. package/build/types/integrations/local-variables/local-variables-async.d.ts.map +0 -1
  399. package/build/types/integrations/local-variables/local-variables-sync.d.ts +0 -34
  400. package/build/types/integrations/local-variables/local-variables-sync.d.ts.map +0 -1
  401. package/build/types/integrations/local-variables/worker.d.ts +0 -2
  402. package/build/types/integrations/local-variables/worker.d.ts.map +0 -1
  403. package/build/types/integrations/modules.d.ts +0 -17
  404. package/build/types/integrations/modules.d.ts.map +0 -1
  405. package/build/types/integrations/node-fetch/SentryNodeFetchInstrumentation.d.ts +0 -56
  406. package/build/types/integrations/node-fetch/SentryNodeFetchInstrumentation.d.ts.map +0 -1
  407. package/build/types/integrations/onuncaughtexception.d.ts +0 -31
  408. package/build/types/integrations/onuncaughtexception.d.ts.map +0 -1
  409. package/build/types/integrations/onunhandledrejection.d.ts +0 -23
  410. package/build/types/integrations/onunhandledrejection.d.ts.map +0 -1
  411. package/build/types/integrations/processSession.d.ts +0 -5
  412. package/build/types/integrations/processSession.d.ts.map +0 -1
  413. package/build/types/integrations/spotlight.d.ts +0 -18
  414. package/build/types/integrations/spotlight.d.ts.map +0 -1
  415. package/build/types/integrations/tracing/vercelai/ai_sdk_attributes.d.ts +0 -669
  416. package/build/types/integrations/tracing/vercelai/ai_sdk_attributes.d.ts.map +0 -1
  417. package/build/types/integrations/winston.d.ts +0 -44
  418. package/build/types/integrations/winston.d.ts.map +0 -1
  419. package/build/types/logs/capture.d.ts +0 -11
  420. package/build/types/logs/capture.d.ts.map +0 -1
  421. package/build/types/logs/exports.d.ts +0 -150
  422. package/build/types/logs/exports.d.ts.map +0 -1
  423. package/build/types/nodeVersion.d.ts +0 -8
  424. package/build/types/nodeVersion.d.ts.map +0 -1
  425. package/build/types/otel/contextManager.d.ts +0 -10
  426. package/build/types/otel/contextManager.d.ts.map +0 -1
  427. package/build/types/otel/instrument.d.ts +0 -23
  428. package/build/types/otel/instrument.d.ts.map +0 -1
  429. package/build/types/proxy/base.d.ts +0 -65
  430. package/build/types/proxy/base.d.ts.map +0 -1
  431. package/build/types/proxy/helpers.d.ts +0 -42
  432. package/build/types/proxy/helpers.d.ts.map +0 -1
  433. package/build/types/proxy/index.d.ts +0 -73
  434. package/build/types/proxy/index.d.ts.map +0 -1
  435. package/build/types/proxy/parse-proxy-response.d.ts +0 -43
  436. package/build/types/proxy/parse-proxy-response.d.ts.map +0 -1
  437. package/build/types/sdk/api.d.ts +0 -8
  438. package/build/types/sdk/api.d.ts.map +0 -1
  439. package/build/types/sdk/client.d.ts +0 -29
  440. package/build/types/sdk/client.d.ts.map +0 -1
  441. package/build/types/sdk/scope.d.ts +0 -7
  442. package/build/types/sdk/scope.d.ts.map +0 -1
  443. package/build/types/transports/http-module.d.ts +0 -31
  444. package/build/types/transports/http-module.d.ts.map +0 -1
  445. package/build/types/transports/http.d.ts +0 -21
  446. package/build/types/transports/http.d.ts.map +0 -1
  447. package/build/types/transports/index.d.ts +0 -3
  448. package/build/types/transports/index.d.ts.map +0 -1
  449. package/build/types/utils/addOriginToSpan.d.ts +0 -5
  450. package/build/types/utils/addOriginToSpan.d.ts.map +0 -1
  451. package/build/types/utils/baggage.d.ts +0 -6
  452. package/build/types/utils/baggage.d.ts.map +0 -1
  453. package/build/types/utils/commonjs.d.ts +0 -3
  454. package/build/types/utils/commonjs.d.ts.map +0 -1
  455. package/build/types/utils/createMissingInstrumentationContext.d.ts +0 -3
  456. package/build/types/utils/createMissingInstrumentationContext.d.ts.map +0 -1
  457. package/build/types/utils/debug.d.ts +0 -5
  458. package/build/types/utils/debug.d.ts.map +0 -1
  459. package/build/types/utils/ensureIsWrapped.d.ts +0 -5
  460. package/build/types/utils/ensureIsWrapped.d.ts.map +0 -1
  461. package/build/types/utils/entry-point.d.ts +0 -24
  462. package/build/types/utils/entry-point.d.ts.map +0 -1
  463. package/build/types/utils/envToBool.d.ts +0 -13
  464. package/build/types/utils/envToBool.d.ts.map +0 -1
  465. package/build/types/utils/errorhandling.d.ts +0 -5
  466. package/build/types/utils/errorhandling.d.ts.map +0 -1
  467. package/build/types/utils/getRequestUrl.d.ts +0 -5
  468. package/build/types/utils/getRequestUrl.d.ts.map +0 -1
  469. package/build/types/utils/module.d.ts +0 -3
  470. package/build/types/utils/module.d.ts.map +0 -1
  471. package/build/types/utils/prepareEvent.d.ts +0 -17
  472. package/build/types/utils/prepareEvent.d.ts.map +0 -1
  473. package/build/types-ts3.8/cron/common.d.ts +0 -5
  474. package/build/types-ts3.8/cron/cron.d.ts +0 -43
  475. package/build/types-ts3.8/cron/index.d.ts +0 -10
  476. package/build/types-ts3.8/cron/node-cron.d.ts +0 -27
  477. package/build/types-ts3.8/cron/node-schedule.d.ts +0 -19
  478. package/build/types-ts3.8/integrations/anr/common.d.ts +0 -52
  479. package/build/types-ts3.8/integrations/anr/index.d.ts +0 -13
  480. package/build/types-ts3.8/integrations/anr/worker.d.ts +0 -2
  481. package/build/types-ts3.8/integrations/childProcess.d.ts +0 -20
  482. package/build/types-ts3.8/integrations/context.d.ts +0 -30
  483. package/build/types-ts3.8/integrations/contextlines.d.ts +0 -31
  484. package/build/types-ts3.8/integrations/http/SentryHttpInstrumentation.d.ts +0 -133
  485. package/build/types-ts3.8/integrations/local-variables/common.d.ts +0 -66
  486. package/build/types-ts3.8/integrations/local-variables/index.d.ts +0 -4
  487. package/build/types-ts3.8/integrations/local-variables/local-variables-async.d.ts +0 -7
  488. package/build/types-ts3.8/integrations/local-variables/local-variables-sync.d.ts +0 -34
  489. package/build/types-ts3.8/integrations/local-variables/worker.d.ts +0 -2
  490. package/build/types-ts3.8/integrations/modules.d.ts +0 -17
  491. package/build/types-ts3.8/integrations/node-fetch/SentryNodeFetchInstrumentation.d.ts +0 -56
  492. package/build/types-ts3.8/integrations/onuncaughtexception.d.ts +0 -31
  493. package/build/types-ts3.8/integrations/onunhandledrejection.d.ts +0 -23
  494. package/build/types-ts3.8/integrations/processSession.d.ts +0 -5
  495. package/build/types-ts3.8/integrations/spotlight.d.ts +0 -18
  496. package/build/types-ts3.8/integrations/tracing/vercelai/ai_sdk_attributes.d.ts +0 -669
  497. package/build/types-ts3.8/integrations/winston.d.ts +0 -44
  498. package/build/types-ts3.8/logs/capture.d.ts +0 -18
  499. package/build/types-ts3.8/logs/exports.d.ts +0 -150
  500. package/build/types-ts3.8/nodeVersion.d.ts +0 -8
  501. package/build/types-ts3.8/otel/contextManager.d.ts +0 -10
  502. package/build/types-ts3.8/otel/instrument.d.ts +0 -23
  503. package/build/types-ts3.8/proxy/base.d.ts +0 -60
  504. package/build/types-ts3.8/proxy/helpers.d.ts +0 -38
  505. package/build/types-ts3.8/proxy/index.d.ts +0 -74
  506. package/build/types-ts3.8/proxy/parse-proxy-response.d.ts +0 -40
  507. package/build/types-ts3.8/sdk/api.d.ts +0 -8
  508. package/build/types-ts3.8/sdk/client.d.ts +0 -32
  509. package/build/types-ts3.8/sdk/scope.d.ts +0 -7
  510. package/build/types-ts3.8/transports/http-module.d.ts +0 -28
  511. package/build/types-ts3.8/transports/http.d.ts +0 -20
  512. package/build/types-ts3.8/transports/index.d.ts +0 -3
  513. package/build/types-ts3.8/utils/addOriginToSpan.d.ts +0 -5
  514. package/build/types-ts3.8/utils/baggage.d.ts +0 -6
  515. package/build/types-ts3.8/utils/commonjs.d.ts +0 -3
  516. package/build/types-ts3.8/utils/createMissingInstrumentationContext.d.ts +0 -3
  517. package/build/types-ts3.8/utils/debug.d.ts +0 -5
  518. package/build/types-ts3.8/utils/ensureIsWrapped.d.ts +0 -5
  519. package/build/types-ts3.8/utils/entry-point.d.ts +0 -24
  520. package/build/types-ts3.8/utils/envToBool.d.ts +0 -13
  521. package/build/types-ts3.8/utils/errorhandling.d.ts +0 -5
  522. package/build/types-ts3.8/utils/getRequestUrl.d.ts +0 -5
  523. package/build/types-ts3.8/utils/module.d.ts +0 -3
  524. package/build/types-ts3.8/utils/prepareEvent.d.ts +0 -17
@@ -14,6 +14,7 @@ import { instrumentMongoose, mongooseIntegration } from './mongoose.js';
14
14
  import { instrumentMysql, mysqlIntegration } from './mysql.js';
15
15
  import { instrumentMysql2, mysql2Integration } from './mysql2.js';
16
16
  import { instrumentPostgres, postgresIntegration } from './postgres.js';
17
+ import { instrumentPostgresJs, postgresJsIntegration } from './postgresjs.js';
17
18
  import { prismaIntegration } from './prisma.js';
18
19
  import { instrumentRedis, redisIntegration } from './redis.js';
19
20
  import { instrumentTedious, tediousIntegration } from './tedious.js';
@@ -43,6 +44,7 @@ function getAutoPerformanceIntegrations() {
43
44
  amqplibIntegration(),
44
45
  lruMemoizerIntegration(),
45
46
  vercelAIIntegration(),
47
+ postgresJsIntegration(),
46
48
  ];
47
49
  }
48
50
 
@@ -74,6 +76,7 @@ function getOpenTelemetryInstrumentationToPreload() {
74
76
  instrumentGenericPool,
75
77
  instrumentAmqplib,
76
78
  instrumentVercelAi,
79
+ instrumentPostgresJs,
77
80
  ];
78
81
  }
79
82
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/integrations/tracing/index.ts"],"sourcesContent":["import type { Integration } from '@sentry/core';\nimport { instrumentOtelHttp } from '../http';\nimport { amqplibIntegration, instrumentAmqplib } from './amqplib';\nimport { connectIntegration, instrumentConnect } from './connect';\nimport { expressIntegration, instrumentExpress, instrumentExpressV5 } from './express';\nimport { fastifyIntegration, instrumentFastify, instrumentFastifyV3 } from './fastify';\nimport { genericPoolIntegration, instrumentGenericPool } from './genericPool';\nimport { graphqlIntegration, instrumentGraphql } from './graphql';\nimport { hapiIntegration, instrumentHapi } from './hapi';\nimport { instrumentKafka, kafkaIntegration } from './kafka';\nimport { instrumentKoa, koaIntegration } from './koa';\nimport { instrumentLruMemoizer, lruMemoizerIntegration } from './lrumemoizer';\nimport { instrumentMongo, mongoIntegration } from './mongo';\nimport { instrumentMongoose, mongooseIntegration } from './mongoose';\nimport { instrumentMysql, mysqlIntegration } from './mysql';\nimport { instrumentMysql2, mysql2Integration } from './mysql2';\nimport { instrumentPostgres, postgresIntegration } from './postgres';\nimport { prismaIntegration } from './prisma';\nimport { instrumentRedis, redisIntegration } from './redis';\nimport { instrumentTedious, tediousIntegration } from './tedious';\nimport { instrumentVercelAi, vercelAIIntegration } from './vercelai';\n\n/**\n * With OTEL, all performance integrations will be added, as OTEL only initializes them when the patched package is actually required.\n */\nexport function getAutoPerformanceIntegrations(): Integration[] {\n return [\n expressIntegration(),\n fastifyIntegration(),\n graphqlIntegration(),\n mongoIntegration(),\n mongooseIntegration(),\n mysqlIntegration(),\n mysql2Integration(),\n redisIntegration(),\n postgresIntegration(),\n prismaIntegration(),\n hapiIntegration(),\n koaIntegration(),\n connectIntegration(),\n tediousIntegration(),\n genericPoolIntegration(),\n kafkaIntegration(),\n amqplibIntegration(),\n lruMemoizerIntegration(),\n vercelAIIntegration(),\n ];\n}\n\n/**\n * Get a list of methods to instrument OTEL, when preload instrumentation.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function getOpenTelemetryInstrumentationToPreload(): (((options?: any) => void) & { id: string })[] {\n return [\n instrumentOtelHttp,\n instrumentExpress,\n instrumentExpressV5,\n instrumentConnect,\n instrumentFastify,\n instrumentFastifyV3,\n instrumentHapi,\n instrumentKafka,\n instrumentKoa,\n instrumentLruMemoizer,\n instrumentMongo,\n instrumentMongoose,\n instrumentMysql,\n instrumentMysql2,\n instrumentPostgres,\n instrumentHapi,\n instrumentGraphql,\n instrumentRedis,\n instrumentTedious,\n instrumentGenericPool,\n instrumentAmqplib,\n instrumentVercelAi,\n ];\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsBA;AACA;AACA;AACO,SAAS,8BAA8B,GAAkB;AAChE,EAAE,OAAO;AACT,IAAI,kBAAkB,EAAE;AACxB,IAAI,kBAAkB,EAAE;AACxB,IAAI,kBAAkB,EAAE;AACxB,IAAI,gBAAgB,EAAE;AACtB,IAAI,mBAAmB,EAAE;AACzB,IAAI,gBAAgB,EAAE;AACtB,IAAI,iBAAiB,EAAE;AACvB,IAAI,gBAAgB,EAAE;AACtB,IAAI,mBAAmB,EAAE;AACzB,IAAI,iBAAiB,EAAE;AACvB,IAAI,eAAe,EAAE;AACrB,IAAI,cAAc,EAAE;AACpB,IAAI,kBAAkB,EAAE;AACxB,IAAI,kBAAkB,EAAE;AACxB,IAAI,sBAAsB,EAAE;AAC5B,IAAI,gBAAgB,EAAE;AACtB,IAAI,kBAAkB,EAAE;AACxB,IAAI,sBAAsB,EAAE;AAC5B,IAAI,mBAAmB,EAAE;AACzB,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACO,SAAS,wCAAwC,GAAmD;AAC3G,EAAE,OAAO;AACT,IAAI,kBAAkB;AACtB,IAAI,iBAAiB;AACrB,IAAI,mBAAmB;AACvB,IAAI,iBAAiB;AACrB,IAAI,iBAAiB;AACrB,IAAI,mBAAmB;AACvB,IAAI,cAAc;AAClB,IAAI,eAAe;AACnB,IAAI,aAAa;AACjB,IAAI,qBAAqB;AACzB,IAAI,eAAe;AACnB,IAAI,kBAAkB;AACtB,IAAI,eAAe;AACnB,IAAI,gBAAgB;AACpB,IAAI,kBAAkB;AACtB,IAAI,cAAc;AAClB,IAAI,iBAAiB;AACrB,IAAI,eAAe;AACnB,IAAI,iBAAiB;AACrB,IAAI,qBAAqB;AACzB,IAAI,iBAAiB;AACrB,IAAI,kBAAkB;AACtB,GAAG;AACH;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/integrations/tracing/index.ts"],"sourcesContent":["import type { Integration } from '@sentry/core';\nimport { instrumentOtelHttp } from '../http';\nimport { amqplibIntegration, instrumentAmqplib } from './amqplib';\nimport { connectIntegration, instrumentConnect } from './connect';\nimport { expressIntegration, instrumentExpress, instrumentExpressV5 } from './express';\nimport { fastifyIntegration, instrumentFastify, instrumentFastifyV3 } from './fastify';\nimport { genericPoolIntegration, instrumentGenericPool } from './genericPool';\nimport { graphqlIntegration, instrumentGraphql } from './graphql';\nimport { hapiIntegration, instrumentHapi } from './hapi';\nimport { instrumentKafka, kafkaIntegration } from './kafka';\nimport { instrumentKoa, koaIntegration } from './koa';\nimport { instrumentLruMemoizer, lruMemoizerIntegration } from './lrumemoizer';\nimport { instrumentMongo, mongoIntegration } from './mongo';\nimport { instrumentMongoose, mongooseIntegration } from './mongoose';\nimport { instrumentMysql, mysqlIntegration } from './mysql';\nimport { instrumentMysql2, mysql2Integration } from './mysql2';\nimport { instrumentPostgres, postgresIntegration } from './postgres';\nimport { instrumentPostgresJs, postgresJsIntegration } from './postgresjs';\nimport { prismaIntegration } from './prisma';\nimport { instrumentRedis, redisIntegration } from './redis';\nimport { instrumentTedious, tediousIntegration } from './tedious';\nimport { instrumentVercelAi, vercelAIIntegration } from './vercelai';\n\n/**\n * With OTEL, all performance integrations will be added, as OTEL only initializes them when the patched package is actually required.\n */\nexport function getAutoPerformanceIntegrations(): Integration[] {\n return [\n expressIntegration(),\n fastifyIntegration(),\n graphqlIntegration(),\n mongoIntegration(),\n mongooseIntegration(),\n mysqlIntegration(),\n mysql2Integration(),\n redisIntegration(),\n postgresIntegration(),\n prismaIntegration(),\n hapiIntegration(),\n koaIntegration(),\n connectIntegration(),\n tediousIntegration(),\n genericPoolIntegration(),\n kafkaIntegration(),\n amqplibIntegration(),\n lruMemoizerIntegration(),\n vercelAIIntegration(),\n postgresJsIntegration(),\n ];\n}\n\n/**\n * Get a list of methods to instrument OTEL, when preload instrumentation.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function getOpenTelemetryInstrumentationToPreload(): (((options?: any) => void) & { id: string })[] {\n return [\n instrumentOtelHttp,\n instrumentExpress,\n instrumentExpressV5,\n instrumentConnect,\n instrumentFastify,\n instrumentFastifyV3,\n instrumentHapi,\n instrumentKafka,\n instrumentKoa,\n instrumentLruMemoizer,\n instrumentMongo,\n instrumentMongoose,\n instrumentMysql,\n instrumentMysql2,\n instrumentPostgres,\n instrumentHapi,\n instrumentGraphql,\n instrumentRedis,\n instrumentTedious,\n instrumentGenericPool,\n instrumentAmqplib,\n instrumentVercelAi,\n instrumentPostgresJs,\n ];\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAuBA;AACA;AACA;AACO,SAAS,8BAA8B,GAAkB;AAChE,EAAE,OAAO;AACT,IAAI,kBAAkB,EAAE;AACxB,IAAI,kBAAkB,EAAE;AACxB,IAAI,kBAAkB,EAAE;AACxB,IAAI,gBAAgB,EAAE;AACtB,IAAI,mBAAmB,EAAE;AACzB,IAAI,gBAAgB,EAAE;AACtB,IAAI,iBAAiB,EAAE;AACvB,IAAI,gBAAgB,EAAE;AACtB,IAAI,mBAAmB,EAAE;AACzB,IAAI,iBAAiB,EAAE;AACvB,IAAI,eAAe,EAAE;AACrB,IAAI,cAAc,EAAE;AACpB,IAAI,kBAAkB,EAAE;AACxB,IAAI,kBAAkB,EAAE;AACxB,IAAI,sBAAsB,EAAE;AAC5B,IAAI,gBAAgB,EAAE;AACtB,IAAI,kBAAkB,EAAE;AACxB,IAAI,sBAAsB,EAAE;AAC5B,IAAI,mBAAmB,EAAE;AACzB,IAAI,qBAAqB,EAAE;AAC3B,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACO,SAAS,wCAAwC,GAAmD;AAC3G,EAAE,OAAO;AACT,IAAI,kBAAkB;AACtB,IAAI,iBAAiB;AACrB,IAAI,mBAAmB;AACvB,IAAI,iBAAiB;AACrB,IAAI,iBAAiB;AACrB,IAAI,mBAAmB;AACvB,IAAI,cAAc;AAClB,IAAI,eAAe;AACnB,IAAI,aAAa;AACjB,IAAI,qBAAqB;AACzB,IAAI,eAAe;AACnB,IAAI,kBAAkB;AACtB,IAAI,eAAe;AACnB,IAAI,gBAAgB;AACpB,IAAI,kBAAkB;AACtB,IAAI,cAAc;AAClB,IAAI,iBAAiB;AACrB,IAAI,eAAe;AACnB,IAAI,iBAAiB;AACrB,IAAI,qBAAqB;AACzB,IAAI,iBAAiB;AACrB,IAAI,kBAAkB;AACtB,IAAI,oBAAoB;AACxB,GAAG;AACH;;;;"}
@@ -1,7 +1,6 @@
1
1
  import { KafkaJsInstrumentation } from '@opentelemetry/instrumentation-kafkajs';
2
2
  import { defineIntegration } from '@sentry/core';
3
- import { generateInstrumentOnce } from '../../otel/instrument.js';
4
- import { addOriginToSpan } from '../../utils/addOriginToSpan.js';
3
+ import { generateInstrumentOnce, addOriginToSpan } from '@sentry/node-core';
5
4
 
6
5
  const INTEGRATION_NAME = 'Kafka';
7
6
 
@@ -1 +1 @@
1
- {"version":3,"file":"kafka.js","sources":["../../../../src/integrations/tracing/kafka.ts"],"sourcesContent":["import { KafkaJsInstrumentation } from '@opentelemetry/instrumentation-kafkajs';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { generateInstrumentOnce } from '../../otel/instrument';\nimport { addOriginToSpan } from '../../utils/addOriginToSpan';\n\nconst INTEGRATION_NAME = 'Kafka';\n\nexport const instrumentKafka = generateInstrumentOnce(\n INTEGRATION_NAME,\n () =>\n new KafkaJsInstrumentation({\n consumerHook(span) {\n addOriginToSpan(span, 'auto.kafkajs.otel.consumer');\n },\n producerHook(span) {\n addOriginToSpan(span, 'auto.kafkajs.otel.producer');\n },\n }),\n);\n\nconst _kafkaIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentKafka();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [kafkajs](https://www.npmjs.com/package/kafkajs) library.\n *\n * For more information, see the [`kafkaIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/kafka/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.kafkaIntegration()],\n * });\n */\nexport const kafkaIntegration = defineIntegration(_kafkaIntegration);\n"],"names":[],"mappings":";;;;;AAMA,MAAM,gBAAA,GAAmB,OAAO;;AAEzB,MAAM,eAAgB,GAAE,sBAAsB;AACrD,EAAE,gBAAgB;AAClB,EAAE;AACF,IAAI,IAAI,sBAAsB,CAAC;AAC/B,MAAM,YAAY,CAAC,IAAI,EAAE;AACzB,QAAQ,eAAe,CAAC,IAAI,EAAE,4BAA4B,CAAC;AAC3D,OAAO;AACP,MAAM,YAAY,CAAC,IAAI,EAAE;AACzB,QAAQ,eAAe,CAAC,IAAI,EAAE,4BAA4B,CAAC;AAC3D,OAAO;AACP,KAAK,CAAC;AACN;;AAEA,MAAM,iBAAkB,IAAG,MAAM;AACjC,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,GAAG;AAChB,MAAM,eAAe,EAAE;AACvB,KAAK;AACL,GAAG;AACH,CAAC,CAAE;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,gBAAiB,GAAE,iBAAiB,CAAC,iBAAiB;;;;"}
1
+ {"version":3,"file":"kafka.js","sources":["../../../../src/integrations/tracing/kafka.ts"],"sourcesContent":["import { KafkaJsInstrumentation } from '@opentelemetry/instrumentation-kafkajs';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { addOriginToSpan, generateInstrumentOnce } from '@sentry/node-core';\n\nconst INTEGRATION_NAME = 'Kafka';\n\nexport const instrumentKafka = generateInstrumentOnce(\n INTEGRATION_NAME,\n () =>\n new KafkaJsInstrumentation({\n consumerHook(span) {\n addOriginToSpan(span, 'auto.kafkajs.otel.consumer');\n },\n producerHook(span) {\n addOriginToSpan(span, 'auto.kafkajs.otel.producer');\n },\n }),\n);\n\nconst _kafkaIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentKafka();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [kafkajs](https://www.npmjs.com/package/kafkajs) library.\n *\n * For more information, see the [`kafkaIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/kafka/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.kafkaIntegration()],\n * });\n */\nexport const kafkaIntegration = defineIntegration(_kafkaIntegration);\n"],"names":[],"mappings":";;;;AAKA,MAAM,gBAAA,GAAmB,OAAO;;AAEzB,MAAM,eAAgB,GAAE,sBAAsB;AACrD,EAAE,gBAAgB;AAClB,EAAE;AACF,IAAI,IAAI,sBAAsB,CAAC;AAC/B,MAAM,YAAY,CAAC,IAAI,EAAE;AACzB,QAAQ,eAAe,CAAC,IAAI,EAAE,4BAA4B,CAAC;AAC3D,OAAO;AACP,MAAM,YAAY,CAAC,IAAI,EAAE;AACzB,QAAQ,eAAe,CAAC,IAAI,EAAE,4BAA4B,CAAC;AAC3D,OAAO;AACP,KAAK,CAAC;AACN;;AAEA,MAAM,iBAAkB,IAAG,MAAM;AACjC,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,GAAG;AAChB,MAAM,eAAe,EAAE;AACvB,KAAK;AACL,GAAG;AACH,CAAC,CAAE;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,gBAAiB,GAAE,iBAAiB,CAAC,iBAAiB;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { KnexInstrumentation } from '@opentelemetry/instrumentation-knex';
2
2
  import { defineIntegration, spanToJSON, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/core';
3
- import { generateInstrumentOnce, instrumentWhenWrapped } from '../../otel/instrument.js';
3
+ import { generateInstrumentOnce, instrumentWhenWrapped } from '@sentry/node-core';
4
4
 
5
5
  const INTEGRATION_NAME = 'Knex';
6
6
 
@@ -1 +1 @@
1
- {"version":3,"file":"knex.js","sources":["../../../../src/integrations/tracing/knex.ts"],"sourcesContent":["import { KnexInstrumentation } from '@opentelemetry/instrumentation-knex';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, spanToJSON } from '@sentry/core';\nimport { generateInstrumentOnce, instrumentWhenWrapped } from '../../otel/instrument';\n\nconst INTEGRATION_NAME = 'Knex';\n\nexport const instrumentKnex = generateInstrumentOnce(\n INTEGRATION_NAME,\n () => new KnexInstrumentation({ requireParentSpan: true }),\n);\n\nconst _knexIntegration = (() => {\n let instrumentationWrappedCallback: undefined | ((callback: () => void) => void);\n\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n const instrumentation = instrumentKnex();\n instrumentationWrappedCallback = instrumentWhenWrapped(instrumentation);\n },\n\n setup(client) {\n instrumentationWrappedCallback?.(() =>\n client.on('spanStart', span => {\n const { data } = spanToJSON(span);\n // knex.version is always set in the span data\n // https://github.com/open-telemetry/opentelemetry-js-contrib/blob/0309caeafc44ac9cb13a3345b790b01b76d0497d/plugins/node/opentelemetry-instrumentation-knex/src/instrumentation.ts#L138\n if ('knex.version' in data) {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, 'auto.db.otel.knex');\n }\n }),\n );\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Knex integration\n *\n * Capture tracing data for [Knex](https://knexjs.org/).\n *\n * @example\n * ```javascript\n * import * as Sentry from '@sentry/node';\n *\n * Sentry.init({\n * integrations: [Sentry.knexIntegration()],\n * });\n * ```\n */\nexport const knexIntegration = defineIntegration(_knexIntegration);\n"],"names":[],"mappings":";;;;AAKA,MAAM,gBAAA,GAAmB,MAAM;;AAExB,MAAM,cAAe,GAAE,sBAAsB;AACpD,EAAE,gBAAgB;AAClB,EAAE,MAAM,IAAI,mBAAmB,CAAC,EAAE,iBAAiB,EAAE,IAAK,EAAC,CAAC;AAC5D;;AAEA,MAAM,gBAAiB,IAAG,MAAM;AAChC,EAAE,IAAI,8BAA8B;;AAEpC,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,GAAG;AAChB,MAAM,MAAM,eAAA,GAAkB,cAAc,EAAE;AAC9C,MAAM,8BAA+B,GAAE,qBAAqB,CAAC,eAAe,CAAC;AAC7E,KAAK;;AAEL,IAAI,KAAK,CAAC,MAAM,EAAE;AAClB,MAAM,8BAA8B,GAAG;AACvC,QAAQ,MAAM,CAAC,EAAE,CAAC,WAAW,EAAE,QAAQ;AACvC,UAAU,MAAM,EAAE,IAAK,EAAA,GAAI,UAAU,CAAC,IAAI,CAAC;AAC3C;AACA;AACA,UAAU,IAAI,cAAe,IAAG,IAAI,EAAE;AACtC,YAAY,IAAI,CAAC,YAAY,CAAC,gCAAgC,EAAE,mBAAmB,CAAC;AACpF;AACA,SAAS,CAAC;AACV,OAAO;AACP,KAAK;AACL,GAAG;AACH,CAAC,CAAE;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,eAAgB,GAAE,iBAAiB,CAAC,gBAAgB;;;;"}
1
+ {"version":3,"file":"knex.js","sources":["../../../../src/integrations/tracing/knex.ts"],"sourcesContent":["import { KnexInstrumentation } from '@opentelemetry/instrumentation-knex';\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 INTEGRATION_NAME = 'Knex';\n\nexport const instrumentKnex = generateInstrumentOnce(\n INTEGRATION_NAME,\n () => new KnexInstrumentation({ requireParentSpan: true }),\n);\n\nconst _knexIntegration = (() => {\n let instrumentationWrappedCallback: undefined | ((callback: () => void) => void);\n\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n const instrumentation = instrumentKnex();\n instrumentationWrappedCallback = instrumentWhenWrapped(instrumentation);\n },\n\n setup(client) {\n instrumentationWrappedCallback?.(() =>\n client.on('spanStart', span => {\n const { data } = spanToJSON(span);\n // knex.version is always set in the span data\n // https://github.com/open-telemetry/opentelemetry-js-contrib/blob/0309caeafc44ac9cb13a3345b790b01b76d0497d/plugins/node/opentelemetry-instrumentation-knex/src/instrumentation.ts#L138\n if ('knex.version' in data) {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, 'auto.db.otel.knex');\n }\n }),\n );\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Knex integration\n *\n * Capture tracing data for [Knex](https://knexjs.org/).\n *\n * @example\n * ```javascript\n * import * as Sentry from '@sentry/node';\n *\n * Sentry.init({\n * integrations: [Sentry.knexIntegration()],\n * });\n * ```\n */\nexport const knexIntegration = defineIntegration(_knexIntegration);\n"],"names":[],"mappings":";;;;AAKA,MAAM,gBAAA,GAAmB,MAAM;;AAExB,MAAM,cAAe,GAAE,sBAAsB;AACpD,EAAE,gBAAgB;AAClB,EAAE,MAAM,IAAI,mBAAmB,CAAC,EAAE,iBAAiB,EAAE,IAAK,EAAC,CAAC;AAC5D;;AAEA,MAAM,gBAAiB,IAAG,MAAM;AAChC,EAAE,IAAI,8BAA8B;;AAEpC,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,GAAG;AAChB,MAAM,MAAM,eAAA,GAAkB,cAAc,EAAE;AAC9C,MAAM,8BAA+B,GAAE,qBAAqB,CAAC,eAAe,CAAC;AAC7E,KAAK;;AAEL,IAAI,KAAK,CAAC,MAAM,EAAE;AAClB,MAAM,8BAA8B,GAAG;AACvC,QAAQ,MAAM,CAAC,EAAE,CAAC,WAAW,EAAE,QAAQ;AACvC,UAAU,MAAM,EAAE,IAAK,EAAA,GAAI,UAAU,CAAC,IAAI,CAAC;AAC3C;AACA;AACA,UAAU,IAAI,cAAe,IAAG,IAAI,EAAE;AACtC,YAAY,IAAI,CAAC,YAAY,CAAC,gCAAgC,EAAE,mBAAmB,CAAC;AACpF;AACA,SAAS,CAAC;AACV,OAAO;AACP,KAAK;AACL,GAAG;AACH,CAAC,CAAE;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,eAAgB,GAAE,iBAAiB,CAAC,gBAAgB;;;;"}
@@ -1,10 +1,8 @@
1
1
  import { KoaInstrumentation } from '@opentelemetry/instrumentation-koa';
2
2
  import { ATTR_HTTP_ROUTE } from '@opentelemetry/semantic-conventions';
3
- import { defineIntegration, captureException, spanToJSON, SEMANTIC_ATTRIBUTE_SENTRY_OP, getIsolationScope, getDefaultIsolationScope, logger } from '@sentry/core';
3
+ import { spanToJSON, SEMANTIC_ATTRIBUTE_SENTRY_OP, getIsolationScope, getDefaultIsolationScope, logger, defineIntegration, captureException } from '@sentry/core';
4
+ import { generateInstrumentOnce, addOriginToSpan, ensureIsWrapped } from '@sentry/node-core';
4
5
  import { DEBUG_BUILD } from '../../debug-build.js';
5
- import { generateInstrumentOnce } from '../../otel/instrument.js';
6
- import { addOriginToSpan } from '../../utils/addOriginToSpan.js';
7
- import { ensureIsWrapped } from '../../utils/ensureIsWrapped.js';
8
6
 
9
7
  const INTEGRATION_NAME = 'Koa';
10
8
 
@@ -1 +1 @@
1
- {"version":3,"file":"koa.js","sources":["../../../../src/integrations/tracing/koa.ts"],"sourcesContent":["import type { KoaInstrumentationConfig, KoaLayerType } from '@opentelemetry/instrumentation-koa';\nimport { KoaInstrumentation } from '@opentelemetry/instrumentation-koa';\nimport { ATTR_HTTP_ROUTE } from '@opentelemetry/semantic-conventions';\nimport type { IntegrationFn } from '@sentry/core';\nimport {\n captureException,\n defineIntegration,\n getDefaultIsolationScope,\n getIsolationScope,\n logger,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n spanToJSON,\n} from '@sentry/core';\nimport { DEBUG_BUILD } from '../../debug-build';\nimport { generateInstrumentOnce } from '../../otel/instrument';\nimport { addOriginToSpan } from '../../utils/addOriginToSpan';\nimport { ensureIsWrapped } from '../../utils/ensureIsWrapped';\n\ninterface KoaOptions {\n /**\n * Ignore layers of specified types\n */\n ignoreLayersType?: Array<'middleware' | 'router'>;\n}\n\nconst INTEGRATION_NAME = 'Koa';\n\nexport const instrumentKoa = generateInstrumentOnce(\n INTEGRATION_NAME,\n KoaInstrumentation,\n (options: KoaOptions = {}) => {\n return {\n ignoreLayersType: options.ignoreLayersType as KoaLayerType[],\n requestHook(span, info) {\n addOriginToSpan(span, 'auto.http.otel.koa');\n\n const attributes = spanToJSON(span).data;\n\n // this is one of: middleware, router\n const type = attributes['koa.type'];\n if (type) {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, `${type}.koa`);\n }\n\n // Also update the name\n const name = attributes['koa.name'];\n if (typeof name === 'string') {\n // Somehow, name is sometimes `''` for middleware spans\n // See: https://github.com/open-telemetry/opentelemetry-js-contrib/issues/2220\n span.updateName(name || '< unknown >');\n }\n\n if (getIsolationScope() === getDefaultIsolationScope()) {\n DEBUG_BUILD && logger.warn('Isolation scope is default isolation scope - skipping setting transactionName');\n return;\n }\n const route = attributes[ATTR_HTTP_ROUTE];\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const method = info.context?.request?.method?.toUpperCase() || 'GET';\n if (route) {\n getIsolationScope().setTransactionName(`${method} ${route}`);\n }\n },\n } satisfies KoaInstrumentationConfig;\n },\n);\n\nconst _koaIntegration = ((options: KoaOptions = {}) => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentKoa(options);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for [Koa](https://koajs.com/).\n *\n * If you also want to capture errors, you need to call `setupKoaErrorHandler(app)` after you set up your Koa server.\n *\n * For more information, see the [koa documentation](https://docs.sentry.io/platforms/javascript/guides/koa/).\n *\n * @param {KoaOptions} options Configuration options for the Koa integration.\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.koaIntegration()],\n * })\n * ```\n *\n * @example\n * ```javascript\n * // To ignore middleware spans\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [\n * Sentry.koaIntegration({\n * ignoreLayersType: ['middleware']\n * })\n * ],\n * })\n * ```\n */\nexport const koaIntegration = defineIntegration(_koaIntegration);\n\n/**\n * Add an Koa error handler to capture errors to Sentry.\n *\n * The error handler must be before any other middleware and after all controllers.\n *\n * @param app The Express instances\n * @param options {ExpressHandlerOptions} Configuration options for the handler\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n * const Koa = require(\"koa\");\n *\n * const app = new Koa();\n *\n * Sentry.setupKoaErrorHandler(app);\n *\n * // Add your routes, etc.\n *\n * app.listen(3000);\n * ```\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const setupKoaErrorHandler = (app: { use: (arg0: (ctx: any, next: any) => Promise<void>) => void }): void => {\n app.use(async (ctx, next) => {\n try {\n await next();\n } catch (error) {\n captureException(error);\n throw error;\n }\n });\n\n ensureIsWrapped(app.use, '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KAAA;AACA,GAAA;AACA;;AAEA,MAAA,eAAA,IAAA,CAAA,OAAA,GAAA,EAAA,KAAA;AACA,EAAA,OAAA;AACA,IAAA,IAAA,EAAA,gBAAA;AACA,IAAA,SAAA,GAAA;AACA,MAAA,aAAA,CAAA,OAAA,CAAA;AACA,KAAA;AACA,GAAA;AACA,CAAA,CAAA;;AAEA;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,MAAA,cAAA,GAAA,iBAAA,CAAA,eAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,oBAAA,GAAA,CAAA,GAAA,KAAA;AACA,EAAA,GAAA,CAAA,GAAA,CAAA,OAAA,GAAA,EAAA,IAAA,KAAA;AACA,IAAA,IAAA;AACA,MAAA,MAAA,IAAA,EAAA;AACA,KAAA,CAAA,OAAA,KAAA,EAAA;AACA,MAAA,gBAAA,CAAA,KAAA,CAAA;AACA,MAAA,MAAA,KAAA;AACA;AACA,GAAA,CAAA;;AAEA,EAAA,eAAA,CAAA,GAAA,CAAA,GAAA,EAAA,KAAA,CAAA;AACA;;;;"}
1
+ {"version":3,"file":"koa.js","sources":["../../../../src/integrations/tracing/koa.ts"],"sourcesContent":["import type { KoaInstrumentationConfig, KoaLayerType } from '@opentelemetry/instrumentation-koa';\nimport { KoaInstrumentation } from '@opentelemetry/instrumentation-koa';\nimport { ATTR_HTTP_ROUTE } from '@opentelemetry/semantic-conventions';\nimport type { IntegrationFn } from '@sentry/core';\nimport {\n captureException,\n defineIntegration,\n getDefaultIsolationScope,\n getIsolationScope,\n logger,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n spanToJSON,\n} from '@sentry/core';\nimport { addOriginToSpan, ensureIsWrapped, generateInstrumentOnce } from '@sentry/node-core';\nimport { DEBUG_BUILD } from '../../debug-build';\n\ninterface KoaOptions {\n /**\n * Ignore layers of specified types\n */\n ignoreLayersType?: Array<'middleware' | 'router'>;\n}\n\nconst INTEGRATION_NAME = 'Koa';\n\nexport const instrumentKoa = generateInstrumentOnce(\n INTEGRATION_NAME,\n KoaInstrumentation,\n (options: KoaOptions = {}) => {\n return {\n ignoreLayersType: options.ignoreLayersType as KoaLayerType[],\n requestHook(span, info) {\n addOriginToSpan(span, 'auto.http.otel.koa');\n\n const attributes = spanToJSON(span).data;\n\n // this is one of: middleware, router\n const type = attributes['koa.type'];\n if (type) {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, `${type}.koa`);\n }\n\n // Also update the name\n const name = attributes['koa.name'];\n if (typeof name === 'string') {\n // Somehow, name is sometimes `''` for middleware spans\n // See: https://github.com/open-telemetry/opentelemetry-js-contrib/issues/2220\n span.updateName(name || '< unknown >');\n }\n\n if (getIsolationScope() === getDefaultIsolationScope()) {\n DEBUG_BUILD && logger.warn('Isolation scope is default isolation scope - skipping setting transactionName');\n return;\n }\n const route = attributes[ATTR_HTTP_ROUTE];\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const method = info.context?.request?.method?.toUpperCase() || 'GET';\n if (route) {\n getIsolationScope().setTransactionName(`${method} ${route}`);\n }\n },\n } satisfies KoaInstrumentationConfig;\n },\n);\n\nconst _koaIntegration = ((options: KoaOptions = {}) => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentKoa(options);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for [Koa](https://koajs.com/).\n *\n * If you also want to capture errors, you need to call `setupKoaErrorHandler(app)` after you set up your Koa server.\n *\n * For more information, see the [koa documentation](https://docs.sentry.io/platforms/javascript/guides/koa/).\n *\n * @param {KoaOptions} options Configuration options for the Koa integration.\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.koaIntegration()],\n * })\n * ```\n *\n * @example\n * ```javascript\n * // To ignore middleware spans\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [\n * Sentry.koaIntegration({\n * ignoreLayersType: ['middleware']\n * })\n * ],\n * })\n * ```\n */\nexport const koaIntegration = defineIntegration(_koaIntegration);\n\n/**\n * Add an Koa error handler to capture errors to Sentry.\n *\n * The error handler must be before any other middleware and after all controllers.\n *\n * @param app The Express instances\n * @param options {ExpressHandlerOptions} Configuration options for the handler\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n * const Koa = require(\"koa\");\n *\n * const app = new Koa();\n *\n * Sentry.setupKoaErrorHandler(app);\n *\n * // Add your routes, etc.\n *\n * app.listen(3000);\n * ```\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const setupKoaErrorHandler = (app: { use: (arg0: (ctx: any, next: any) => Promise<void>) => void }): void => {\n app.use(async (ctx, next) => {\n try {\n await next();\n } catch (error) {\n captureException(error);\n throw error;\n }\n });\n\n ensureIsWrapped(app.use, 'koa');\n};\n"],"names":[],"mappings":";;;;;;AAuBA,MAAM,gBAAA,GAAmB,KAAK;;AAEvB,MAAM,aAAc,GAAE,sBAAsB;AACnD,EAAE,gBAAgB;AAClB,EAAE,kBAAkB;AACpB,EAAE,CAAC,OAAO,GAAe,EAAE,KAAK;AAChC,IAAI,OAAO;AACX,MAAM,gBAAgB,EAAE,OAAO,CAAC,gBAAiB;AACjD,MAAM,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE;AAC9B,QAAQ,eAAe,CAAC,IAAI,EAAE,oBAAoB,CAAC;;AAEnD,QAAQ,MAAM,aAAa,UAAU,CAAC,IAAI,CAAC,CAAC,IAAI;;AAEhD;AACA,QAAQ,MAAM,IAAK,GAAE,UAAU,CAAC,UAAU,CAAC;AAC3C,QAAQ,IAAI,IAAI,EAAE;AAClB,UAAU,IAAI,CAAC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AACA,MAAA,oBAAA,GAAA,CAAA,GAAA,KAAA;AACA,EAAA,GAAA,CAAA,GAAA,CAAA,OAAA,GAAA,EAAA,IAAA,KAAA;AACA,IAAA,IAAA;AACA,MAAA,MAAA,IAAA,EAAA;AACA,KAAA,CAAA,OAAA,KAAA,EAAA;AACA,MAAA,gBAAA,CAAA,KAAA,CAAA;AACA,MAAA,MAAA,KAAA;AACA;AACA,GAAA,CAAA;;AAEA,EAAA,eAAA,CAAA,GAAA,CAAA,GAAA,EAAA,KAAA,CAAA;AACA;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { LruMemoizerInstrumentation } from '@opentelemetry/instrumentation-lru-memoizer';
2
2
  import { defineIntegration } from '@sentry/core';
3
- import { generateInstrumentOnce } from '../../otel/instrument.js';
3
+ import { generateInstrumentOnce } from '@sentry/node-core';
4
4
 
5
5
  const INTEGRATION_NAME = 'LruMemoizer';
6
6
 
@@ -1 +1 @@
1
- {"version":3,"file":"lrumemoizer.js","sources":["../../../../src/integrations/tracing/lrumemoizer.ts"],"sourcesContent":["import { LruMemoizerInstrumentation } from '@opentelemetry/instrumentation-lru-memoizer';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { generateInstrumentOnce } from '../../otel/instrument';\n\nconst INTEGRATION_NAME = 'LruMemoizer';\n\nexport const instrumentLruMemoizer = generateInstrumentOnce(INTEGRATION_NAME, () => new LruMemoizerInstrumentation());\n\nconst _lruMemoizerIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentLruMemoizer();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [lru-memoizer](https://www.npmjs.com/package/lru-memoizer) library.\n *\n * For more information, see the [`lruMemoizerIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/lrumemoizer/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.lruMemoizerIntegration()],\n * });\n */\nexport const lruMemoizerIntegration = defineIntegration(_lruMemoizerIntegration);\n"],"names":[],"mappings":";;;;AAKA,MAAM,gBAAA,GAAmB,aAAa;;AAEzB,MAAA,qBAAA,GAAwB,sBAAsB,CAAC,gBAAgB,EAAE,MAAM,IAAI,0BAA0B,EAAE;;AAEpH,MAAM,uBAAwB,IAAG,MAAM;AACvC,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,GAAG;AAChB,MAAM,qBAAqB,EAAE;AAC7B,KAAK;AACL,GAAG;AACH,CAAC,CAAE;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,sBAAuB,GAAE,iBAAiB,CAAC,uBAAuB;;;;"}
1
+ {"version":3,"file":"lrumemoizer.js","sources":["../../../../src/integrations/tracing/lrumemoizer.ts"],"sourcesContent":["import { LruMemoizerInstrumentation } from '@opentelemetry/instrumentation-lru-memoizer';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { generateInstrumentOnce } from '@sentry/node-core';\n\nconst INTEGRATION_NAME = 'LruMemoizer';\n\nexport const instrumentLruMemoizer = generateInstrumentOnce(INTEGRATION_NAME, () => new LruMemoizerInstrumentation());\n\nconst _lruMemoizerIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentLruMemoizer();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [lru-memoizer](https://www.npmjs.com/package/lru-memoizer) library.\n *\n * For more information, see the [`lruMemoizerIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/lrumemoizer/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.lruMemoizerIntegration()],\n * });\n */\nexport const lruMemoizerIntegration = defineIntegration(_lruMemoizerIntegration);\n"],"names":[],"mappings":";;;;AAKA,MAAM,gBAAA,GAAmB,aAAa;;AAEzB,MAAA,qBAAA,GAAwB,sBAAsB,CAAC,gBAAgB,EAAE,MAAM,IAAI,0BAA0B,EAAE;;AAEpH,MAAM,uBAAwB,IAAG,MAAM;AACvC,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,GAAG;AAChB,MAAM,qBAAqB,EAAE;AAC7B,KAAK;AACL,GAAG;AACH,CAAC,CAAE;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,sBAAuB,GAAE,iBAAiB,CAAC,uBAAuB;;;;"}
@@ -1,7 +1,6 @@
1
1
  import { MongoDBInstrumentation } from '@opentelemetry/instrumentation-mongodb';
2
2
  import { defineIntegration } from '@sentry/core';
3
- import { generateInstrumentOnce } from '../../otel/instrument.js';
4
- import { addOriginToSpan } from '../../utils/addOriginToSpan.js';
3
+ import { generateInstrumentOnce, addOriginToSpan } from '@sentry/node-core';
5
4
 
6
5
  const INTEGRATION_NAME = 'Mongo';
7
6
 
@@ -1 +1 @@
1
- {"version":3,"file":"mongo.js","sources":["../../../../src/integrations/tracing/mongo.ts"],"sourcesContent":["import { MongoDBInstrumentation } from '@opentelemetry/instrumentation-mongodb';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { generateInstrumentOnce } from '../../otel/instrument';\nimport { addOriginToSpan } from '../../utils/addOriginToSpan';\n\nconst INTEGRATION_NAME = 'Mongo';\n\nexport const instrumentMongo = generateInstrumentOnce(\n INTEGRATION_NAME,\n () =>\n new MongoDBInstrumentation({\n dbStatementSerializer: _defaultDbStatementSerializer,\n responseHook(span) {\n addOriginToSpan(span, 'auto.db.otel.mongo');\n },\n }),\n);\n\n/**\n * Replaces values in document with '?', hiding PII and helping grouping.\n */\nexport function _defaultDbStatementSerializer(commandObj: Record<string, unknown>): string {\n const resultObj = _scrubStatement(commandObj);\n return JSON.stringify(resultObj);\n}\n\nfunction _scrubStatement(value: unknown): unknown {\n if (Array.isArray(value)) {\n return value.map(element => _scrubStatement(element));\n }\n\n if (isCommandObj(value)) {\n const initial: Record<string, unknown> = {};\n return Object.entries(value)\n .map(([key, element]) => [key, _scrubStatement(element)])\n .reduce((prev, current) => {\n if (isCommandEntry(current)) {\n prev[current[0]] = current[1];\n }\n return prev;\n }, initial);\n }\n\n // A value like string or number, possible contains PII, scrub it\n return '?';\n}\n\nfunction isCommandObj(value: Record<string, unknown> | unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !isBuffer(value);\n}\n\nfunction isBuffer(value: unknown): boolean {\n let isBuffer = false;\n if (typeof Buffer !== 'undefined') {\n isBuffer = Buffer.isBuffer(value);\n }\n return isBuffer;\n}\n\nfunction isCommandEntry(value: [string, unknown] | unknown): value is [string, unknown] {\n return Array.isArray(value);\n}\n\nconst _mongoIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentMongo();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [mongodb](https://www.npmjs.com/package/mongodb) library.\n *\n * For more information, see the [`mongoIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/mongo/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.mongoIntegration()],\n * });\n * ```\n */\nexport const mongoIntegration = defineIntegration(_mongoIntegration);\n"],"names":[],"mappings":";;;;;AAMA,MAAM,gBAAA,GAAmB,OAAO;;AAEzB,MAAM,eAAgB,GAAE,sBAAsB;AACrD,EAAE,gBAAgB;AAClB,EAAE;AACF,IAAI,IAAI,sBAAsB,CAAC;AAC/B,MAAM,qBAAqB,EAAE,6BAA6B;AAC1D,MAAM,YAAY,CAAC,IAAI,EAAE;AACzB,QAAQ,eAAe,CAAC,IAAI,EAAE,oBAAoB,CAAC;AACnD,OAAO;AACP,KAAK,CAAC;AACN;;AAEA;AAC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EAAE,OAAO,QAAQ;AACjB;;AAEA,SAAS,cAAc,CAAC,KAAK,EAA2D;AACxF,EAAE,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;AAC7B;;AAEA,MAAM,iBAAkB,IAAG,MAAM;AACjC,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,GAAG;AAChB,MAAM,eAAe,EAAE;AACvB,KAAK;AACL,GAAG;AACH,CAAC,CAAE;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,gBAAiB,GAAE,iBAAiB,CAAC,iBAAiB;;;;"}
1
+ {"version":3,"file":"mongo.js","sources":["../../../../src/integrations/tracing/mongo.ts"],"sourcesContent":["import { MongoDBInstrumentation } from '@opentelemetry/instrumentation-mongodb';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { addOriginToSpan, generateInstrumentOnce } from '@sentry/node-core';\n\nconst INTEGRATION_NAME = 'Mongo';\n\nexport const instrumentMongo = generateInstrumentOnce(\n INTEGRATION_NAME,\n () =>\n new MongoDBInstrumentation({\n dbStatementSerializer: _defaultDbStatementSerializer,\n responseHook(span) {\n addOriginToSpan(span, 'auto.db.otel.mongo');\n },\n }),\n);\n\n/**\n * Replaces values in document with '?', hiding PII and helping grouping.\n */\nexport function _defaultDbStatementSerializer(commandObj: Record<string, unknown>): string {\n const resultObj = _scrubStatement(commandObj);\n return JSON.stringify(resultObj);\n}\n\nfunction _scrubStatement(value: unknown): unknown {\n if (Array.isArray(value)) {\n return value.map(element => _scrubStatement(element));\n }\n\n if (isCommandObj(value)) {\n const initial: Record<string, unknown> = {};\n return Object.entries(value)\n .map(([key, element]) => [key, _scrubStatement(element)])\n .reduce((prev, current) => {\n if (isCommandEntry(current)) {\n prev[current[0]] = current[1];\n }\n return prev;\n }, initial);\n }\n\n // A value like string or number, possible contains PII, scrub it\n return '?';\n}\n\nfunction isCommandObj(value: Record<string, unknown> | unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !isBuffer(value);\n}\n\nfunction isBuffer(value: unknown): boolean {\n let isBuffer = false;\n if (typeof Buffer !== 'undefined') {\n isBuffer = Buffer.isBuffer(value);\n }\n return isBuffer;\n}\n\nfunction isCommandEntry(value: [string, unknown] | unknown): value is [string, unknown] {\n return Array.isArray(value);\n}\n\nconst _mongoIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentMongo();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [mongodb](https://www.npmjs.com/package/mongodb) library.\n *\n * For more information, see the [`mongoIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/mongo/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.mongoIntegration()],\n * });\n * ```\n */\nexport const mongoIntegration = defineIntegration(_mongoIntegration);\n"],"names":[],"mappings":";;;;AAKA,MAAM,gBAAA,GAAmB,OAAO;;AAEzB,MAAM,eAAgB,GAAE,sBAAsB;AACrD,EAAE,gBAAgB;AAClB,EAAE;AACF,IAAI,IAAI,sBAAsB,CAAC;AAC/B,MAAM,qBAAqB,EAAE,6BAA6B;AAC1D,MAAM,YAAY,CAAC,IAAI,EAAE;AACzB,QAAQ,eAAe,CAAC,IAAI,EAAE,oBAAoB,CAAC;AACnD,OAAO;AACP,KAAK,CAAC;AACN;;AAEA;AACA;AACA;AACO,SAAS,6BAA6B,CAAC,UAAU,EAAmC;AAC3F,EAAE,MAAM,SAAU,GAAE,eAAe,CAAC,UAAU,CAAC;AAC/C,EAAE,OAAO,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC;AAClC;;AAEA,SAAS,eAAe,CAAC,KAAK,EAAoB;AAClD,EAAE,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;AAC5B,IAAI,OAAO,KAAK,CAAC,G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AE;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,gBAAiB,GAAE,iBAAiB,CAAC,iBAAiB;;;;"}
@@ -1,7 +1,6 @@
1
1
  import { MongooseInstrumentation } from '@opentelemetry/instrumentation-mongoose';
2
2
  import { defineIntegration } from '@sentry/core';
3
- import { generateInstrumentOnce } from '../../otel/instrument.js';
4
- import { addOriginToSpan } from '../../utils/addOriginToSpan.js';
3
+ import { generateInstrumentOnce, addOriginToSpan } from '@sentry/node-core';
5
4
 
6
5
  const INTEGRATION_NAME = 'Mongoose';
7
6
 
@@ -1 +1 @@
1
- {"version":3,"file":"mongoose.js","sources":["../../../../src/integrations/tracing/mongoose.ts"],"sourcesContent":["import { MongooseInstrumentation } from '@opentelemetry/instrumentation-mongoose';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { generateInstrumentOnce } from '../../otel/instrument';\nimport { addOriginToSpan } from '../../utils/addOriginToSpan';\n\nconst INTEGRATION_NAME = 'Mongoose';\n\nexport const instrumentMongoose = generateInstrumentOnce(\n INTEGRATION_NAME,\n () =>\n new MongooseInstrumentation({\n responseHook(span) {\n addOriginToSpan(span, 'auto.db.otel.mongoose');\n },\n }),\n);\n\nconst _mongooseIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentMongoose();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [mongoose](https://www.npmjs.com/package/mongoose) library.\n *\n * For more information, see the [`mongooseIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/mongoose/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.mongooseIntegration()],\n * });\n * ```\n */\nexport const mongooseIntegration = defineIntegration(_mongooseIntegration);\n"],"names":[],"mappings":";;;;;AAMA,MAAM,gBAAA,GAAmB,UAAU;;AAE5B,MAAM,kBAAmB,GAAE,sBAAsB;AACxD,EAAE,gBAAgB;AAClB,EAAE;AACF,IAAI,IAAI,uBAAuB,CAAC;AAChC,MAAM,YAAY,CAAC,IAAI,EAAE;AACzB,QAAQ,eAAe,CAAC,IAAI,EAAE,uBAAuB,CAAC;AACtD,OAAO;AACP,KAAK,CAAC;AACN;;AAEA,MAAM,oBAAqB,IAAG,MAAM;AACpC,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,GAAG;AAChB,MAAM,kBAAkB,EAAE;AAC1B,KAAK;AACL,GAAG;AACH,CAAC,CAAE;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,mBAAoB,GAAE,iBAAiB,CAAC,oBAAoB;;;;"}
1
+ {"version":3,"file":"mongoose.js","sources":["../../../../src/integrations/tracing/mongoose.ts"],"sourcesContent":["import { MongooseInstrumentation } from '@opentelemetry/instrumentation-mongoose';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { addOriginToSpan, generateInstrumentOnce } from '@sentry/node-core';\n\nconst INTEGRATION_NAME = 'Mongoose';\n\nexport const instrumentMongoose = generateInstrumentOnce(\n INTEGRATION_NAME,\n () =>\n new MongooseInstrumentation({\n responseHook(span) {\n addOriginToSpan(span, 'auto.db.otel.mongoose');\n },\n }),\n);\n\nconst _mongooseIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentMongoose();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [mongoose](https://www.npmjs.com/package/mongoose) library.\n *\n * For more information, see the [`mongooseIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/mongoose/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.mongooseIntegration()],\n * });\n * ```\n */\nexport const mongooseIntegration = defineIntegration(_mongooseIntegration);\n"],"names":[],"mappings":";;;;AAKA,MAAM,gBAAA,GAAmB,UAAU;;AAE5B,MAAM,kBAAmB,GAAE,sBAAsB;AACxD,EAAE,gBAAgB;AAClB,EAAE;AACF,IAAI,IAAI,uBAAuB,CAAC;AAChC,MAAM,YAAY,CAAC,IAAI,EAAE;AACzB,QAAQ,eAAe,CAAC,IAAI,EAAE,uBAAuB,CAAC;AACtD,OAAO;AACP,KAAK,CAAC;AACN;;AAEA,MAAM,oBAAqB,IAAG,MAAM;AACpC,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,GAAG;AAChB,MAAM,kBAAkB,EAAE;AAC1B,KAAK;AACL,GAAG;AACH,CAAC,CAAE;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,mBAAoB,GAAE,iBAAiB,CAAC,oBAAoB;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { MySQLInstrumentation } from '@opentelemetry/instrumentation-mysql';
2
2
  import { defineIntegration } from '@sentry/core';
3
- import { generateInstrumentOnce } from '../../otel/instrument.js';
3
+ import { generateInstrumentOnce } from '@sentry/node-core';
4
4
 
5
5
  const INTEGRATION_NAME = 'Mysql';
6
6
 
@@ -1 +1 @@
1
- {"version":3,"file":"mysql.js","sources":["../../../../src/integrations/tracing/mysql.ts"],"sourcesContent":["import { MySQLInstrumentation } from '@opentelemetry/instrumentation-mysql';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { generateInstrumentOnce } from '../../otel/instrument';\n\nconst INTEGRATION_NAME = 'Mysql';\n\nexport const instrumentMysql = generateInstrumentOnce(INTEGRATION_NAME, () => new MySQLInstrumentation({}));\n\nconst _mysqlIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentMysql();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [mysql](https://www.npmjs.com/package/mysql) library.\n *\n * For more information, see the [`mysqlIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/mysql/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.mysqlIntegration()],\n * });\n * ```\n */\nexport const mysqlIntegration = defineIntegration(_mysqlIntegration);\n"],"names":[],"mappings":";;;;AAKA,MAAM,gBAAA,GAAmB,OAAO;;MAEnB,eAAgB,GAAE,sBAAsB,CAAC,gBAAgB,EAAE,MAAM,IAAI,oBAAoB,CAAC,EAAE,CAAC;;AAE1G,MAAM,iBAAkB,IAAG,MAAM;AACjC,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,GAAG;AAChB,MAAM,eAAe,EAAE;AACvB,KAAK;AACL,GAAG;AACH,CAAC,CAAE;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,gBAAiB,GAAE,iBAAiB,CAAC,iBAAiB;;;;"}
1
+ {"version":3,"file":"mysql.js","sources":["../../../../src/integrations/tracing/mysql.ts"],"sourcesContent":["import { MySQLInstrumentation } from '@opentelemetry/instrumentation-mysql';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { generateInstrumentOnce } from '@sentry/node-core';\n\nconst INTEGRATION_NAME = 'Mysql';\n\nexport const instrumentMysql = generateInstrumentOnce(INTEGRATION_NAME, () => new MySQLInstrumentation({}));\n\nconst _mysqlIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentMysql();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [mysql](https://www.npmjs.com/package/mysql) library.\n *\n * For more information, see the [`mysqlIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/mysql/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.mysqlIntegration()],\n * });\n * ```\n */\nexport const mysqlIntegration = defineIntegration(_mysqlIntegration);\n"],"names":[],"mappings":";;;;AAKA,MAAM,gBAAA,GAAmB,OAAO;;MAEnB,eAAgB,GAAE,sBAAsB,CAAC,gBAAgB,EAAE,MAAM,IAAI,oBAAoB,CAAC,EAAE,CAAC;;AAE1G,MAAM,iBAAkB,IAAG,MAAM;AACjC,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,GAAG;AAChB,MAAM,eAAe,EAAE;AACvB,KAAK;AACL,GAAG;AACH,CAAC,CAAE;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,gBAAiB,GAAE,iBAAiB,CAAC,iBAAiB;;;;"}
@@ -1,7 +1,6 @@
1
1
  import { MySQL2Instrumentation } from '@opentelemetry/instrumentation-mysql2';
2
2
  import { defineIntegration } from '@sentry/core';
3
- import { generateInstrumentOnce } from '../../otel/instrument.js';
4
- import { addOriginToSpan } from '../../utils/addOriginToSpan.js';
3
+ import { generateInstrumentOnce, addOriginToSpan } from '@sentry/node-core';
5
4
 
6
5
  const INTEGRATION_NAME = 'Mysql2';
7
6
 
@@ -1 +1 @@
1
- {"version":3,"file":"mysql2.js","sources":["../../../../src/integrations/tracing/mysql2.ts"],"sourcesContent":["import { MySQL2Instrumentation } from '@opentelemetry/instrumentation-mysql2';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { generateInstrumentOnce } from '../../otel/instrument';\nimport { addOriginToSpan } from '../../utils/addOriginToSpan';\n\nconst INTEGRATION_NAME = 'Mysql2';\n\nexport const instrumentMysql2 = generateInstrumentOnce(\n INTEGRATION_NAME,\n () =>\n new MySQL2Instrumentation({\n responseHook(span) {\n addOriginToSpan(span, 'auto.db.otel.mysql2');\n },\n }),\n);\n\nconst _mysql2Integration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentMysql2();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [mysql2](https://www.npmjs.com/package/mysql2) library.\n *\n * For more information, see the [`mysql2Integration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/mysql2/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.mysqlIntegration()],\n * });\n * ```\n */\nexport const mysql2Integration = defineIntegration(_mysql2Integration);\n"],"names":[],"mappings":";;;;;AAMA,MAAM,gBAAA,GAAmB,QAAQ;;AAE1B,MAAM,gBAAiB,GAAE,sBAAsB;AACtD,EAAE,gBAAgB;AAClB,EAAE;AACF,IAAI,IAAI,qBAAqB,CAAC;AAC9B,MAAM,YAAY,CAAC,IAAI,EAAE;AACzB,QAAQ,eAAe,CAAC,IAAI,EAAE,qBAAqB,CAAC;AACpD,OAAO;AACP,KAAK,CAAC;AACN;;AAEA,MAAM,kBAAmB,IAAG,MAAM;AAClC,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,GAAG;AAChB,MAAM,gBAAgB,EAAE;AACxB,KAAK;AACL,GAAG;AACH,CAAC,CAAE;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,iBAAkB,GAAE,iBAAiB,CAAC,kBAAkB;;;;"}
1
+ {"version":3,"file":"mysql2.js","sources":["../../../../src/integrations/tracing/mysql2.ts"],"sourcesContent":["import { MySQL2Instrumentation } from '@opentelemetry/instrumentation-mysql2';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { addOriginToSpan, generateInstrumentOnce } from '@sentry/node-core';\n\nconst INTEGRATION_NAME = 'Mysql2';\n\nexport const instrumentMysql2 = generateInstrumentOnce(\n INTEGRATION_NAME,\n () =>\n new MySQL2Instrumentation({\n responseHook(span) {\n addOriginToSpan(span, 'auto.db.otel.mysql2');\n },\n }),\n);\n\nconst _mysql2Integration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentMysql2();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [mysql2](https://www.npmjs.com/package/mysql2) library.\n *\n * For more information, see the [`mysql2Integration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/mysql2/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.mysqlIntegration()],\n * });\n * ```\n */\nexport const mysql2Integration = defineIntegration(_mysql2Integration);\n"],"names":[],"mappings":";;;;AAKA,MAAM,gBAAA,GAAmB,QAAQ;;AAE1B,MAAM,gBAAiB,GAAE,sBAAsB;AACtD,EAAE,gBAAgB;AAClB,EAAE;AACF,IAAI,IAAI,qBAAqB,CAAC;AAC9B,MAAM,YAAY,CAAC,IAAI,EAAE;AACzB,QAAQ,eAAe,CAAC,IAAI,EAAE,qBAAqB,CAAC;AACpD,OAAO;AACP,KAAK,CAAC;AACN;;AAEA,MAAM,kBAAmB,IAAG,MAAM;AAClC,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,GAAG;AAChB,MAAM,gBAAgB,EAAE;AACxB,KAAK;AACL,GAAG;AACH,CAAC,CAAE;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,iBAAkB,GAAE,iBAAiB,CAAC,kBAAkB;;;;"}
@@ -1,7 +1,6 @@
1
1
  import { PgInstrumentation } from '@opentelemetry/instrumentation-pg';
2
2
  import { defineIntegration } from '@sentry/core';
3
- import { generateInstrumentOnce } from '../../otel/instrument.js';
4
- import { addOriginToSpan } from '../../utils/addOriginToSpan.js';
3
+ import { generateInstrumentOnce, addOriginToSpan } from '@sentry/node-core';
5
4
 
6
5
  const INTEGRATION_NAME = 'Postgres';
7
6
 
@@ -1 +1 @@
1
- {"version":3,"file":"postgres.js","sources":["../../../../src/integrations/tracing/postgres.ts"],"sourcesContent":["import { PgInstrumentation } from '@opentelemetry/instrumentation-pg';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { generateInstrumentOnce } from '../../otel/instrument';\nimport { addOriginToSpan } from '../../utils/addOriginToSpan';\n\nconst INTEGRATION_NAME = 'Postgres';\n\nexport const instrumentPostgres = generateInstrumentOnce(\n INTEGRATION_NAME,\n () =>\n new PgInstrumentation({\n requireParentSpan: true,\n requestHook(span) {\n addOriginToSpan(span, 'auto.db.otel.postgres');\n },\n }),\n);\n\nconst _postgresIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentPostgres();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [pg](https://www.npmjs.com/package/pg) library.\n *\n * For more information, see the [`postgresIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/postgres/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.postgresIntegration()],\n * });\n * ```\n */\nexport const postgresIntegration = defineIntegration(_postgresIntegration);\n"],"names":[],"mappings":";;;;;AAMA,MAAM,gBAAA,GAAmB,UAAU;;AAE5B,MAAM,kBAAmB,GAAE,sBAAsB;AACxD,EAAE,gBAAgB;AAClB,EAAE;AACF,IAAI,IAAI,iBAAiB,CAAC;AAC1B,MAAM,iBAAiB,EAAE,IAAI;AAC7B,MAAM,WAAW,CAAC,IAAI,EAAE;AACxB,QAAQ,eAAe,CAAC,IAAI,EAAE,uBAAuB,CAAC;AACtD,OAAO;AACP,KAAK,CAAC;AACN;;AAEA,MAAM,oBAAqB,IAAG,MAAM;AACpC,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,GAAG;AAChB,MAAM,kBAAkB,EAAE;AAC1B,KAAK;AACL,GAAG;AACH,CAAC,CAAE;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,mBAAoB,GAAE,iBAAiB,CAAC,oBAAoB;;;;"}
1
+ {"version":3,"file":"postgres.js","sources":["../../../../src/integrations/tracing/postgres.ts"],"sourcesContent":["import { PgInstrumentation } from '@opentelemetry/instrumentation-pg';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { addOriginToSpan, generateInstrumentOnce } from '@sentry/node-core';\n\nconst INTEGRATION_NAME = 'Postgres';\n\nexport const instrumentPostgres = generateInstrumentOnce(\n INTEGRATION_NAME,\n () =>\n new PgInstrumentation({\n requireParentSpan: true,\n requestHook(span) {\n addOriginToSpan(span, 'auto.db.otel.postgres');\n },\n }),\n);\n\nconst _postgresIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentPostgres();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [pg](https://www.npmjs.com/package/pg) library.\n *\n * For more information, see the [`postgresIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/postgres/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.postgresIntegration()],\n * });\n * ```\n */\nexport const postgresIntegration = defineIntegration(_postgresIntegration);\n"],"names":[],"mappings":";;;;AAKA,MAAM,gBAAA,GAAmB,UAAU;;AAE5B,MAAM,kBAAmB,GAAE,sBAAsB;AACxD,EAAE,gBAAgB;AAClB,EAAE;AACF,IAAI,IAAI,iBAAiB,CAAC;AAC1B,MAAM,iBAAiB,EAAE,IAAI;AAC7B,MAAM,WAAW,CAAC,IAAI,EAAE;AACxB,QAAQ,eAAe,CAAC,IAAI,EAAE,uBAAuB,CAAC;AACtD,OAAO;AACP,KAAK,CAAC;AACN;;AAEA,MAAM,oBAAqB,IAAG,MAAM;AACpC,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,GAAG;AAChB,MAAM,kBAAkB,EAAE;AAC1B,KAAK;AACL,GAAG;AACH,CAAC,CAAE;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,mBAAoB,GAAE,iBAAiB,CAAC,oBAAoB;;;;"}
@@ -0,0 +1,278 @@
1
+ import { trace, context } from '@opentelemetry/api';
2
+ import { InstrumentationBase, InstrumentationNodeModuleDefinition, InstrumentationNodeModuleFile, safeExecuteInTheMiddle } from '@opentelemetry/instrumentation';
3
+ import { ATTR_DB_RESPONSE_STATUS_CODE, ATTR_ERROR_TYPE, ATTR_DB_OPERATION_NAME, ATTR_DB_SYSTEM_NAME, ATTR_DB_NAMESPACE, ATTR_SERVER_ADDRESS, ATTR_SERVER_PORT, ATTR_DB_QUERY_TEXT } from '@opentelemetry/semantic-conventions';
4
+ import { SDK_VERSION, SPAN_STATUS_ERROR, startSpanManual, getCurrentScope, logger, defineIntegration } from '@sentry/core';
5
+ import { generateInstrumentOnce, addOriginToSpan } from '@sentry/node-core';
6
+
7
+ // Instrumentation for https://github.com/porsager/postgres
8
+
9
+ const INTEGRATION_NAME = 'PostgresJs';
10
+ const SUPPORTED_VERSIONS = ['>=3.0.0 <4'];
11
+
12
+ const instrumentPostgresJs = generateInstrumentOnce(
13
+ INTEGRATION_NAME,
14
+ (options) =>
15
+ new PostgresJsInstrumentation({
16
+ requireParentSpan: options?.requireParentSpan ?? true,
17
+ requestHook: options?.requestHook,
18
+ }),
19
+ );
20
+
21
+ /**
22
+ * Instrumentation for the [postgres](https://www.npmjs.com/package/postgres) library.
23
+ * This instrumentation captures postgresjs queries and their attributes,
24
+ */
25
+ class PostgresJsInstrumentation extends InstrumentationBase {
26
+ constructor(config) {
27
+ super('sentry-postgres-js', SDK_VERSION, config);
28
+ }
29
+
30
+ /**
31
+ * Initializes the instrumentation.
32
+ */
33
+ init() {
34
+ const instrumentationModule = new InstrumentationNodeModuleDefinition('postgres', SUPPORTED_VERSIONS);
35
+
36
+ ['src', 'cf/src', 'cjs/src'].forEach(path => {
37
+ instrumentationModule.files.push(
38
+ new InstrumentationNodeModuleFile(
39
+ `postgres/${path}/connection.js`,
40
+ ['*'],
41
+ this._patchConnection.bind(this),
42
+ this._unwrap.bind(this),
43
+ ),
44
+ );
45
+
46
+ instrumentationModule.files.push(
47
+ new InstrumentationNodeModuleFile(
48
+ `postgres/${path}/query.js`,
49
+ SUPPORTED_VERSIONS,
50
+ this._patchQuery.bind(this),
51
+ this._unwrap.bind(this),
52
+ ),
53
+ );
54
+ });
55
+
56
+ return [instrumentationModule];
57
+ }
58
+
59
+ /**
60
+ * Determines whether a span should be created based on the current context.
61
+ * If `requireParentSpan` is set to true in the configuration, a span will
62
+ * only be created if there is a parent span available.
63
+ */
64
+ _shouldCreateSpans() {
65
+ const config = this.getConfig();
66
+ const hasParentSpan = trace.getSpan(context.active()) !== undefined;
67
+ return hasParentSpan || !config.requireParentSpan;
68
+ }
69
+
70
+ /**
71
+ * Patches the reject method of the Query class to set the span status and end it
72
+ */
73
+ _patchReject(rejectTarget, span) {
74
+ return new Proxy(rejectTarget, {
75
+ apply: (
76
+ rejectTarget,
77
+ rejectThisArg,
78
+ rejectArgs
79
+
80
+ ,
81
+ ) => {
82
+ span.setStatus({
83
+ code: SPAN_STATUS_ERROR,
84
+ // This message is the error message from the rejectArgs, when available
85
+ // e.g "relation 'User' does not exist"
86
+ message: rejectArgs?.[0]?.message || 'unknown_error',
87
+ });
88
+
89
+ const result = Reflect.apply(rejectTarget, rejectThisArg, rejectArgs);
90
+
91
+ // This status code is PG error code, e.g. '42P01' for "relation does not exist"
92
+ // https://www.postgresql.org/docs/current/errcodes-appendix.html
93
+ span.setAttribute(ATTR_DB_RESPONSE_STATUS_CODE, rejectArgs?.[0]?.code || 'Unknown error');
94
+ // This is the error type, e.g. 'PostgresError' for a Postgres error
95
+ span.setAttribute(ATTR_ERROR_TYPE, rejectArgs?.[0]?.name || 'Unknown error');
96
+
97
+ span.end();
98
+ return result;
99
+ },
100
+ });
101
+ }
102
+
103
+ /**
104
+ * Patches the resolve method of the Query class to end the span when the query is resolved.
105
+ */
106
+ _patchResolve(resolveTarget, span) {
107
+ return new Proxy(resolveTarget, {
108
+ apply: (resolveTarget, resolveThisArg, resolveArgs) => {
109
+ const result = Reflect.apply(resolveTarget, resolveThisArg, resolveArgs);
110
+ const sqlCommand = resolveArgs?.[0]?.command;
111
+
112
+ if (sqlCommand) {
113
+ // SQL command is only available when the query is resolved successfully
114
+ span.setAttribute(ATTR_DB_OPERATION_NAME, sqlCommand);
115
+ }
116
+ span.end();
117
+ return result;
118
+ },
119
+ });
120
+ }
121
+
122
+ /**
123
+ * Patches the Query class to instrument the handle method.
124
+ */
125
+ _patchQuery(moduleExports
126
+
127
+ ) {
128
+ moduleExports.Query.prototype.handle = new Proxy(moduleExports.Query.prototype.handle, {
129
+ apply: async (
130
+ handleTarget,
131
+ handleThisArg
132
+
133
+ ,
134
+ handleArgs,
135
+ ) => {
136
+ if (!this._shouldCreateSpans()) {
137
+ // If we don't need to create spans, just call the original method
138
+ return Reflect.apply(handleTarget, handleThisArg, handleArgs);
139
+ }
140
+
141
+ const sanitizedSqlQuery = this._sanitizeSqlQuery(handleThisArg.strings?.[0]);
142
+
143
+ return startSpanManual(
144
+ {
145
+ name: sanitizedSqlQuery || 'postgresjs.query',
146
+ op: 'db',
147
+ },
148
+ (span) => {
149
+ const scope = getCurrentScope();
150
+ const postgresConnectionContext = scope.getScopeData().contexts['postgresjsConnection']
151
+
152
+ ;
153
+
154
+ addOriginToSpan(span, 'auto.db.otel.postgres');
155
+
156
+ const { requestHook } = this.getConfig();
157
+
158
+ if (requestHook) {
159
+ safeExecuteInTheMiddle(
160
+ () => requestHook(span, sanitizedSqlQuery, postgresConnectionContext),
161
+ error => {
162
+ if (error) {
163
+ logger.error(`Error in requestHook for ${INTEGRATION_NAME} integration:`, error);
164
+ }
165
+ },
166
+ );
167
+ }
168
+
169
+ // ATTR_DB_NAMESPACE is used to indicate the database name and the schema name
170
+ // It's only the database name as we don't have the schema information
171
+ const databaseName = postgresConnectionContext?.ATTR_DB_NAMESPACE || '<unknown database>';
172
+ const databaseHost = postgresConnectionContext?.ATTR_SERVER_ADDRESS || '<unknown host>';
173
+ const databasePort = postgresConnectionContext?.ATTR_SERVER_PORT || '<unknown port>';
174
+
175
+ span.setAttribute(ATTR_DB_SYSTEM_NAME, 'postgres');
176
+ span.setAttribute(ATTR_DB_NAMESPACE, databaseName);
177
+ span.setAttribute(ATTR_SERVER_ADDRESS, databaseHost);
178
+ span.setAttribute(ATTR_SERVER_PORT, databasePort);
179
+ span.setAttribute(ATTR_DB_QUERY_TEXT, sanitizedSqlQuery);
180
+
181
+ handleThisArg.resolve = this._patchResolve(handleThisArg.resolve, span);
182
+ handleThisArg.reject = this._patchReject(handleThisArg.reject, span);
183
+
184
+ try {
185
+ return Reflect.apply(handleTarget, handleThisArg, handleArgs);
186
+ } catch (error) {
187
+ span.setStatus({
188
+ code: SPAN_STATUS_ERROR,
189
+ });
190
+ span.end();
191
+ throw error; // Re-throw the error to propagate it
192
+ }
193
+ },
194
+ );
195
+ },
196
+ });
197
+
198
+ return moduleExports;
199
+ }
200
+
201
+ /**
202
+ * Patches the Connection class to set the database, host, and port attributes
203
+ * when a new connection is created.
204
+ */
205
+ _patchConnection(Connection) {
206
+ return new Proxy(Connection, {
207
+ apply: (connectionTarget, thisArg, connectionArgs) => {
208
+ const databaseName = connectionArgs[0]?.database || '<unknown database>';
209
+ const databaseHost = connectionArgs[0]?.host?.[0] || '<unknown host>';
210
+ const databasePort = connectionArgs[0]?.port?.[0] || '<unknown port>';
211
+
212
+ const scope = getCurrentScope();
213
+ scope.setContext('postgresjsConnection', {
214
+ ATTR_DB_NAMESPACE: databaseName,
215
+ ATTR_SERVER_ADDRESS: databaseHost,
216
+ ATTR_SERVER_PORT: databasePort,
217
+ });
218
+
219
+ return Reflect.apply(connectionTarget, thisArg, connectionArgs);
220
+ },
221
+ });
222
+ }
223
+
224
+ /**
225
+ * Sanitize SQL query as per the OTEL semantic conventions
226
+ * https://opentelemetry.io/docs/specs/semconv/database/database-spans/#sanitization-of-dbquerytext
227
+ */
228
+ _sanitizeSqlQuery(sqlQuery) {
229
+ if (!sqlQuery) {
230
+ return 'Unknown SQL Query';
231
+ }
232
+
233
+ return (
234
+ sqlQuery
235
+ .replace(/\s+/g, ' ')
236
+ .trim() // Remove extra spaces including newlines and trim
237
+ .substring(0, 1024) // Truncate to 1024 characters
238
+ .replace(/--.*?(\r?\n|$)/g, '') // Single line comments
239
+ .replace(/\/\*[\s\S]*?\*\//g, '') // Multi-line comments
240
+ .replace(/;\s*$/, '') // Remove trailing semicolons
241
+ .replace(/\b\d+\b/g, '?') // Replace standalone numbers
242
+ // Collapse whitespace to a single space
243
+ .replace(/\s+/g, ' ')
244
+ // Collapse IN and in clauses
245
+ // eg. IN (?, ?, ?, ?) to IN (?)
246
+ .replace(/\bIN\b\s*\(\s*\?(?:\s*,\s*\?)*\s*\)/g, 'IN (?)')
247
+ );
248
+ }
249
+ }
250
+
251
+ const _postgresJsIntegration = (() => {
252
+ return {
253
+ name: INTEGRATION_NAME,
254
+ setupOnce() {
255
+ instrumentPostgresJs();
256
+ },
257
+ };
258
+ }) ;
259
+
260
+ /**
261
+ * Adds Sentry tracing instrumentation for the [postgres](https://www.npmjs.com/package/postgres) library.
262
+ *
263
+ * For more information, see the [`postgresIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/postgres/).
264
+ *
265
+ * @example
266
+ * ```javascript
267
+ * const Sentry = require('@sentry/node');
268
+ *
269
+ * Sentry.init({
270
+ * integrations: [Sentry.postgresJsIntegration()],
271
+ * });
272
+ * ```
273
+ */
274
+
275
+ const postgresJsIntegration = defineIntegration(_postgresJsIntegration);
276
+
277
+ export { PostgresJsInstrumentation, instrumentPostgresJs, postgresJsIntegration };
278
+ //# sourceMappingURL=postgresjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"postgresjs.js","sources":["../../../../src/integrations/tracing/postgresjs.ts"],"sourcesContent":["// Instrumentation for https://github.com/porsager/postgres\nimport { context, trace } from '@opentelemetry/api';\nimport type { InstrumentationConfig } from '@opentelemetry/instrumentation';\nimport {\n InstrumentationBase,\n InstrumentationNodeModuleDefinition,\n InstrumentationNodeModuleFile,\n safeExecuteInTheMiddle,\n} from '@opentelemetry/instrumentation';\nimport {\n ATTR_DB_NAMESPACE,\n ATTR_DB_OPERATION_NAME,\n ATTR_DB_QUERY_TEXT,\n ATTR_DB_RESPONSE_STATUS_CODE,\n ATTR_DB_SYSTEM_NAME,\n ATTR_ERROR_TYPE,\n ATTR_SERVER_ADDRESS,\n ATTR_SERVER_PORT,\n} from '@opentelemetry/semantic-conventions';\nimport type { IntegrationFn, Span } from '@sentry/core';\nimport {\n defineIntegration,\n getCurrentScope,\n logger,\n SDK_VERSION,\n SPAN_STATUS_ERROR,\n startSpanManual,\n} from '@sentry/core';\nimport { addOriginToSpan, generateInstrumentOnce } from '@sentry/node-core';\n\nconst INTEGRATION_NAME = 'PostgresJs';\nconst SUPPORTED_VERSIONS = ['>=3.0.0 <4'];\n\ntype PostgresConnectionContext = {\n ATTR_DB_NAMESPACE?: string; // Database name\n ATTR_SERVER_ADDRESS?: string; // Hostname or IP address of the database server\n ATTR_SERVER_PORT?: string; // Port number of the database server\n};\n\ntype PostgresJsInstrumentationConfig = InstrumentationConfig & {\n /**\n * Whether to require a parent span for the instrumentation.\n * If set to true, the instrumentation will only create spans if there is a parent span\n * available in the current scope.\n * @default true\n */\n requireParentSpan?: boolean;\n /**\n * Hook to modify the span before it is started.\n * This can be used to set additional attributes or modify the span in any way.\n */\n requestHook?: (span: Span, sanitizedSqlQuery: string, postgresConnectionContext?: PostgresConnectionContext) => void;\n};\n\nexport const instrumentPostgresJs = generateInstrumentOnce(\n INTEGRATION_NAME,\n (options?: PostgresJsInstrumentationConfig) =>\n new PostgresJsInstrumentation({\n requireParentSpan: options?.requireParentSpan ?? true,\n requestHook: options?.requestHook,\n }),\n);\n\n/**\n * Instrumentation for the [postgres](https://www.npmjs.com/package/postgres) library.\n * This instrumentation captures postgresjs queries and their attributes,\n */\nexport class PostgresJsInstrumentation extends InstrumentationBase<PostgresJsInstrumentationConfig> {\n public constructor(config: PostgresJsInstrumentationConfig) {\n super('sentry-postgres-js', SDK_VERSION, config);\n }\n\n /**\n * Initializes the instrumentation.\n */\n public init(): InstrumentationNodeModuleDefinition[] {\n const instrumentationModule = new InstrumentationNodeModuleDefinition('postgres', SUPPORTED_VERSIONS);\n\n ['src', 'cf/src', 'cjs/src'].forEach(path => {\n instrumentationModule.files.push(\n new InstrumentationNodeModuleFile(\n `postgres/${path}/connection.js`,\n ['*'],\n this._patchConnection.bind(this),\n this._unwrap.bind(this),\n ),\n );\n\n instrumentationModule.files.push(\n new InstrumentationNodeModuleFile(\n `postgres/${path}/query.js`,\n SUPPORTED_VERSIONS,\n this._patchQuery.bind(this),\n this._unwrap.bind(this),\n ),\n );\n });\n\n return [instrumentationModule];\n }\n\n /**\n * Determines whether a span should be created based on the current context.\n * If `requireParentSpan` is set to true in the configuration, a span will\n * only be created if there is a parent span available.\n */\n private _shouldCreateSpans(): boolean {\n const config = this.getConfig();\n const hasParentSpan = trace.getSpan(context.active()) !== undefined;\n return hasParentSpan || !config.requireParentSpan;\n }\n\n /**\n * Patches the reject method of the Query class to set the span status and end it\n */\n private _patchReject(rejectTarget: any, span: Span): any {\n return new Proxy(rejectTarget, {\n apply: (\n rejectTarget,\n rejectThisArg,\n rejectArgs: {\n message?: string;\n code?: string;\n name?: string;\n }[],\n ) => {\n span.setStatus({\n code: SPAN_STATUS_ERROR,\n // This message is the error message from the rejectArgs, when available\n // e.g \"relation 'User' does not exist\"\n message: rejectArgs?.[0]?.message || 'unknown_error',\n });\n\n const result = Reflect.apply(rejectTarget, rejectThisArg, rejectArgs);\n\n // This status code is PG error code, e.g. '42P01' for \"relation does not exist\"\n // https://www.postgresql.org/docs/current/errcodes-appendix.html\n span.setAttribute(ATTR_DB_RESPONSE_STATUS_CODE, rejectArgs?.[0]?.code || 'Unknown error');\n // This is the error type, e.g. 'PostgresError' for a Postgres error\n span.setAttribute(ATTR_ERROR_TYPE, rejectArgs?.[0]?.name || 'Unknown error');\n\n span.end();\n return result;\n },\n });\n }\n\n /**\n * Patches the resolve method of the Query class to end the span when the query is resolved.\n */\n private _patchResolve(resolveTarget: any, span: Span): any {\n return new Proxy(resolveTarget, {\n apply: (resolveTarget, resolveThisArg, resolveArgs: [{ command?: string }]) => {\n const result = Reflect.apply(resolveTarget, resolveThisArg, resolveArgs);\n const sqlCommand = resolveArgs?.[0]?.command;\n\n if (sqlCommand) {\n // SQL command is only available when the query is resolved successfully\n span.setAttribute(ATTR_DB_OPERATION_NAME, sqlCommand);\n }\n span.end();\n return result;\n },\n });\n }\n\n /**\n * Patches the Query class to instrument the handle method.\n */\n private _patchQuery(moduleExports: {\n Query: {\n prototype: {\n handle: any;\n };\n };\n }): any {\n moduleExports.Query.prototype.handle = new Proxy(moduleExports.Query.prototype.handle, {\n apply: async (\n handleTarget,\n handleThisArg: {\n resolve: any;\n reject: any;\n strings?: string[];\n },\n handleArgs,\n ) => {\n if (!this._shouldCreateSpans()) {\n // If we don't need to create spans, just call the original method\n return Reflect.apply(handleTarget, handleThisArg, handleArgs);\n }\n\n const sanitizedSqlQuery = this._sanitizeSqlQuery(handleThisArg.strings?.[0]);\n\n return startSpanManual(\n {\n name: sanitizedSqlQuery || 'postgresjs.query',\n op: 'db',\n },\n (span: Span) => {\n const scope = getCurrentScope();\n const postgresConnectionContext = scope.getScopeData().contexts['postgresjsConnection'] as\n | PostgresConnectionContext\n | undefined;\n\n addOriginToSpan(span, 'auto.db.otel.postgres');\n\n const { requestHook } = this.getConfig();\n\n if (requestHook) {\n safeExecuteInTheMiddle(\n () => requestHook(span, sanitizedSqlQuery, postgresConnectionContext),\n error => {\n if (error) {\n logger.error(`Error in requestHook for ${INTEGRATION_NAME} integration:`, error);\n }\n },\n );\n }\n\n // ATTR_DB_NAMESPACE is used to indicate the database name and the schema name\n // It's only the database name as we don't have the schema information\n const databaseName = postgresConnectionContext?.ATTR_DB_NAMESPACE || '<unknown database>';\n const databaseHost = postgresConnectionContext?.ATTR_SERVER_ADDRESS || '<unknown host>';\n const databasePort = postgresConnectionContext?.ATTR_SERVER_PORT || '<unknown port>';\n\n span.setAttribute(ATTR_DB_SYSTEM_NAME, 'postgres');\n span.setAttribute(ATTR_DB_NAMESPACE, databaseName);\n span.setAttribute(ATTR_SERVER_ADDRESS, databaseHost);\n span.setAttribute(ATTR_SERVER_PORT, databasePort);\n span.setAttribute(ATTR_DB_QUERY_TEXT, sanitizedSqlQuery);\n\n handleThisArg.resolve = this._patchResolve(handleThisArg.resolve, span);\n handleThisArg.reject = this._patchReject(handleThisArg.reject, span);\n\n try {\n return Reflect.apply(handleTarget, handleThisArg, handleArgs);\n } catch (error) {\n span.setStatus({\n code: SPAN_STATUS_ERROR,\n });\n span.end();\n throw error; // Re-throw the error to propagate it\n }\n },\n );\n },\n });\n\n return moduleExports;\n }\n\n /**\n * Patches the Connection class to set the database, host, and port attributes\n * when a new connection is created.\n */\n private _patchConnection(Connection: any): any {\n return new Proxy(Connection, {\n apply: (connectionTarget, thisArg, connectionArgs: { database: string; host: string[]; port: number[] }[]) => {\n const databaseName = connectionArgs[0]?.database || '<unknown database>';\n const databaseHost = connectionArgs[0]?.host?.[0] || '<unknown host>';\n const databasePort = connectionArgs[0]?.port?.[0] || '<unknown port>';\n\n const scope = getCurrentScope();\n scope.setContext('postgresjsConnection', {\n ATTR_DB_NAMESPACE: databaseName,\n ATTR_SERVER_ADDRESS: databaseHost,\n ATTR_SERVER_PORT: databasePort,\n });\n\n return Reflect.apply(connectionTarget, thisArg, connectionArgs);\n },\n });\n }\n\n /**\n * Sanitize SQL query as per the OTEL semantic conventions\n * https://opentelemetry.io/docs/specs/semconv/database/database-spans/#sanitization-of-dbquerytext\n */\n private _sanitizeSqlQuery(sqlQuery: string | undefined): string {\n if (!sqlQuery) {\n return 'Unknown SQL Query';\n }\n\n return (\n sqlQuery\n .replace(/\\s+/g, ' ')\n .trim() // Remove extra spaces including newlines and trim\n .substring(0, 1024) // Truncate to 1024 characters\n .replace(/--.*?(\\r?\\n|$)/g, '') // Single line comments\n .replace(/\\/\\*[\\s\\S]*?\\*\\//g, '') // Multi-line comments\n .replace(/;\\s*$/, '') // Remove trailing semicolons\n .replace(/\\b\\d+\\b/g, '?') // Replace standalone numbers\n // Collapse whitespace to a single space\n .replace(/\\s+/g, ' ')\n // Collapse IN and in clauses\n // eg. IN (?, ?, ?, ?) to IN (?)\n .replace(/\\bIN\\b\\s*\\(\\s*\\?(?:\\s*,\\s*\\?)*\\s*\\)/g, 'IN (?)')\n );\n }\n}\n\nconst _postgresJsIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentPostgresJs();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [postgres](https://www.npmjs.com/package/postgres) library.\n *\n * For more information, see the [`postgresIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/postgres/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.postgresJsIntegration()],\n * });\n * ```\n */\n\nexport const postgresJsIntegration = defineIntegration(_postgresJsIntegration);\n"],"names":[],"mappings":";;;;;;AAAA;;AA8BA,MAAM,gBAAA,GAAmB,YAAY;AACrC,MAAM,kBAAmB,GAAE,CAAC,YAAY,CAAC;;AAuBlC,MAAM,oBAAqB,GAAE,sBAAsB;AAC1D,EAAE,gBAAgB;AAClB,EAAE,CAAC,OAAO;AACV,IAAI,IAAI,yBAAyB,CAAC;AAClC,MAAM,iBAAiB,EAAE,OAAO,EAAE,iBAAA,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BAAiB,EAAE,EAAE,CAAA;AACtC,SAAS,OAAO,CAAC,mBAAmB,EAAE,EAAE,CAAA;AACxC,SAAS,OAAO,CAAC,OAAO,EAAE,EAAE,CAAA;AAC5B,SAAS,OAAO,CAAC,UAAU,EAAE,GAAG,CAAA;AAChC;AACA,SAAS,OAAO,CAAC,MAAM,EAAE,GAAG;AAC5B;AACA;AACA,SAAS,OAAO,CAAC,sCAAsC,EAAE,QAAQ;AACjE;AACA;AACA;;AAEA,MAAM,sBAAuB,IAAG,MAAM;AACtC,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,GAAG;AAChB,MAAM,oBAAoB,EAAE;AAC5B,KAAK;AACL,GAAG;AACH,CAAC,CAAE;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;MAEa,qBAAsB,GAAE,iBAAiB,CAAC,sBAAsB;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { PrismaInstrumentation } from '@prisma/instrumentation';
2
2
  import { defineIntegration, spanToJSON, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, consoleSandbox } from '@sentry/core';
3
- import { generateInstrumentOnce } from '../../otel/instrument.js';
3
+ import { generateInstrumentOnce } from '@sentry/node-core';
4
4
 
5
5
  const INTEGRATION_NAME = 'Prisma';
6
6