@sentry/node 10.58.0 → 10.60.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (561) hide show
  1. package/build/cjs/index.js +3 -0
  2. package/build/cjs/index.js.map +1 -1
  3. package/build/cjs/integrations/fs/index.js +3 -84
  4. package/build/cjs/integrations/fs/index.js.map +1 -1
  5. package/build/cjs/integrations/fs/vendored/constants.js.map +1 -1
  6. package/build/cjs/integrations/fs/vendored/instrumentation.js +145 -175
  7. package/build/cjs/integrations/fs/vendored/instrumentation.js.map +1 -1
  8. package/build/cjs/integrations/fs/vendored/utils.js.map +1 -1
  9. package/build/cjs/integrations/node-fetch/index.js +7 -8
  10. package/build/cjs/integrations/node-fetch/index.js.map +1 -1
  11. package/build/cjs/integrations/node-fetch/vendored/semconv.js +28 -0
  12. package/build/cjs/integrations/node-fetch/vendored/semconv.js.map +1 -0
  13. package/build/cjs/integrations/node-fetch/vendored/undici.js +91 -127
  14. package/build/cjs/integrations/node-fetch/vendored/undici.js.map +1 -1
  15. package/build/cjs/integrations/tracing/amqplib/vendored/amqplib.js.map +1 -1
  16. package/build/cjs/integrations/tracing/amqplib/vendored/semconv-obsolete.js.map +1 -1
  17. package/build/cjs/integrations/tracing/amqplib/vendored/semconv.js.map +1 -1
  18. package/build/cjs/integrations/tracing/amqplib/vendored/types.js.map +1 -1
  19. package/build/cjs/integrations/tracing/amqplib/vendored/utils.js.map +1 -1
  20. package/build/cjs/integrations/tracing/connect/index.js +0 -21
  21. package/build/cjs/integrations/tracing/connect/index.js.map +1 -1
  22. package/build/cjs/integrations/tracing/connect/vendored/enums/AttributeNames.js +0 -6
  23. package/build/cjs/integrations/tracing/connect/vendored/enums/AttributeNames.js.map +1 -1
  24. package/build/cjs/integrations/tracing/connect/vendored/instrumentation.js +33 -42
  25. package/build/cjs/integrations/tracing/connect/vendored/instrumentation.js.map +1 -1
  26. package/build/cjs/integrations/tracing/connect/vendored/internal-types.js.map +1 -1
  27. package/build/cjs/integrations/tracing/connect/vendored/utils.js +3 -2
  28. package/build/cjs/integrations/tracing/connect/vendored/utils.js.map +1 -1
  29. package/build/cjs/integrations/tracing/dataloader/vendored/instrumentation.js.map +1 -1
  30. package/build/cjs/integrations/tracing/fastify/v3/instrumentation.js +1 -1
  31. package/build/cjs/integrations/tracing/fastify/v3/instrumentation.js.map +1 -1
  32. package/build/cjs/integrations/tracing/fastify/vendored/instrumentation.js.map +1 -1
  33. package/build/cjs/integrations/tracing/genericPool/index.js +1 -15
  34. package/build/cjs/integrations/tracing/genericPool/index.js.map +1 -1
  35. package/build/cjs/integrations/tracing/genericPool/vendored/instrumentation.js +30 -18
  36. package/build/cjs/integrations/tracing/genericPool/vendored/instrumentation.js.map +1 -1
  37. package/build/cjs/integrations/tracing/graphql/index.js +1 -51
  38. package/build/cjs/integrations/tracing/graphql/index.js.map +1 -1
  39. package/build/cjs/integrations/tracing/graphql/vendored/enum.js.map +1 -1
  40. package/build/cjs/integrations/tracing/graphql/vendored/enums/AttributeNames.js +0 -2
  41. package/build/cjs/integrations/tracing/graphql/vendored/enums/AttributeNames.js.map +1 -1
  42. package/build/cjs/integrations/tracing/graphql/vendored/instrumentation.js +67 -57
  43. package/build/cjs/integrations/tracing/graphql/vendored/instrumentation.js.map +1 -1
  44. package/build/cjs/integrations/tracing/graphql/vendored/internal-types.js.map +1 -1
  45. package/build/cjs/integrations/tracing/graphql/vendored/symbols.js.map +1 -1
  46. package/build/cjs/integrations/tracing/graphql/vendored/utils.js +28 -62
  47. package/build/cjs/integrations/tracing/graphql/vendored/utils.js.map +1 -1
  48. package/build/cjs/integrations/tracing/hapi/index.js +0 -17
  49. package/build/cjs/integrations/tracing/hapi/index.js.map +1 -1
  50. package/build/cjs/integrations/tracing/hapi/vendored/enums/AttributeNames.js.map +1 -1
  51. package/build/cjs/integrations/tracing/hapi/vendored/instrumentation.js +28 -45
  52. package/build/cjs/integrations/tracing/hapi/vendored/instrumentation.js.map +1 -1
  53. package/build/cjs/integrations/tracing/hapi/vendored/internal-types.js.map +1 -1
  54. package/build/cjs/integrations/tracing/hapi/vendored/semconv.js.map +1 -1
  55. package/build/cjs/integrations/tracing/hapi/vendored/utils.js +4 -9
  56. package/build/cjs/integrations/tracing/hapi/vendored/utils.js.map +1 -1
  57. package/build/cjs/integrations/tracing/index.js +1 -0
  58. package/build/cjs/integrations/tracing/index.js.map +1 -1
  59. package/build/cjs/integrations/tracing/kafka/index.js +1 -11
  60. package/build/cjs/integrations/tracing/kafka/index.js.map +1 -1
  61. package/build/cjs/integrations/tracing/kafka/vendored/instrumentation.js +45 -247
  62. package/build/cjs/integrations/tracing/kafka/vendored/instrumentation.js.map +1 -1
  63. package/build/cjs/integrations/tracing/kafka/vendored/semconv.js +4 -8
  64. package/build/cjs/integrations/tracing/kafka/vendored/semconv.js.map +1 -1
  65. package/build/cjs/integrations/tracing/kafka/vendored/utils.js +113 -0
  66. package/build/cjs/integrations/tracing/kafka/vendored/utils.js.map +1 -0
  67. package/build/cjs/integrations/tracing/knex/index.js +2 -17
  68. package/build/cjs/integrations/tracing/knex/index.js.map +1 -1
  69. package/build/cjs/integrations/tracing/knex/vendored/instrumentation.js +65 -93
  70. package/build/cjs/integrations/tracing/knex/vendored/instrumentation.js.map +1 -1
  71. package/build/cjs/integrations/tracing/knex/vendored/semconv.js +2 -0
  72. package/build/cjs/integrations/tracing/knex/vendored/semconv.js.map +1 -1
  73. package/build/cjs/integrations/tracing/knex/vendored/utils.js +2 -15
  74. package/build/cjs/integrations/tracing/knex/vendored/utils.js.map +1 -1
  75. package/build/cjs/integrations/tracing/koa/index.js +1 -24
  76. package/build/cjs/integrations/tracing/koa/index.js.map +1 -1
  77. package/build/cjs/integrations/tracing/koa/vendored/enums/AttributeNames.js.map +1 -1
  78. package/build/cjs/integrations/tracing/koa/vendored/instrumentation.js +29 -41
  79. package/build/cjs/integrations/tracing/koa/vendored/instrumentation.js.map +1 -1
  80. package/build/cjs/integrations/tracing/koa/vendored/internal-types.js.map +1 -1
  81. package/build/cjs/integrations/tracing/koa/vendored/types.js.map +1 -1
  82. package/build/cjs/integrations/tracing/koa/vendored/utils.js.map +1 -1
  83. package/build/cjs/integrations/tracing/lrumemoizer/vendored/instrumentation.js.map +1 -1
  84. package/build/cjs/integrations/tracing/mongo/index.js +1 -42
  85. package/build/cjs/integrations/tracing/mongo/index.js.map +1 -1
  86. package/build/cjs/integrations/tracing/mongo/vendored/instrumentation.js +12 -562
  87. package/build/cjs/integrations/tracing/mongo/vendored/instrumentation.js.map +1 -1
  88. package/build/cjs/integrations/tracing/mongo/vendored/internal-types.js.map +1 -1
  89. package/build/cjs/integrations/tracing/mongo/vendored/patches.js +151 -0
  90. package/build/cjs/integrations/tracing/mongo/vendored/patches.js.map +1 -0
  91. package/build/cjs/integrations/tracing/mongo/vendored/semconv.js +0 -4
  92. package/build/cjs/integrations/tracing/mongo/vendored/semconv.js.map +1 -1
  93. package/build/cjs/integrations/tracing/mongo/vendored/utils.js +153 -0
  94. package/build/cjs/integrations/tracing/mongo/vendored/utils.js.map +1 -0
  95. package/build/cjs/integrations/tracing/mongoose/index.js +1 -8
  96. package/build/cjs/integrations/tracing/mongoose/index.js.map +1 -1
  97. package/build/cjs/integrations/tracing/mongoose/vendored/mongoose.js +56 -203
  98. package/build/cjs/integrations/tracing/mongoose/vendored/mongoose.js.map +1 -1
  99. package/build/cjs/integrations/tracing/mongoose/vendored/semconv.js +0 -4
  100. package/build/cjs/integrations/tracing/mongoose/vendored/semconv.js.map +1 -1
  101. package/build/cjs/integrations/tracing/mongoose/vendored/utils.js +19 -49
  102. package/build/cjs/integrations/tracing/mongoose/vendored/utils.js.map +1 -1
  103. package/build/cjs/integrations/tracing/mysql/vendored/AttributeNames.js.map +1 -1
  104. package/build/cjs/integrations/tracing/mysql/vendored/instrumentation.js.map +1 -1
  105. package/build/cjs/integrations/tracing/mysql/vendored/semconv.js.map +1 -1
  106. package/build/cjs/integrations/tracing/mysql/vendored/utils.js.map +1 -1
  107. package/build/cjs/integrations/tracing/mysql2/index.js +1 -8
  108. package/build/cjs/integrations/tracing/mysql2/index.js.map +1 -1
  109. package/build/cjs/integrations/tracing/mysql2/vendored/instrumentation.js +21 -59
  110. package/build/cjs/integrations/tracing/mysql2/vendored/instrumentation.js.map +1 -1
  111. package/build/cjs/integrations/tracing/mysql2/vendored/semconv.js.map +1 -1
  112. package/build/cjs/integrations/tracing/mysql2/vendored/utils.js +14 -33
  113. package/build/cjs/integrations/tracing/mysql2/vendored/utils.js.map +1 -1
  114. package/build/cjs/integrations/tracing/postgres/index.js +0 -4
  115. package/build/cjs/integrations/tracing/postgres/index.js.map +1 -1
  116. package/build/cjs/integrations/tracing/postgres/vendored/enums/AttributeNames.js +0 -1
  117. package/build/cjs/integrations/tracing/postgres/vendored/enums/AttributeNames.js.map +1 -1
  118. package/build/cjs/integrations/tracing/postgres/vendored/enums/SpanNames.js.map +1 -1
  119. package/build/cjs/integrations/tracing/postgres/vendored/instrumentation.js +51 -261
  120. package/build/cjs/integrations/tracing/postgres/vendored/instrumentation.js.map +1 -1
  121. package/build/cjs/integrations/tracing/postgres/vendored/semconv.js +0 -12
  122. package/build/cjs/integrations/tracing/postgres/vendored/semconv.js.map +1 -1
  123. package/build/cjs/integrations/tracing/postgres/vendored/utils.js +43 -167
  124. package/build/cjs/integrations/tracing/postgres/vendored/utils.js.map +1 -1
  125. package/build/cjs/integrations/tracing/prisma/vendored/active-tracing-helper.js.map +1 -1
  126. package/build/cjs/integrations/tracing/prisma/vendored/constants.js.map +1 -1
  127. package/build/cjs/integrations/tracing/prisma/vendored/global.js.map +1 -1
  128. package/build/cjs/integrations/tracing/prisma/vendored/instrumentation.js.map +1 -1
  129. package/build/cjs/integrations/tracing/redis/index.js.map +1 -1
  130. package/build/cjs/integrations/tracing/redis/vendored/ioredis-instrumentation.js +89 -160
  131. package/build/cjs/integrations/tracing/redis/vendored/ioredis-instrumentation.js.map +1 -1
  132. package/build/cjs/integrations/tracing/redis/vendored/redis-common.js.map +1 -1
  133. package/build/cjs/integrations/tracing/redis/vendored/redis-instrumentation.js +92 -231
  134. package/build/cjs/integrations/tracing/redis/vendored/redis-instrumentation.js.map +1 -1
  135. package/build/cjs/integrations/tracing/redis/vendored/semconv.js +0 -2
  136. package/build/cjs/integrations/tracing/redis/vendored/semconv.js.map +1 -1
  137. package/build/cjs/integrations/tracing/tedious/index.js +1 -25
  138. package/build/cjs/integrations/tracing/tedious/index.js.map +1 -1
  139. package/build/cjs/integrations/tracing/tedious/vendored/instrumentation.js +25 -76
  140. package/build/cjs/integrations/tracing/tedious/vendored/instrumentation.js.map +1 -1
  141. package/build/cjs/integrations/tracing/tedious/vendored/semconv.js.map +1 -1
  142. package/build/cjs/integrations/tracing/tedious/vendored/utils.js.map +1 -1
  143. package/build/cjs/sdk/diagnosticsChannelInjection.js +21 -0
  144. package/build/cjs/sdk/diagnosticsChannelInjection.js.map +1 -0
  145. package/build/cjs/sdk/experimentalUseDiagnosticsChannelInjection.js +19 -0
  146. package/build/cjs/sdk/experimentalUseDiagnosticsChannelInjection.js.map +1 -0
  147. package/build/cjs/sdk/index.js +17 -1
  148. package/build/cjs/sdk/index.js.map +1 -1
  149. package/build/cjs/sdk/initOtel.js +2 -1
  150. package/build/cjs/sdk/initOtel.js.map +1 -1
  151. package/build/esm/index.js +2 -1
  152. package/build/esm/index.js.map +1 -1
  153. package/build/esm/integrations/fs/index.js +4 -85
  154. package/build/esm/integrations/fs/index.js.map +1 -1
  155. package/build/esm/integrations/fs/vendored/constants.js.map +1 -1
  156. package/build/esm/integrations/fs/vendored/instrumentation.js +147 -177
  157. package/build/esm/integrations/fs/vendored/instrumentation.js.map +1 -1
  158. package/build/esm/integrations/fs/vendored/utils.js.map +1 -1
  159. package/build/esm/integrations/node-fetch/index.js +8 -9
  160. package/build/esm/integrations/node-fetch/index.js.map +1 -1
  161. package/build/esm/integrations/node-fetch/vendored/semconv.js +15 -0
  162. package/build/esm/integrations/node-fetch/vendored/semconv.js.map +1 -0
  163. package/build/esm/integrations/node-fetch/vendored/undici.js +80 -116
  164. package/build/esm/integrations/node-fetch/vendored/undici.js.map +1 -1
  165. package/build/esm/integrations/tracing/amqplib/vendored/amqplib.js.map +1 -1
  166. package/build/esm/integrations/tracing/amqplib/vendored/semconv-obsolete.js.map +1 -1
  167. package/build/esm/integrations/tracing/amqplib/vendored/semconv.js.map +1 -1
  168. package/build/esm/integrations/tracing/amqplib/vendored/types.js.map +1 -1
  169. package/build/esm/integrations/tracing/amqplib/vendored/utils.js.map +1 -1
  170. package/build/esm/integrations/tracing/connect/index.js +1 -22
  171. package/build/esm/integrations/tracing/connect/index.js.map +1 -1
  172. package/build/esm/integrations/tracing/connect/vendored/enums/AttributeNames.js +1 -6
  173. package/build/esm/integrations/tracing/connect/vendored/enums/AttributeNames.js.map +1 -1
  174. package/build/esm/integrations/tracing/connect/vendored/instrumentation.js +36 -44
  175. package/build/esm/integrations/tracing/connect/vendored/instrumentation.js.map +1 -1
  176. package/build/esm/integrations/tracing/connect/vendored/internal-types.js.map +1 -1
  177. package/build/esm/integrations/tracing/connect/vendored/utils.js +3 -2
  178. package/build/esm/integrations/tracing/connect/vendored/utils.js.map +1 -1
  179. package/build/esm/integrations/tracing/dataloader/vendored/instrumentation.js.map +1 -1
  180. package/build/esm/integrations/tracing/fastify/v3/instrumentation.js +1 -1
  181. package/build/esm/integrations/tracing/fastify/v3/instrumentation.js.map +1 -1
  182. package/build/esm/integrations/tracing/fastify/vendored/instrumentation.js.map +1 -1
  183. package/build/esm/integrations/tracing/genericPool/index.js +3 -17
  184. package/build/esm/integrations/tracing/genericPool/index.js.map +1 -1
  185. package/build/esm/integrations/tracing/genericPool/vendored/instrumentation.js +31 -19
  186. package/build/esm/integrations/tracing/genericPool/vendored/instrumentation.js.map +1 -1
  187. package/build/esm/integrations/tracing/graphql/index.js +3 -53
  188. package/build/esm/integrations/tracing/graphql/index.js.map +1 -1
  189. package/build/esm/integrations/tracing/graphql/vendored/enum.js.map +1 -1
  190. package/build/esm/integrations/tracing/graphql/vendored/enums/AttributeNames.js +0 -2
  191. package/build/esm/integrations/tracing/graphql/vendored/enums/AttributeNames.js.map +1 -1
  192. package/build/esm/integrations/tracing/graphql/vendored/instrumentation.js +69 -59
  193. package/build/esm/integrations/tracing/graphql/vendored/instrumentation.js.map +1 -1
  194. package/build/esm/integrations/tracing/graphql/vendored/internal-types.js.map +1 -1
  195. package/build/esm/integrations/tracing/graphql/vendored/symbols.js.map +1 -1
  196. package/build/esm/integrations/tracing/graphql/vendored/utils.js +29 -62
  197. package/build/esm/integrations/tracing/graphql/vendored/utils.js.map +1 -1
  198. package/build/esm/integrations/tracing/hapi/index.js +1 -18
  199. package/build/esm/integrations/tracing/hapi/index.js.map +1 -1
  200. package/build/esm/integrations/tracing/hapi/vendored/enums/AttributeNames.js.map +1 -1
  201. package/build/esm/integrations/tracing/hapi/vendored/instrumentation.js +30 -47
  202. package/build/esm/integrations/tracing/hapi/vendored/instrumentation.js.map +1 -1
  203. package/build/esm/integrations/tracing/hapi/vendored/internal-types.js.map +1 -1
  204. package/build/esm/integrations/tracing/hapi/vendored/semconv.js.map +1 -1
  205. package/build/esm/integrations/tracing/hapi/vendored/utils.js +5 -10
  206. package/build/esm/integrations/tracing/hapi/vendored/utils.js.map +1 -1
  207. package/build/esm/integrations/tracing/index.js +1 -0
  208. package/build/esm/integrations/tracing/index.js.map +1 -1
  209. package/build/esm/integrations/tracing/kafka/index.js +2 -12
  210. package/build/esm/integrations/tracing/kafka/index.js.map +1 -1
  211. package/build/esm/integrations/tracing/kafka/vendored/instrumentation.js +47 -249
  212. package/build/esm/integrations/tracing/kafka/vendored/instrumentation.js.map +1 -1
  213. package/build/esm/integrations/tracing/kafka/vendored/semconv.js +3 -5
  214. package/build/esm/integrations/tracing/kafka/vendored/semconv.js.map +1 -1
  215. package/build/esm/integrations/tracing/kafka/vendored/utils.js +107 -0
  216. package/build/esm/integrations/tracing/kafka/vendored/utils.js.map +1 -0
  217. package/build/esm/integrations/tracing/knex/index.js +4 -19
  218. package/build/esm/integrations/tracing/knex/index.js.map +1 -1
  219. package/build/esm/integrations/tracing/knex/vendored/instrumentation.js +66 -94
  220. package/build/esm/integrations/tracing/knex/vendored/instrumentation.js.map +1 -1
  221. package/build/esm/integrations/tracing/knex/vendored/semconv.js +2 -1
  222. package/build/esm/integrations/tracing/knex/vendored/semconv.js.map +1 -1
  223. package/build/esm/integrations/tracing/knex/vendored/utils.js +3 -15
  224. package/build/esm/integrations/tracing/knex/vendored/utils.js.map +1 -1
  225. package/build/esm/integrations/tracing/koa/index.js +3 -26
  226. package/build/esm/integrations/tracing/koa/index.js.map +1 -1
  227. package/build/esm/integrations/tracing/koa/vendored/enums/AttributeNames.js.map +1 -1
  228. package/build/esm/integrations/tracing/koa/vendored/instrumentation.js +31 -43
  229. package/build/esm/integrations/tracing/koa/vendored/instrumentation.js.map +1 -1
  230. package/build/esm/integrations/tracing/koa/vendored/internal-types.js.map +1 -1
  231. package/build/esm/integrations/tracing/koa/vendored/types.js.map +1 -1
  232. package/build/esm/integrations/tracing/koa/vendored/utils.js.map +1 -1
  233. package/build/esm/integrations/tracing/lrumemoizer/vendored/instrumentation.js.map +1 -1
  234. package/build/esm/integrations/tracing/mongo/index.js +3 -43
  235. package/build/esm/integrations/tracing/mongo/index.js.map +1 -1
  236. package/build/esm/integrations/tracing/mongo/vendored/instrumentation.js +13 -563
  237. package/build/esm/integrations/tracing/mongo/vendored/instrumentation.js.map +1 -1
  238. package/build/esm/integrations/tracing/mongo/vendored/internal-types.js.map +1 -1
  239. package/build/esm/integrations/tracing/mongo/vendored/patches.js +143 -0
  240. package/build/esm/integrations/tracing/mongo/vendored/patches.js.map +1 -0
  241. package/build/esm/integrations/tracing/mongo/vendored/semconv.js +1 -3
  242. package/build/esm/integrations/tracing/mongo/vendored/semconv.js.map +1 -1
  243. package/build/esm/integrations/tracing/mongo/vendored/utils.js +146 -0
  244. package/build/esm/integrations/tracing/mongo/vendored/utils.js.map +1 -0
  245. package/build/esm/integrations/tracing/mongoose/index.js +2 -9
  246. package/build/esm/integrations/tracing/mongoose/index.js.map +1 -1
  247. package/build/esm/integrations/tracing/mongoose/vendored/mongoose.js +59 -206
  248. package/build/esm/integrations/tracing/mongoose/vendored/mongoose.js.map +1 -1
  249. package/build/esm/integrations/tracing/mongoose/vendored/semconv.js +1 -3
  250. package/build/esm/integrations/tracing/mongoose/vendored/semconv.js.map +1 -1
  251. package/build/esm/integrations/tracing/mongoose/vendored/utils.js +20 -50
  252. package/build/esm/integrations/tracing/mongoose/vendored/utils.js.map +1 -1
  253. package/build/esm/integrations/tracing/mysql/vendored/AttributeNames.js.map +1 -1
  254. package/build/esm/integrations/tracing/mysql/vendored/instrumentation.js.map +1 -1
  255. package/build/esm/integrations/tracing/mysql/vendored/semconv.js.map +1 -1
  256. package/build/esm/integrations/tracing/mysql/vendored/utils.js.map +1 -1
  257. package/build/esm/integrations/tracing/mysql2/index.js +2 -9
  258. package/build/esm/integrations/tracing/mysql2/index.js.map +1 -1
  259. package/build/esm/integrations/tracing/mysql2/vendored/instrumentation.js +26 -64
  260. package/build/esm/integrations/tracing/mysql2/vendored/instrumentation.js.map +1 -1
  261. package/build/esm/integrations/tracing/mysql2/vendored/semconv.js.map +1 -1
  262. package/build/esm/integrations/tracing/mysql2/vendored/utils.js +15 -34
  263. package/build/esm/integrations/tracing/mysql2/vendored/utils.js.map +1 -1
  264. package/build/esm/integrations/tracing/postgres/index.js +1 -5
  265. package/build/esm/integrations/tracing/postgres/index.js.map +1 -1
  266. package/build/esm/integrations/tracing/postgres/vendored/enums/AttributeNames.js +0 -1
  267. package/build/esm/integrations/tracing/postgres/vendored/enums/AttributeNames.js.map +1 -1
  268. package/build/esm/integrations/tracing/postgres/vendored/enums/SpanNames.js.map +1 -1
  269. package/build/esm/integrations/tracing/postgres/vendored/instrumentation.js +52 -262
  270. package/build/esm/integrations/tracing/postgres/vendored/instrumentation.js.map +1 -1
  271. package/build/esm/integrations/tracing/postgres/vendored/semconv.js +1 -7
  272. package/build/esm/integrations/tracing/postgres/vendored/semconv.js.map +1 -1
  273. package/build/esm/integrations/tracing/postgres/vendored/utils.js +44 -165
  274. package/build/esm/integrations/tracing/postgres/vendored/utils.js.map +1 -1
  275. package/build/esm/integrations/tracing/prisma/vendored/active-tracing-helper.js.map +1 -1
  276. package/build/esm/integrations/tracing/prisma/vendored/constants.js.map +1 -1
  277. package/build/esm/integrations/tracing/prisma/vendored/global.js.map +1 -1
  278. package/build/esm/integrations/tracing/prisma/vendored/instrumentation.js.map +1 -1
  279. package/build/esm/integrations/tracing/redis/index.js.map +1 -1
  280. package/build/esm/integrations/tracing/redis/vendored/ioredis-instrumentation.js +92 -163
  281. package/build/esm/integrations/tracing/redis/vendored/ioredis-instrumentation.js.map +1 -1
  282. package/build/esm/integrations/tracing/redis/vendored/redis-common.js.map +1 -1
  283. package/build/esm/integrations/tracing/redis/vendored/redis-instrumentation.js +94 -233
  284. package/build/esm/integrations/tracing/redis/vendored/redis-instrumentation.js.map +1 -1
  285. package/build/esm/integrations/tracing/redis/vendored/semconv.js +1 -2
  286. package/build/esm/integrations/tracing/redis/vendored/semconv.js.map +1 -1
  287. package/build/esm/integrations/tracing/tedious/index.js +3 -27
  288. package/build/esm/integrations/tracing/tedious/index.js.map +1 -1
  289. package/build/esm/integrations/tracing/tedious/vendored/instrumentation.js +29 -79
  290. package/build/esm/integrations/tracing/tedious/vendored/instrumentation.js.map +1 -1
  291. package/build/esm/integrations/tracing/tedious/vendored/semconv.js.map +1 -1
  292. package/build/esm/integrations/tracing/tedious/vendored/utils.js.map +1 -1
  293. package/build/esm/package.json +1 -1
  294. package/build/esm/sdk/diagnosticsChannelInjection.js +17 -0
  295. package/build/esm/sdk/diagnosticsChannelInjection.js.map +1 -0
  296. package/build/esm/sdk/experimentalUseDiagnosticsChannelInjection.js +17 -0
  297. package/build/esm/sdk/experimentalUseDiagnosticsChannelInjection.js.map +1 -0
  298. package/build/esm/sdk/index.js +17 -1
  299. package/build/esm/sdk/index.js.map +1 -1
  300. package/build/esm/sdk/initOtel.js +2 -1
  301. package/build/esm/sdk/initOtel.js.map +1 -1
  302. package/build/import-hook.mjs +6 -0
  303. package/build/types/index.d.ts +2 -1
  304. package/build/types/index.d.ts.map +1 -1
  305. package/build/types/integrations/fs/index.d.ts.map +1 -1
  306. package/build/types/integrations/fs/vendored/constants.d.ts.map +1 -1
  307. package/build/types/integrations/fs/vendored/instrumentation.d.ts +6 -10
  308. package/build/types/integrations/fs/vendored/instrumentation.d.ts.map +1 -1
  309. package/build/types/integrations/fs/vendored/types.d.ts +10 -15
  310. package/build/types/integrations/fs/vendored/types.d.ts.map +1 -1
  311. package/build/types/integrations/fs/vendored/utils.d.ts +2 -2
  312. package/build/types/integrations/fs/vendored/utils.d.ts.map +1 -1
  313. package/build/types/integrations/node-fetch/index.d.ts.map +1 -1
  314. package/build/types/integrations/node-fetch/vendored/internal-types.d.ts.map +1 -1
  315. package/build/types/integrations/node-fetch/vendored/semconv.d.ts +13 -0
  316. package/build/types/integrations/node-fetch/vendored/semconv.d.ts.map +1 -0
  317. package/build/types/integrations/node-fetch/vendored/types.d.ts +2 -4
  318. package/build/types/integrations/node-fetch/vendored/types.d.ts.map +1 -1
  319. package/build/types/integrations/node-fetch/vendored/undici.d.ts +6 -7
  320. package/build/types/integrations/node-fetch/vendored/undici.d.ts.map +1 -1
  321. package/build/types/integrations/tracing/amqplib/vendored/amqplib.d.ts.map +1 -1
  322. package/build/types/integrations/tracing/amqplib/vendored/semconv-obsolete.d.ts.map +1 -1
  323. package/build/types/integrations/tracing/amqplib/vendored/semconv.d.ts.map +1 -1
  324. package/build/types/integrations/tracing/amqplib/vendored/types.d.ts.map +1 -1
  325. package/build/types/integrations/tracing/amqplib/vendored/utils.d.ts.map +1 -1
  326. package/build/types/integrations/tracing/connect/index.d.ts.map +1 -1
  327. package/build/types/integrations/tracing/connect/vendored/enums/AttributeNames.d.ts +0 -4
  328. package/build/types/integrations/tracing/connect/vendored/enums/AttributeNames.d.ts.map +1 -1
  329. package/build/types/integrations/tracing/connect/vendored/instrumentation.d.ts +5 -5
  330. package/build/types/integrations/tracing/connect/vendored/instrumentation.d.ts.map +1 -1
  331. package/build/types/integrations/tracing/connect/vendored/internal-types.d.ts +2 -2
  332. package/build/types/integrations/tracing/connect/vendored/internal-types.d.ts.map +1 -1
  333. package/build/types/integrations/tracing/connect/vendored/utils.d.ts +1 -1
  334. package/build/types/integrations/tracing/connect/vendored/utils.d.ts.map +1 -1
  335. package/build/types/integrations/tracing/dataloader/vendored/instrumentation.d.ts.map +1 -1
  336. package/build/types/integrations/tracing/dataloader/vendored/types.d.ts.map +1 -1
  337. package/build/types/integrations/tracing/fastify/vendored/instrumentation.d.ts.map +1 -1
  338. package/build/types/integrations/tracing/genericPool/index.d.ts.map +1 -1
  339. package/build/types/integrations/tracing/genericPool/vendored/instrumentation.d.ts.map +1 -1
  340. package/build/types/integrations/tracing/graphql/index.d.ts.map +1 -1
  341. package/build/types/integrations/tracing/graphql/vendored/enum.d.ts.map +1 -1
  342. package/build/types/integrations/tracing/graphql/vendored/enums/AttributeNames.d.ts +1 -3
  343. package/build/types/integrations/tracing/graphql/vendored/enums/AttributeNames.d.ts.map +1 -1
  344. package/build/types/integrations/tracing/graphql/vendored/instrumentation.d.ts +7 -2
  345. package/build/types/integrations/tracing/graphql/vendored/instrumentation.d.ts.map +1 -1
  346. package/build/types/integrations/tracing/graphql/vendored/internal-types.d.ts +4 -4
  347. package/build/types/integrations/tracing/graphql/vendored/internal-types.d.ts.map +1 -1
  348. package/build/types/integrations/tracing/graphql/vendored/symbols.d.ts.map +1 -1
  349. package/build/types/integrations/tracing/graphql/vendored/types.d.ts +5 -43
  350. package/build/types/integrations/tracing/graphql/vendored/types.d.ts.map +1 -1
  351. package/build/types/integrations/tracing/graphql/vendored/utils.d.ts +8 -11
  352. package/build/types/integrations/tracing/graphql/vendored/utils.d.ts.map +1 -1
  353. package/build/types/integrations/tracing/hapi/index.d.ts.map +1 -1
  354. package/build/types/integrations/tracing/hapi/vendored/enums/AttributeNames.d.ts.map +1 -1
  355. package/build/types/integrations/tracing/hapi/vendored/instrumentation.d.ts +2 -2
  356. package/build/types/integrations/tracing/hapi/vendored/instrumentation.d.ts.map +1 -1
  357. package/build/types/integrations/tracing/hapi/vendored/internal-types.d.ts.map +1 -1
  358. package/build/types/integrations/tracing/hapi/vendored/semconv.d.ts.map +1 -1
  359. package/build/types/integrations/tracing/hapi/vendored/utils.d.ts +3 -4
  360. package/build/types/integrations/tracing/hapi/vendored/utils.d.ts.map +1 -1
  361. package/build/types/integrations/tracing/index.d.ts.map +1 -1
  362. package/build/types/integrations/tracing/kafka/index.d.ts.map +1 -1
  363. package/build/types/integrations/tracing/kafka/vendored/instrumentation.d.ts +3 -13
  364. package/build/types/integrations/tracing/kafka/vendored/instrumentation.d.ts.map +1 -1
  365. package/build/types/integrations/tracing/kafka/vendored/kafkajs-types.d.ts +0 -32
  366. package/build/types/integrations/tracing/kafka/vendored/kafkajs-types.d.ts.map +1 -1
  367. package/build/types/integrations/tracing/kafka/vendored/semconv.d.ts +9 -28
  368. package/build/types/integrations/tracing/kafka/vendored/semconv.d.ts.map +1 -1
  369. package/build/types/integrations/tracing/kafka/vendored/utils.d.ts +29 -0
  370. package/build/types/integrations/tracing/kafka/vendored/utils.d.ts.map +1 -0
  371. package/build/types/integrations/tracing/knex/index.d.ts.map +1 -1
  372. package/build/types/integrations/tracing/knex/vendored/instrumentation.d.ts +8 -10
  373. package/build/types/integrations/tracing/knex/vendored/instrumentation.d.ts.map +1 -1
  374. package/build/types/integrations/tracing/knex/vendored/semconv.d.ts +1 -0
  375. package/build/types/integrations/tracing/knex/vendored/semconv.d.ts.map +1 -1
  376. package/build/types/integrations/tracing/knex/vendored/utils.d.ts +0 -6
  377. package/build/types/integrations/tracing/knex/vendored/utils.d.ts.map +1 -1
  378. package/build/types/integrations/tracing/koa/index.d.ts.map +1 -1
  379. package/build/types/integrations/tracing/koa/vendored/enums/AttributeNames.d.ts.map +1 -1
  380. package/build/types/integrations/tracing/koa/vendored/instrumentation.d.ts +1 -1
  381. package/build/types/integrations/tracing/koa/vendored/instrumentation.d.ts.map +1 -1
  382. package/build/types/integrations/tracing/koa/vendored/internal-types.d.ts +4 -4
  383. package/build/types/integrations/tracing/koa/vendored/internal-types.d.ts.map +1 -1
  384. package/build/types/integrations/tracing/koa/vendored/types.d.ts +2 -39
  385. package/build/types/integrations/tracing/koa/vendored/types.d.ts.map +1 -1
  386. package/build/types/integrations/tracing/koa/vendored/utils.d.ts +3 -3
  387. package/build/types/integrations/tracing/koa/vendored/utils.d.ts.map +1 -1
  388. package/build/types/integrations/tracing/lrumemoizer/vendored/instrumentation.d.ts.map +1 -1
  389. package/build/types/integrations/tracing/mongo/index.d.ts +0 -4
  390. package/build/types/integrations/tracing/mongo/index.d.ts.map +1 -1
  391. package/build/types/integrations/tracing/mongo/vendored/instrumentation.d.ts +4 -72
  392. package/build/types/integrations/tracing/mongo/vendored/instrumentation.d.ts.map +1 -1
  393. package/build/types/integrations/tracing/mongo/vendored/internal-types.d.ts +0 -59
  394. package/build/types/integrations/tracing/mongo/vendored/internal-types.d.ts.map +1 -1
  395. package/build/types/integrations/tracing/mongo/vendored/patches.d.ts +15 -0
  396. package/build/types/integrations/tracing/mongo/vendored/patches.d.ts.map +1 -0
  397. package/build/types/integrations/tracing/mongo/vendored/semconv.d.ts +0 -54
  398. package/build/types/integrations/tracing/mongo/vendored/semconv.d.ts.map +1 -1
  399. package/build/types/integrations/tracing/mongo/vendored/utils.d.ts +24 -0
  400. package/build/types/integrations/tracing/mongo/vendored/utils.d.ts.map +1 -0
  401. package/build/types/integrations/tracing/mongoose/index.d.ts.map +1 -1
  402. package/build/types/integrations/tracing/mongoose/vendored/mongoose-types.d.ts +3 -0
  403. package/build/types/integrations/tracing/mongoose/vendored/mongoose-types.d.ts.map +1 -1
  404. package/build/types/integrations/tracing/mongoose/vendored/mongoose.d.ts +3 -8
  405. package/build/types/integrations/tracing/mongoose/vendored/mongoose.d.ts.map +1 -1
  406. package/build/types/integrations/tracing/mongoose/vendored/semconv.d.ts +0 -14
  407. package/build/types/integrations/tracing/mongoose/vendored/semconv.d.ts.map +1 -1
  408. package/build/types/integrations/tracing/mongoose/vendored/utils.d.ts +4 -6
  409. package/build/types/integrations/tracing/mongoose/vendored/utils.d.ts.map +1 -1
  410. package/build/types/integrations/tracing/mysql/vendored/AttributeNames.d.ts.map +1 -1
  411. package/build/types/integrations/tracing/mysql/vendored/instrumentation.d.ts.map +1 -1
  412. package/build/types/integrations/tracing/mysql/vendored/mysql-types.d.ts.map +1 -1
  413. package/build/types/integrations/tracing/mysql/vendored/semconv.d.ts.map +1 -1
  414. package/build/types/integrations/tracing/mysql/vendored/types.d.ts.map +1 -1
  415. package/build/types/integrations/tracing/mysql/vendored/utils.d.ts.map +1 -1
  416. package/build/types/integrations/tracing/mysql2/index.d.ts.map +1 -1
  417. package/build/types/integrations/tracing/mysql2/vendored/instrumentation.d.ts +3 -6
  418. package/build/types/integrations/tracing/mysql2/vendored/instrumentation.d.ts.map +1 -1
  419. package/build/types/integrations/tracing/mysql2/vendored/semconv.d.ts.map +1 -1
  420. package/build/types/integrations/tracing/mysql2/vendored/utils.d.ts +3 -5
  421. package/build/types/integrations/tracing/mysql2/vendored/utils.d.ts.map +1 -1
  422. package/build/types/integrations/tracing/postgres/index.d.ts.map +1 -1
  423. package/build/types/integrations/tracing/postgres/vendored/enums/AttributeNames.d.ts +0 -1
  424. package/build/types/integrations/tracing/postgres/vendored/enums/AttributeNames.d.ts.map +1 -1
  425. package/build/types/integrations/tracing/postgres/vendored/enums/SpanNames.d.ts.map +1 -1
  426. package/build/types/integrations/tracing/postgres/vendored/instrumentation.d.ts +1 -9
  427. package/build/types/integrations/tracing/postgres/vendored/instrumentation.d.ts.map +1 -1
  428. package/build/types/integrations/tracing/postgres/vendored/internal-types.d.ts +0 -2
  429. package/build/types/integrations/tracing/postgres/vendored/internal-types.d.ts.map +1 -1
  430. package/build/types/integrations/tracing/postgres/vendored/pg-pool-types.d.ts.map +1 -1
  431. package/build/types/integrations/tracing/postgres/vendored/pg-types.d.ts.map +1 -1
  432. package/build/types/integrations/tracing/postgres/vendored/semconv.d.ts +0 -50
  433. package/build/types/integrations/tracing/postgres/vendored/semconv.d.ts.map +1 -1
  434. package/build/types/integrations/tracing/postgres/vendored/types.d.ts +2 -56
  435. package/build/types/integrations/tracing/postgres/vendored/types.d.ts.map +1 -1
  436. package/build/types/integrations/tracing/postgres/vendored/utils.d.ts +13 -26
  437. package/build/types/integrations/tracing/postgres/vendored/utils.d.ts.map +1 -1
  438. package/build/types/integrations/tracing/prisma/vendored/active-tracing-helper.d.ts.map +1 -1
  439. package/build/types/integrations/tracing/prisma/vendored/constants.d.ts.map +1 -1
  440. package/build/types/integrations/tracing/prisma/vendored/global.d.ts.map +1 -1
  441. package/build/types/integrations/tracing/prisma/vendored/instrumentation.d.ts.map +1 -1
  442. package/build/types/integrations/tracing/prisma/vendored/types.d.ts.map +1 -1
  443. package/build/types/integrations/tracing/redis/index.d.ts.map +1 -1
  444. package/build/types/integrations/tracing/redis/vendored/ioredis-instrumentation.d.ts +3 -8
  445. package/build/types/integrations/tracing/redis/vendored/ioredis-instrumentation.d.ts.map +1 -1
  446. package/build/types/integrations/tracing/redis/vendored/redis-common.d.ts.map +1 -1
  447. package/build/types/integrations/tracing/redis/vendored/redis-instrumentation.d.ts.map +1 -1
  448. package/build/types/integrations/tracing/redis/vendored/semconv.d.ts.map +1 -1
  449. package/build/types/integrations/tracing/redis/vendored/types.d.ts +2 -36
  450. package/build/types/integrations/tracing/redis/vendored/types.d.ts.map +1 -1
  451. package/build/types/integrations/tracing/tedious/index.d.ts.map +1 -1
  452. package/build/types/integrations/tracing/tedious/vendored/instrumentation.d.ts +3 -14
  453. package/build/types/integrations/tracing/tedious/vendored/instrumentation.d.ts.map +1 -1
  454. package/build/types/integrations/tracing/tedious/vendored/semconv.d.ts.map +1 -1
  455. package/build/types/integrations/tracing/tedious/vendored/utils.d.ts.map +1 -1
  456. package/build/types/sdk/diagnosticsChannelInjection.d.ts +41 -0
  457. package/build/types/sdk/diagnosticsChannelInjection.d.ts.map +1 -0
  458. package/build/types/sdk/experimentalUseDiagnosticsChannelInjection.d.ts +34 -0
  459. package/build/types/sdk/experimentalUseDiagnosticsChannelInjection.d.ts.map +1 -0
  460. package/build/types/sdk/index.d.ts.map +1 -1
  461. package/build/types/sdk/initOtel.d.ts.map +1 -1
  462. package/build/types-ts3.8/index.d.ts +2 -1
  463. package/build/types-ts3.8/integrations/fs/vendored/instrumentation.d.ts +6 -10
  464. package/build/types-ts3.8/integrations/fs/vendored/types.d.ts +10 -15
  465. package/build/types-ts3.8/integrations/fs/vendored/utils.d.ts +2 -2
  466. package/build/types-ts3.8/integrations/node-fetch/vendored/semconv.d.ts +13 -0
  467. package/build/types-ts3.8/integrations/node-fetch/vendored/types.d.ts +2 -4
  468. package/build/types-ts3.8/integrations/node-fetch/vendored/undici.d.ts +6 -7
  469. package/build/types-ts3.8/integrations/tracing/connect/vendored/enums/AttributeNames.d.ts +0 -4
  470. package/build/types-ts3.8/integrations/tracing/connect/vendored/instrumentation.d.ts +4 -4
  471. package/build/types-ts3.8/integrations/tracing/connect/vendored/internal-types.d.ts +2 -2
  472. package/build/types-ts3.8/integrations/tracing/graphql/vendored/enums/AttributeNames.d.ts +1 -3
  473. package/build/types-ts3.8/integrations/tracing/graphql/vendored/instrumentation.d.ts +6 -1
  474. package/build/types-ts3.8/integrations/tracing/graphql/vendored/internal-types.d.ts +3 -3
  475. package/build/types-ts3.8/integrations/tracing/graphql/vendored/types.d.ts +4 -42
  476. package/build/types-ts3.8/integrations/tracing/graphql/vendored/utils.d.ts +6 -9
  477. package/build/types-ts3.8/integrations/tracing/hapi/vendored/instrumentation.d.ts +2 -2
  478. package/build/types-ts3.8/integrations/tracing/hapi/vendored/utils.d.ts +1 -2
  479. package/build/types-ts3.8/integrations/tracing/kafka/vendored/instrumentation.d.ts +3 -13
  480. package/build/types-ts3.8/integrations/tracing/kafka/vendored/kafkajs-types.d.ts +0 -32
  481. package/build/types-ts3.8/integrations/tracing/kafka/vendored/semconv.d.ts +9 -28
  482. package/build/types-ts3.8/integrations/tracing/kafka/vendored/utils.d.ts +29 -0
  483. package/build/types-ts3.8/integrations/tracing/knex/vendored/instrumentation.d.ts +8 -10
  484. package/build/types-ts3.8/integrations/tracing/knex/vendored/semconv.d.ts +1 -0
  485. package/build/types-ts3.8/integrations/tracing/knex/vendored/utils.d.ts +0 -6
  486. package/build/types-ts3.8/integrations/tracing/koa/vendored/internal-types.d.ts +4 -4
  487. package/build/types-ts3.8/integrations/tracing/koa/vendored/types.d.ts +1 -38
  488. package/build/types-ts3.8/integrations/tracing/mongo/index.d.ts +0 -4
  489. package/build/types-ts3.8/integrations/tracing/mongo/vendored/instrumentation.d.ts +4 -72
  490. package/build/types-ts3.8/integrations/tracing/mongo/vendored/internal-types.d.ts +0 -59
  491. package/build/types-ts3.8/integrations/tracing/mongo/vendored/patches.d.ts +15 -0
  492. package/build/types-ts3.8/integrations/tracing/mongo/vendored/semconv.d.ts +0 -54
  493. package/build/types-ts3.8/integrations/tracing/mongo/vendored/utils.d.ts +24 -0
  494. package/build/types-ts3.8/integrations/tracing/mongoose/vendored/mongoose-types.d.ts +3 -0
  495. package/build/types-ts3.8/integrations/tracing/mongoose/vendored/mongoose.d.ts +3 -8
  496. package/build/types-ts3.8/integrations/tracing/mongoose/vendored/semconv.d.ts +0 -14
  497. package/build/types-ts3.8/integrations/tracing/mongoose/vendored/utils.d.ts +4 -6
  498. package/build/types-ts3.8/integrations/tracing/mysql2/vendored/instrumentation.d.ts +3 -6
  499. package/build/types-ts3.8/integrations/tracing/mysql2/vendored/utils.d.ts +3 -5
  500. package/build/types-ts3.8/integrations/tracing/postgres/vendored/enums/AttributeNames.d.ts +0 -1
  501. package/build/types-ts3.8/integrations/tracing/postgres/vendored/instrumentation.d.ts +0 -8
  502. package/build/types-ts3.8/integrations/tracing/postgres/vendored/internal-types.d.ts +0 -2
  503. package/build/types-ts3.8/integrations/tracing/postgres/vendored/semconv.d.ts +0 -50
  504. package/build/types-ts3.8/integrations/tracing/postgres/vendored/types.d.ts +1 -55
  505. package/build/types-ts3.8/integrations/tracing/postgres/vendored/utils.d.ts +13 -26
  506. package/build/types-ts3.8/integrations/tracing/redis/vendored/ioredis-instrumentation.d.ts +3 -8
  507. package/build/types-ts3.8/integrations/tracing/redis/vendored/types.d.ts +2 -36
  508. package/build/types-ts3.8/integrations/tracing/tedious/vendored/instrumentation.d.ts +3 -14
  509. package/build/types-ts3.8/sdk/diagnosticsChannelInjection.d.ts +41 -0
  510. package/build/types-ts3.8/sdk/experimentalUseDiagnosticsChannelInjection.d.ts +34 -0
  511. package/package.json +20 -7
  512. package/build/cjs/integrations/tracing/kafka/vendored/internal-types.js +0 -6
  513. package/build/cjs/integrations/tracing/kafka/vendored/internal-types.js.map +0 -1
  514. package/build/cjs/integrations/tracing/kafka/vendored/propagator.js +0 -22
  515. package/build/cjs/integrations/tracing/kafka/vendored/propagator.js.map +0 -1
  516. package/build/cjs/integrations/tracing/knex/vendored/constants.js +0 -16
  517. package/build/cjs/integrations/tracing/knex/vendored/constants.js.map +0 -1
  518. package/build/cjs/integrations/tracing/postgres/vendored/internal-types.js +0 -6
  519. package/build/cjs/integrations/tracing/postgres/vendored/internal-types.js.map +0 -1
  520. package/build/cjs/integrations/tracing/utils/sql-common.js +0 -43
  521. package/build/cjs/integrations/tracing/utils/sql-common.js.map +0 -1
  522. package/build/esm/integrations/tracing/kafka/vendored/internal-types.js +0 -4
  523. package/build/esm/integrations/tracing/kafka/vendored/internal-types.js.map +0 -1
  524. package/build/esm/integrations/tracing/kafka/vendored/propagator.js +0 -20
  525. package/build/esm/integrations/tracing/kafka/vendored/propagator.js.map +0 -1
  526. package/build/esm/integrations/tracing/knex/vendored/constants.js +0 -13
  527. package/build/esm/integrations/tracing/knex/vendored/constants.js.map +0 -1
  528. package/build/esm/integrations/tracing/postgres/vendored/internal-types.js +0 -4
  529. package/build/esm/integrations/tracing/postgres/vendored/internal-types.js.map +0 -1
  530. package/build/esm/integrations/tracing/utils/sql-common.js +0 -41
  531. package/build/esm/integrations/tracing/utils/sql-common.js.map +0 -1
  532. package/build/types/integrations/tracing/kafka/vendored/internal-types.d.ts +0 -9
  533. package/build/types/integrations/tracing/kafka/vendored/internal-types.d.ts.map +0 -1
  534. package/build/types/integrations/tracing/kafka/vendored/propagator.d.ts +0 -3
  535. package/build/types/integrations/tracing/kafka/vendored/propagator.d.ts.map +0 -1
  536. package/build/types/integrations/tracing/kafka/vendored/types.d.ts +0 -26
  537. package/build/types/integrations/tracing/kafka/vendored/types.d.ts.map +0 -1
  538. package/build/types/integrations/tracing/knex/vendored/constants.d.ts +0 -3
  539. package/build/types/integrations/tracing/knex/vendored/constants.d.ts.map +0 -1
  540. package/build/types/integrations/tracing/knex/vendored/types.d.ts +0 -8
  541. package/build/types/integrations/tracing/knex/vendored/types.d.ts.map +0 -1
  542. package/build/types/integrations/tracing/mongo/vendored/types.d.ts +0 -51
  543. package/build/types/integrations/tracing/mongo/vendored/types.d.ts.map +0 -1
  544. package/build/types/integrations/tracing/mongoose/vendored/types.d.ts +0 -36
  545. package/build/types/integrations/tracing/mongoose/vendored/types.d.ts.map +0 -1
  546. package/build/types/integrations/tracing/mysql2/vendored/types.d.ts +0 -18
  547. package/build/types/integrations/tracing/mysql2/vendored/types.d.ts.map +0 -1
  548. package/build/types/integrations/tracing/tedious/vendored/types.d.ts +0 -10
  549. package/build/types/integrations/tracing/tedious/vendored/types.d.ts.map +0 -1
  550. package/build/types/integrations/tracing/utils/sql-common.d.ts +0 -3
  551. package/build/types/integrations/tracing/utils/sql-common.d.ts.map +0 -1
  552. package/build/types-ts3.8/integrations/tracing/kafka/vendored/internal-types.d.ts +0 -9
  553. package/build/types-ts3.8/integrations/tracing/kafka/vendored/propagator.d.ts +0 -3
  554. package/build/types-ts3.8/integrations/tracing/kafka/vendored/types.d.ts +0 -26
  555. package/build/types-ts3.8/integrations/tracing/knex/vendored/constants.d.ts +0 -3
  556. package/build/types-ts3.8/integrations/tracing/knex/vendored/types.d.ts +0 -8
  557. package/build/types-ts3.8/integrations/tracing/mongo/vendored/types.d.ts +0 -51
  558. package/build/types-ts3.8/integrations/tracing/mongoose/vendored/types.d.ts +0 -36
  559. package/build/types-ts3.8/integrations/tracing/mysql2/vendored/types.d.ts +0 -18
  560. package/build/types-ts3.8/integrations/tracing/tedious/vendored/types.d.ts +0 -10
  561. package/build/types-ts3.8/integrations/tracing/utils/sql-common.d.ts +0 -3
@@ -1,10 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
 
3
3
  const instrumentation = require('./vendored/instrumentation.js');
4
- const semanticConventions = require('@opentelemetry/semantic-conventions');
5
4
  const core = require('@sentry/core');
6
5
  const nodeCore = require('@sentry/node-core');
7
- const debugBuild = require('../../../debug-build.js');
8
6
 
9
7
  const INTEGRATION_NAME = "Koa";
10
8
  const instrumentKoa = nodeCore.generateInstrumentOnce(
@@ -12,28 +10,7 @@ const instrumentKoa = nodeCore.generateInstrumentOnce(
12
10
  instrumentation.KoaInstrumentation,
13
11
  (options = {}) => {
14
12
  return {
15
- ignoreLayersType: options.ignoreLayersType,
16
- requestHook(span, info) {
17
- nodeCore.addOriginToSpan(span, "auto.http.otel.koa");
18
- const attributes = core.spanToJSON(span).data;
19
- const type = attributes["koa.type"];
20
- if (type) {
21
- span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_OP, `${type}.koa`);
22
- }
23
- const name = attributes["koa.name"];
24
- if (typeof name === "string") {
25
- span.updateName(name || "< unknown >");
26
- }
27
- if (core.getIsolationScope() === core.getDefaultIsolationScope()) {
28
- debugBuild.DEBUG_BUILD && core.debug.warn("Isolation scope is default isolation scope - skipping setting transactionName");
29
- return;
30
- }
31
- const route = attributes[semanticConventions.ATTR_HTTP_ROUTE];
32
- const method = info.context?.request?.method?.toUpperCase() || "GET";
33
- if (route) {
34
- core.getIsolationScope().setTransactionName(`${method} ${route}`);
35
- }
36
- }
13
+ ignoreLayersType: options.ignoreLayersType
37
14
  };
38
15
  }
39
16
  );
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/koa/index.ts"],"sourcesContent":["import type { KoaInstrumentationConfig, KoaLayerType } from './vendored/types';\nimport { KoaInstrumentation } from './vendored/instrumentation';\nimport { ATTR_HTTP_ROUTE } from '@opentelemetry/semantic-conventions';\nimport type { IntegrationFn } from '@sentry/core';\nimport {\n captureException,\n debug,\n defineIntegration,\n getDefaultIsolationScope,\n getIsolationScope,\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 && debug.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 mechanism: {\n handled: false,\n type: 'auto.middleware.koa',\n },\n });\n throw error;\n }\n });\n\n ensureIsWrapped(app.use, 'koa');\n};\n"],"names":["generateInstrumentOnce","KoaInstrumentation","addOriginToSpan","spanToJSON","SEMANTIC_ATTRIBUTE_SENTRY_OP","getIsolationScope","getDefaultIsolationScope","DEBUG_BUILD","debug","ATTR_HTTP_ROUTE","defineIntegration","captureException","ensureIsWrapped"],"mappings":";;;;;;;;AAuBA,MAAM,gBAAA,GAAmB,KAAA;AAElB,MAAM,aAAA,GAAgBA,+BAAA;AAAA,EAC3B,gBAAA;AAAA,EACAC,kCAAA;AAAA,EACA,CAAC,OAAA,GAAsB,EAAC,KAAM;AAC5B,IAAA,OAAO;AAAA,MACL,kBAAkB,OAAA,CAAQ,gBAAA;AAAA,MAC1B,WAAA,CAAY,MAAM,IAAA,EAAM;AACtB,QAAAC,wBAAA,CAAgB,MAAM,oBAAoB,CAAA;AAE1C,QAAA,MAAM,UAAA,GAAaC,eAAA,CAAW,IAAI,CAAA,CAAE,IAAA;AAGpC,QAAA,MAAM,IAAA,GAAO,WAAW,UAAU,CAAA;AAClC,QAAA,IAAI,IAAA,EAAM;AACR,UAAA,IAAA,CAAK,YAAA,CAAaC,iCAAA,EAA8B,CAAA,EAAG,IAAI,CAAA,IAAA,CAAM,CAAA;AAAA,QAC/D;AAGA,QAAA,MAAM,IAAA,GAAO,WAAW,UAAU,CAAA;AAClC,QAAA,IAAI,OAAO,SAAS,QAAA,EAAU;AAG5B,UAAA,IAAA,CAAK,UAAA,CAAW,QAAQ,aAAa,CAAA;AAAA,QACvC;AAEA,QAAA,IAAIC,sBAAA,EAAkB,KAAMC,6BAAA,EAAyB,EAAG;AACtD,UAAAC,sBAAA,IAAeC,UAAA,CAAM,KAAK,+EAA+E,CAAA;AACzG,UAAA;AAAA,QACF;AACA,QAAA,MAAM,KAAA,GAAQ,WAAWC,mCAAe,CAAA;AAExC,QAAA,MAAM,SAAS,IAAA,CAAK,OAAA,EAAS,OAAA,EAAS,MAAA,EAAQ,aAAY,IAAK,KAAA;AAC/D,QAAA,IAAI,KAAA,EAAO;AACT,UAAAJ,sBAAA,GAAoB,kBAAA,CAAmB,CAAA,EAAG,MAAM,CAAA,CAAA,EAAI,KAAK,CAAA,CAAE,CAAA;AAAA,QAC7D;AAAA,MACF;AAAA,KACF;AAAA,EACF;AACF;AAEA,MAAM,eAAA,IAAmB,CAAC,OAAA,GAAsB,EAAC,KAAM;AACrD,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AACV,MAAA,aAAA,CAAc,OAAO,CAAA;AAAA,IACvB;AAAA,GACF;AACF,CAAA,CAAA;AAkCO,MAAM,cAAA,GAAiBK,uBAAkB,eAAe;AAyBxD,MAAM,oBAAA,GAAuB,CAAC,GAAA,KAA+E;AAClH,EAAA,GAAA,CAAI,GAAA,CAAI,OAAO,GAAA,EAAK,IAAA,KAAS;AAC3B,IAAA,IAAI;AACF,MAAA,MAAM,IAAA,EAAK;AAAA,IACb,SAAS,KAAA,EAAO;AACd,MAAAC,qBAAA,CAAiB,KAAA,EAAO;AAAA,QACtB,SAAA,EAAW;AAAA,UACT,OAAA,EAAS,KAAA;AAAA,UACT,IAAA,EAAM;AAAA;AACR,OACD,CAAA;AACD,MAAA,MAAM,KAAA;AAAA,IACR;AAAA,EACF,CAAC,CAAA;AAED,EAAAC,wBAAA,CAAgB,GAAA,CAAI,KAAK,KAAK,CAAA;AAChC;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/koa/index.ts"],"sourcesContent":["import type { KoaInstrumentationConfig, KoaLayerType } from './vendored/types';\nimport { KoaInstrumentation } from './vendored/instrumentation';\nimport type { IntegrationFn } from '@sentry/core';\nimport { captureException, defineIntegration } from '@sentry/core';\nimport { ensureIsWrapped, generateInstrumentOnce } from '@sentry/node-core';\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 } 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 mechanism: {\n handled: false,\n type: 'auto.middleware.koa',\n },\n });\n throw error;\n }\n });\n\n ensureIsWrapped(app.use, 'koa');\n};\n"],"names":["generateInstrumentOnce","KoaInstrumentation","defineIntegration","captureException","ensureIsWrapped"],"mappings":";;;;;;AAaA,MAAM,gBAAA,GAAmB,KAAA;AAElB,MAAM,aAAA,GAAgBA,+BAAA;AAAA,EAC3B,gBAAA;AAAA,EACAC,kCAAA;AAAA,EACA,CAAC,OAAA,GAAsB,EAAC,KAAM;AAC5B,IAAA,OAAO;AAAA,MACL,kBAAkB,OAAA,CAAQ;AAAA,KAC5B;AAAA,EACF;AACF;AAEA,MAAM,eAAA,IAAmB,CAAC,OAAA,GAAsB,EAAC,KAAM;AACrD,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AACV,MAAA,aAAA,CAAc,OAAO,CAAA;AAAA,IACvB;AAAA,GACF;AACF,CAAA,CAAA;AAkCO,MAAM,cAAA,GAAiBC,uBAAkB,eAAe;AAyBxD,MAAM,oBAAA,GAAuB,CAAC,GAAA,KAA+E;AAClH,EAAA,GAAA,CAAI,GAAA,CAAI,OAAO,GAAA,EAAK,IAAA,KAAS;AAC3B,IAAA,IAAI;AACF,MAAA,MAAM,IAAA,EAAK;AAAA,IACb,SAAS,KAAA,EAAO;AACd,MAAAC,qBAAA,CAAiB,KAAA,EAAO;AAAA,QACtB,SAAA,EAAW;AAAA,UACT,OAAA,EAAS,KAAA;AAAA,UACT,IAAA,EAAM;AAAA;AACR,OACD,CAAA;AACD,MAAA,MAAM,KAAA;AAAA,IACR;AAAA,EACF,CAAC,CAAA;AAED,EAAAC,wBAAA,CAAgB,GAAA,CAAI,KAAK,KAAK,CAAA;AAChC;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"AttributeNames.js","sources":["../../../../../../../src/integrations/tracing/koa/vendored/enums/AttributeNames.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-koa\n * - Upstream version: @opentelemetry/instrumentation-koa@0.66.0\n */\n/* eslint-disable */\n\nexport enum AttributeNames {\n KOA_TYPE = 'koa.type',\n KOA_NAME = 'koa.name',\n}\n"],"names":["AttributeNames"],"mappings":";;AAqBO,IAAK,cAAA,qBAAAA,eAAAA,KAAL;AACL,EAAAA,gBAAA,UAAA,CAAA,GAAW,UAAA;AACX,EAAAA,gBAAA,UAAA,CAAA,GAAW,UAAA;AAFD,EAAA,OAAAA,eAAAA;AAAA,CAAA,EAAA,cAAA,IAAA,EAAA;;;;"}
1
+ {"version":3,"file":"AttributeNames.js","sources":["../../../../../../../src/integrations/tracing/koa/vendored/enums/AttributeNames.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-koa\n * - Upstream version: @opentelemetry/instrumentation-koa@0.66.0\n */\n\nexport enum AttributeNames {\n KOA_TYPE = 'koa.type',\n KOA_NAME = 'koa.name',\n}\n"],"names":["AttributeNames"],"mappings":";;AASO,IAAK,cAAA,qBAAAA,eAAAA,KAAL;AACL,EAAAA,gBAAA,UAAA,CAAA,GAAW,UAAA;AACX,EAAAA,gBAAA,UAAA,CAAA,GAAW,UAAA;AAFD,EAAA,OAAAA,eAAAA;AAAA,CAAA,EAAA,cAAA,IAAA,EAAA;;;;"}
@@ -4,8 +4,11 @@ const api = require('@opentelemetry/api');
4
4
  const instrumentation = require('@opentelemetry/instrumentation');
5
5
  const types = require('./types.js');
6
6
  const core = require('@sentry/core');
7
+ const semanticConventions = require('@opentelemetry/semantic-conventions');
7
8
  const utils = require('./utils.js');
8
9
  const setHttpServerSpanRouteAttribute = require('../../../../utils/setHttpServerSpanRouteAttribute.js');
10
+ const debugBuild = require('../../../../debug-build.js');
11
+ const AttributeNames = require('./enums/AttributeNames.js');
9
12
  const internalTypes = require('./internal-types.js');
10
13
 
11
14
  const PACKAGE_NAME = "@sentry/instrumentation-koa";
@@ -30,7 +33,7 @@ class KoaInstrumentation extends instrumentation.InstrumentationBase {
30
33
  },
31
34
  (module) => {
32
35
  const moduleExports = module[Symbol.toStringTag] === "Module" ? module.default : module;
33
- if (instrumentation.isWrapped(moduleExports.prototype.use)) {
36
+ if (moduleExports && instrumentation.isWrapped(moduleExports.prototype.use)) {
34
37
  this._unwrap(moduleExports.prototype, "use");
35
38
  }
36
39
  }
@@ -42,14 +45,10 @@ class KoaInstrumentation extends instrumentation.InstrumentationBase {
42
45
  * @param {KoaMiddleware} middleware - the original middleware function
43
46
  */
44
47
  _getKoaUsePatch(original) {
45
- const plugin = this;
48
+ const patchRouterDispatch = this._patchRouterDispatch.bind(this);
49
+ const patchLayer = this._patchLayer.bind(this);
46
50
  return function use(middlewareFunction) {
47
- let patchedFunction;
48
- if (middlewareFunction.router) {
49
- patchedFunction = plugin._patchRouterDispatch(middlewareFunction);
50
- } else {
51
- patchedFunction = plugin._patchLayer(middlewareFunction, false);
52
- }
51
+ const patchedFunction = middlewareFunction.router ? patchRouterDispatch(middlewareFunction) : patchLayer(middlewareFunction, false);
53
52
  return original.apply(this, [patchedFunction]);
54
53
  };
55
54
  }
@@ -61,7 +60,6 @@ class KoaInstrumentation extends instrumentation.InstrumentationBase {
61
60
  * routed middleware
62
61
  */
63
62
  _patchRouterDispatch(dispatchLayer) {
64
- api.diag.debug("Patching @koa/router dispatch");
65
63
  const router = dispatchLayer.router;
66
64
  const routesStack = router?.stack ?? [];
67
65
  for (const pathLayer of routesStack) {
@@ -87,50 +85,40 @@ class KoaInstrumentation extends instrumentation.InstrumentationBase {
87
85
  const layerType = isRouter ? types.KoaLayerType.ROUTER : types.KoaLayerType.MIDDLEWARE;
88
86
  if (middlewareLayer[internalTypes.kLayerPatched] === true || utils.isLayerIgnored(layerType, this.getConfig())) return middlewareLayer;
89
87
  if (middlewareLayer.constructor.name === "GeneratorFunction" || middlewareLayer.constructor.name === "AsyncGeneratorFunction") {
90
- api.diag.debug("ignoring generator-based Koa middleware layer");
91
88
  return middlewareLayer;
92
89
  }
93
90
  middlewareLayer[internalTypes.kLayerPatched] = true;
94
- api.diag.debug("patching Koa middleware layer");
95
- return async (context, next) => {
91
+ return (context, next) => {
96
92
  const parent = api.trace.getSpan(api.context.active());
97
93
  if (parent === void 0) {
98
94
  return middlewareLayer(context, next);
99
95
  }
100
96
  const metadata = utils.getMiddlewareMetadata(context, middlewareLayer, isRouter, layerPath);
101
- const span = this.tracer.startSpan(metadata.name, {
102
- attributes: metadata.attributes
103
- });
104
97
  if (context._matchedRoute) {
105
98
  setHttpServerSpanRouteAttribute.setHttpServerSpanRouteAttribute(context._matchedRoute.toString());
106
99
  }
107
- const { requestHook } = this.getConfig();
108
- if (requestHook) {
109
- instrumentation.safeExecuteInTheMiddle(
110
- () => requestHook(span, {
111
- context,
112
- middlewareLayer,
113
- layerType
114
- }),
115
- (e) => {
116
- if (e) {
117
- api.diag.error("koa instrumentation: request hook failed", e);
118
- }
119
- },
120
- true
121
- );
122
- }
123
- const newContext = api.trace.setSpan(api.context.active(), span);
124
- return api.context.with(newContext, async () => {
125
- try {
126
- return await middlewareLayer(context, next);
127
- } catch (err) {
128
- span.recordException(err);
129
- throw err;
130
- } finally {
131
- span.end();
100
+ const koaName = metadata.attributes[AttributeNames.AttributeNames.KOA_NAME];
101
+ const name = typeof koaName === "string" ? koaName || "< unknown >" : metadata.name;
102
+ return core.startSpan(
103
+ {
104
+ name,
105
+ op: `${layerType}.koa`,
106
+ attributes: {
107
+ ...metadata.attributes,
108
+ [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.http.otel.koa"
109
+ }
110
+ },
111
+ () => {
112
+ const route = metadata.attributes[semanticConventions.ATTR_HTTP_ROUTE];
113
+ if (core.getIsolationScope() === core.getDefaultIsolationScope()) {
114
+ debugBuild.DEBUG_BUILD && core.debug.warn("Isolation scope is default isolation scope - skipping setting transactionName");
115
+ } else if (route) {
116
+ const method = context.request?.method?.toUpperCase() || "GET";
117
+ core.getIsolationScope().setTransactionName(`${method} ${route}`);
118
+ }
119
+ return middlewareLayer(context, next);
132
120
  }
133
- });
121
+ );
134
122
  };
135
123
  }
136
124
  }
@@ -1 +1 @@
1
- {"version":3,"file":"instrumentation.js","sources":["../../../../../../src/integrations/tracing/koa/vendored/instrumentation.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-koa\n * - Upstream version: @opentelemetry/instrumentation-koa@0.66.0\n * - Minor TypeScript strictness adjustments for this repository's compiler settings\n */\n/* eslint-disable */\n\nimport * as api from '@opentelemetry/api';\nimport {\n isWrapped,\n InstrumentationBase,\n InstrumentationNodeModuleDefinition,\n safeExecuteInTheMiddle,\n} from '@opentelemetry/instrumentation';\n\nimport { KoaLayerType, KoaInstrumentationConfig } from './types';\nimport { SDK_VERSION } from '@sentry/core';\nimport { getMiddlewareMetadata, isLayerIgnored } from './utils';\nimport { setHttpServerSpanRouteAttribute } from '../../../../utils/setHttpServerSpanRouteAttribute';\nimport { Next, kLayerPatched, KoaContext, KoaMiddleware, KoaPatchedMiddleware } from './internal-types';\n\nconst PACKAGE_NAME = '@sentry/instrumentation-koa';\n\n/** Koa instrumentation for OpenTelemetry */\nexport class KoaInstrumentation extends InstrumentationBase<KoaInstrumentationConfig> {\n constructor(config: KoaInstrumentationConfig = {}) {\n super(PACKAGE_NAME, SDK_VERSION, config);\n }\n\n protected init() {\n return new InstrumentationNodeModuleDefinition(\n 'koa',\n ['>=2.0.0 <4'],\n (module: any) => {\n const moduleExports: any =\n module[Symbol.toStringTag] === 'Module'\n ? module.default // ESM\n : module; // CommonJS\n if (moduleExports == null) {\n return moduleExports;\n }\n if (isWrapped(moduleExports.prototype.use)) {\n this._unwrap(moduleExports.prototype, 'use');\n }\n this._wrap(moduleExports.prototype, 'use', this._getKoaUsePatch.bind(this));\n return module;\n },\n (module: any) => {\n const moduleExports: any =\n module[Symbol.toStringTag] === 'Module'\n ? module.default // ESM\n : module; // CommonJS\n if (isWrapped(moduleExports.prototype.use)) {\n this._unwrap(moduleExports.prototype, 'use');\n }\n },\n );\n }\n\n /**\n * Patches the Koa.use function in order to instrument each original\n * middleware layer which is introduced\n * @param {KoaMiddleware} middleware - the original middleware function\n */\n private _getKoaUsePatch(original: (middleware: KoaMiddleware) => any) {\n const plugin = this;\n return function use(this: any, middlewareFunction: KoaMiddleware) {\n let patchedFunction: KoaMiddleware;\n if (middlewareFunction.router) {\n patchedFunction = plugin._patchRouterDispatch(middlewareFunction);\n } else {\n patchedFunction = plugin._patchLayer(middlewareFunction, false);\n }\n return original.apply(this, [patchedFunction]);\n };\n }\n\n /**\n * Patches the dispatch function used by @koa/router. This function\n * goes through each routed middleware and adds instrumentation via a call\n * to the @function _patchLayer function.\n * @param {KoaMiddleware} dispatchLayer - the original dispatch function which dispatches\n * routed middleware\n */\n private _patchRouterDispatch(dispatchLayer: KoaMiddleware): KoaMiddleware {\n api.diag.debug('Patching @koa/router dispatch');\n\n const router = dispatchLayer.router;\n\n const routesStack = router?.stack ?? [];\n for (const pathLayer of routesStack) {\n const path = pathLayer.path;\n // Type cast needed: router.stack comes from @types/koa@2.x but we use @types/koa@3.x\n // See internal-types.ts for full explanation\n const pathStack = pathLayer.stack as any;\n for (let j = 0; j < pathStack.length; j++) {\n const routedMiddleware: KoaMiddleware = pathStack[j];\n pathStack[j] = this._patchLayer(routedMiddleware, true, path);\n }\n }\n\n return dispatchLayer;\n }\n\n /**\n * Patches each individual @param middlewareLayer function in order to create the\n * span and propagate context. It does not create spans when there is no parent span.\n * @param {KoaMiddleware} middlewareLayer - the original middleware function.\n * @param {boolean} isRouter - tracks whether the original middleware function\n * was dispatched by the router originally\n * @param {string?} layerPath - if present, provides additional data from the\n * router about the routed path which the middleware is attached to\n */\n private _patchLayer(\n middlewareLayer: KoaPatchedMiddleware,\n isRouter: boolean,\n layerPath?: string | RegExp,\n ): KoaMiddleware {\n const layerType = isRouter ? KoaLayerType.ROUTER : KoaLayerType.MIDDLEWARE;\n // Skip patching layer if its ignored in the config\n if (middlewareLayer[kLayerPatched] === true || isLayerIgnored(layerType, this.getConfig())) return middlewareLayer;\n\n if (\n middlewareLayer.constructor.name === 'GeneratorFunction' ||\n middlewareLayer.constructor.name === 'AsyncGeneratorFunction'\n ) {\n api.diag.debug('ignoring generator-based Koa middleware layer');\n return middlewareLayer;\n }\n\n middlewareLayer[kLayerPatched] = true;\n\n api.diag.debug('patching Koa middleware layer');\n return async (context: KoaContext, next: Next) => {\n const parent = api.trace.getSpan(api.context.active());\n if (parent === undefined) {\n return middlewareLayer(context, next);\n }\n const metadata = getMiddlewareMetadata(context, middlewareLayer, isRouter, layerPath);\n const span = this.tracer.startSpan(metadata.name, {\n attributes: metadata.attributes,\n });\n\n if (context._matchedRoute) {\n setHttpServerSpanRouteAttribute(context._matchedRoute.toString());\n }\n\n const { requestHook } = this.getConfig();\n if (requestHook) {\n safeExecuteInTheMiddle(\n () =>\n requestHook(span, {\n context,\n middlewareLayer,\n layerType,\n }),\n e => {\n if (e) {\n api.diag.error('koa instrumentation: request hook failed', e);\n }\n },\n true,\n );\n }\n\n const newContext = api.trace.setSpan(api.context.active(), span);\n return api.context.with(newContext, async () => {\n try {\n return await middlewareLayer(context, next);\n } catch (err: any) {\n span.recordException(err);\n throw err;\n } finally {\n span.end();\n }\n });\n };\n }\n}\n"],"names":["InstrumentationBase","SDK_VERSION","InstrumentationNodeModuleDefinition","isWrapped","KoaLayerType","kLayerPatched","isLayerIgnored","getMiddlewareMetadata","setHttpServerSpanRouteAttribute","safeExecuteInTheMiddle"],"mappings":";;;;;;;;;;AAoCA,MAAM,YAAA,GAAe,6BAAA;AAGd,MAAM,2BAA2BA,mCAAA,CAA8C;AAAA,EACpF,WAAA,CAAY,MAAA,GAAmC,EAAC,EAAG;AACjD,IAAA,KAAA,CAAM,YAAA,EAAcC,kBAAa,MAAM,CAAA;AAAA,EACzC;AAAA,EAEU,IAAA,GAAO;AACf,IAAA,OAAO,IAAIC,mDAAA;AAAA,MACT,KAAA;AAAA,MACA,CAAC,YAAY,CAAA;AAAA,MACb,CAAC,MAAA,KAAgB;AACf,QAAA,MAAM,gBACJ,MAAA,CAAO,MAAA,CAAO,WAAW,CAAA,KAAM,QAAA,GAC3B,OAAO,OAAA,GACP,MAAA;AACN,QAAA,IAAI,iBAAiB,IAAA,EAAM;AACzB,UAAA,OAAO,aAAA;AAAA,QACT;AACA,QAAA,IAAIC,yBAAA,CAAU,aAAA,CAAc,SAAA,CAAU,GAAG,CAAA,EAAG;AAC1C,UAAA,IAAA,CAAK,OAAA,CAAQ,aAAA,CAAc,SAAA,EAAW,KAAK,CAAA;AAAA,QAC7C;AACA,QAAA,IAAA,CAAK,KAAA,CAAM,cAAc,SAAA,EAAW,KAAA,EAAO,KAAK,eAAA,CAAgB,IAAA,CAAK,IAAI,CAAC,CAAA;AAC1E,QAAA,OAAO,MAAA;AAAA,MACT,CAAA;AAAA,MACA,CAAC,MAAA,KAAgB;AACf,QAAA,MAAM,gBACJ,MAAA,CAAO,MAAA,CAAO,WAAW,CAAA,KAAM,QAAA,GAC3B,OAAO,OAAA,GACP,MAAA;AACN,QAAA,IAAIA,yBAAA,CAAU,aAAA,CAAc,SAAA,CAAU,GAAG,CAAA,EAAG;AAC1C,UAAA,IAAA,CAAK,OAAA,CAAQ,aAAA,CAAc,SAAA,EAAW,KAAK,CAAA;AAAA,QAC7C;AAAA,MACF;AAAA,KACF;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOQ,gBAAgB,QAAA,EAA8C;AACpE,IAAA,MAAM,MAAA,GAAS,IAAA;AACf,IAAA,OAAO,SAAS,IAAe,kBAAA,EAAmC;AAChE,MAAA,IAAI,eAAA;AACJ,MAAA,IAAI,mBAAmB,MAAA,EAAQ;AAC7B,QAAA,eAAA,GAAkB,MAAA,CAAO,qBAAqB,kBAAkB,CAAA;AAAA,MAClE,CAAA,MAAO;AACL,QAAA,eAAA,GAAkB,MAAA,CAAO,WAAA,CAAY,kBAAA,EAAoB,KAAK,CAAA;AAAA,MAChE;AACA,MAAA,OAAO,QAAA,CAAS,KAAA,CAAM,IAAA,EAAM,CAAC,eAAe,CAAC,CAAA;AAAA,IAC/C,CAAA;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASQ,qBAAqB,aAAA,EAA6C;AACxE,IAAA,GAAA,CAAI,IAAA,CAAK,MAAM,+BAA+B,CAAA;AAE9C,IAAA,MAAM,SAAS,aAAA,CAAc,MAAA;AAE7B,IAAA,MAAM,WAAA,GAAc,MAAA,EAAQ,KAAA,IAAS,EAAC;AACtC,IAAA,KAAA,MAAW,aAAa,WAAA,EAAa;AACnC,MAAA,MAAM,OAAO,SAAA,CAAU,IAAA;AAGvB,MAAA,MAAM,YAAY,SAAA,CAAU,KAAA;AAC5B,MAAA,KAAA,IAAS,CAAA,GAAI,CAAA,EAAG,CAAA,GAAI,SAAA,CAAU,QAAQ,CAAA,EAAA,EAAK;AACzC,QAAA,MAAM,gBAAA,GAAkC,UAAU,CAAC,CAAA;AACnD,QAAA,SAAA,CAAU,CAAC,CAAA,GAAI,IAAA,CAAK,WAAA,CAAY,gBAAA,EAAkB,MAAM,IAAI,CAAA;AAAA,MAC9D;AAAA,IACF;AAEA,IAAA,OAAO,aAAA;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWQ,WAAA,CACN,eAAA,EACA,QAAA,EACA,SAAA,EACe;AACf,IAAA,MAAM,SAAA,GAAY,QAAA,GAAWC,kBAAA,CAAa,MAAA,GAASA,kBAAA,CAAa,UAAA;AAEhE,IAAA,IAAI,eAAA,CAAgBC,2BAAa,CAAA,KAAM,IAAA,IAAQC,oBAAA,CAAe,WAAW,IAAA,CAAK,SAAA,EAAW,CAAA,EAAG,OAAO,eAAA;AAEnG,IAAA,IACE,gBAAgB,WAAA,CAAY,IAAA,KAAS,uBACrC,eAAA,CAAgB,WAAA,CAAY,SAAS,wBAAA,EACrC;AACA,MAAA,GAAA,CAAI,IAAA,CAAK,MAAM,+CAA+C,CAAA;AAC9D,MAAA,OAAO,eAAA;AAAA,IACT;AAEA,IAAA,eAAA,CAAgBD,2BAAa,CAAA,GAAI,IAAA;AAEjC,IAAA,GAAA,CAAI,IAAA,CAAK,MAAM,+BAA+B,CAAA;AAC9C,IAAA,OAAO,OAAO,SAAqB,IAAA,KAAe;AAChD,MAAA,MAAM,SAAS,GAAA,CAAI,KAAA,CAAM,QAAQ,GAAA,CAAI,OAAA,CAAQ,QAAQ,CAAA;AACrD,MAAA,IAAI,WAAW,MAAA,EAAW;AACxB,QAAA,OAAO,eAAA,CAAgB,SAAS,IAAI,CAAA;AAAA,MACtC;AACA,MAAA,MAAM,QAAA,GAAWE,2BAAA,CAAsB,OAAA,EAAS,eAAA,EAAiB,UAAU,SAAS,CAAA;AACpF,MAAA,MAAM,IAAA,GAAO,IAAA,CAAK,MAAA,CAAO,SAAA,CAAU,SAAS,IAAA,EAAM;AAAA,QAChD,YAAY,QAAA,CAAS;AAAA,OACtB,CAAA;AAED,MAAA,IAAI,QAAQ,aAAA,EAAe;AACzB,QAAAC,+DAAA,CAAgC,OAAA,CAAQ,aAAA,CAAc,QAAA,EAAU,CAAA;AAAA,MAClE;AAEA,MAAA,MAAM,EAAE,WAAA,EAAY,GAAI,IAAA,CAAK,SAAA,EAAU;AACvC,MAAA,IAAI,WAAA,EAAa;AACf,QAAAC,sCAAA;AAAA,UACE,MACE,YAAY,IAAA,EAAM;AAAA,YAChB,OAAA;AAAA,YACA,eAAA;AAAA,YACA;AAAA,WACD,CAAA;AAAA,UACH,CAAA,CAAA,KAAK;AACH,YAAA,IAAI,CAAA,EAAG;AACL,cAAA,GAAA,CAAI,IAAA,CAAK,KAAA,CAAM,0CAAA,EAA4C,CAAC,CAAA;AAAA,YAC9D;AAAA,UACF,CAAA;AAAA,UACA;AAAA,SACF;AAAA,MACF;AAEA,MAAA,MAAM,UAAA,GAAa,IAAI,KAAA,CAAM,OAAA,CAAQ,IAAI,OAAA,CAAQ,MAAA,IAAU,IAAI,CAAA;AAC/D,MAAA,OAAO,GAAA,CAAI,OAAA,CAAQ,IAAA,CAAK,UAAA,EAAY,YAAY;AAC9C,QAAA,IAAI;AACF,UAAA,OAAO,MAAM,eAAA,CAAgB,OAAA,EAAS,IAAI,CAAA;AAAA,QAC5C,SAAS,GAAA,EAAU;AACjB,UAAA,IAAA,CAAK,gBAAgB,GAAG,CAAA;AACxB,UAAA,MAAM,GAAA;AAAA,QACR,CAAA,SAAE;AACA,UAAA,IAAA,CAAK,GAAA,EAAI;AAAA,QACX;AAAA,MACF,CAAC,CAAA;AAAA,IACH,CAAA;AAAA,EACF;AACF;;;;"}
1
+ {"version":3,"file":"instrumentation.js","sources":["../../../../../../src/integrations/tracing/koa/vendored/instrumentation.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-koa\n * - Upstream version: @opentelemetry/instrumentation-koa@0.66.0\n * - Minor TypeScript strictness adjustments for this repository's compiler settings\n * - Span creation migrated to the @sentry/core API; op/origin/name and transaction name folded into\n * span creation (previously set via a Sentry requestHook)\n */\n\nimport * as api from '@opentelemetry/api';\nimport { isWrapped, InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';\n\nimport { KoaLayerType, type KoaInstrumentationConfig } from './types';\nimport {\n debug,\n getDefaultIsolationScope,\n getIsolationScope,\n SDK_VERSION,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n startSpan,\n} from '@sentry/core';\nimport { ATTR_HTTP_ROUTE } from '@opentelemetry/semantic-conventions';\nimport { getMiddlewareMetadata, isLayerIgnored } from './utils';\nimport { setHttpServerSpanRouteAttribute } from '../../../../utils/setHttpServerSpanRouteAttribute';\nimport { DEBUG_BUILD } from '../../../../debug-build';\nimport { AttributeNames } from './enums/AttributeNames';\nimport {\n kLayerPatched,\n type Next,\n type KoaContext,\n type KoaMiddleware,\n type KoaPatchedMiddleware,\n} from './internal-types';\n\nconst PACKAGE_NAME = '@sentry/instrumentation-koa';\n\ninterface KoaModuleExports {\n prototype: { use: KoaMiddleware };\n}\n\ntype KoaModule = KoaModuleExports & { [Symbol.toStringTag]?: string; default?: KoaModuleExports };\n\n/** Koa instrumentation for OpenTelemetry */\nexport class KoaInstrumentation extends InstrumentationBase<KoaInstrumentationConfig> {\n constructor(config: KoaInstrumentationConfig = {}) {\n super(PACKAGE_NAME, SDK_VERSION, config);\n }\n\n protected init() {\n return new InstrumentationNodeModuleDefinition(\n 'koa',\n ['>=2.0.0 <4'],\n (module: KoaModule) => {\n const moduleExports =\n module[Symbol.toStringTag] === 'Module'\n ? module.default // ESM\n : module; // CommonJS\n if (moduleExports == null) {\n return moduleExports;\n }\n if (isWrapped(moduleExports.prototype.use)) {\n this._unwrap(moduleExports.prototype, 'use');\n }\n this._wrap(moduleExports.prototype, 'use', this._getKoaUsePatch.bind(this));\n return module;\n },\n (module: KoaModule) => {\n const moduleExports =\n module[Symbol.toStringTag] === 'Module'\n ? module.default // ESM\n : module; // CommonJS\n if (moduleExports && isWrapped(moduleExports.prototype.use)) {\n this._unwrap(moduleExports.prototype, 'use');\n }\n },\n );\n }\n\n /**\n * Patches the Koa.use function in order to instrument each original\n * middleware layer which is introduced\n * @param {KoaMiddleware} middleware - the original middleware function\n */\n private _getKoaUsePatch(original: (middleware: KoaMiddleware) => unknown) {\n const patchRouterDispatch = this._patchRouterDispatch.bind(this);\n const patchLayer = this._patchLayer.bind(this);\n return function use(this: unknown, middlewareFunction: KoaMiddleware) {\n const patchedFunction = middlewareFunction.router\n ? patchRouterDispatch(middlewareFunction)\n : patchLayer(middlewareFunction, false);\n return original.apply(this, [patchedFunction]);\n };\n }\n\n /**\n * Patches the dispatch function used by @koa/router. This function\n * goes through each routed middleware and adds instrumentation via a call\n * to the @function _patchLayer function.\n * @param {KoaMiddleware} dispatchLayer - the original dispatch function which dispatches\n * routed middleware\n */\n private _patchRouterDispatch(dispatchLayer: KoaMiddleware): KoaMiddleware {\n const router = dispatchLayer.router;\n\n const routesStack = router?.stack ?? [];\n for (const pathLayer of routesStack) {\n const path = pathLayer.path;\n const pathStack = pathLayer.stack;\n for (let j = 0; j < pathStack.length; j++) {\n const routedMiddleware: KoaMiddleware = pathStack[j]!;\n pathStack[j] = this._patchLayer(routedMiddleware, true, path);\n }\n }\n\n return dispatchLayer;\n }\n\n /**\n * Patches each individual @param middlewareLayer function in order to create the\n * span and propagate context. It does not create spans when there is no parent span.\n * @param {KoaMiddleware} middlewareLayer - the original middleware function.\n * @param {boolean} isRouter - tracks whether the original middleware function\n * was dispatched by the router originally\n * @param {string?} layerPath - if present, provides additional data from the\n * router about the routed path which the middleware is attached to\n */\n private _patchLayer(\n middlewareLayer: KoaPatchedMiddleware,\n isRouter: boolean,\n layerPath?: string | RegExp,\n ): KoaMiddleware {\n const layerType = isRouter ? KoaLayerType.ROUTER : KoaLayerType.MIDDLEWARE;\n // Skip patching layer if its ignored in the config\n if (middlewareLayer[kLayerPatched] === true || isLayerIgnored(layerType, this.getConfig())) return middlewareLayer;\n\n if (\n middlewareLayer.constructor.name === 'GeneratorFunction' ||\n middlewareLayer.constructor.name === 'AsyncGeneratorFunction'\n ) {\n return middlewareLayer;\n }\n\n middlewareLayer[kLayerPatched] = true;\n\n return (context: KoaContext, next: Next) => {\n const parent = api.trace.getSpan(api.context.active());\n if (parent === undefined) {\n return middlewareLayer(context, next);\n }\n const metadata = getMiddlewareMetadata(context, middlewareLayer, isRouter, layerPath);\n\n if (context._matchedRoute) {\n setHttpServerSpanRouteAttribute(context._matchedRoute.toString());\n }\n\n const koaName = metadata.attributes[AttributeNames.KOA_NAME];\n // Somehow, name is sometimes `''` for middleware spans\n // See: https://github.com/open-telemetry/opentelemetry-js-contrib/issues/2220\n const name = typeof koaName === 'string' ? koaName || '< unknown >' : metadata.name;\n\n return startSpan(\n {\n name,\n op: `${layerType}.koa`,\n attributes: {\n ...metadata.attributes,\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.otel.koa',\n },\n },\n () => {\n const route = metadata.attributes[ATTR_HTTP_ROUTE];\n if (getIsolationScope() === getDefaultIsolationScope()) {\n DEBUG_BUILD && debug.warn('Isolation scope is default isolation scope - skipping setting transactionName');\n } else if (route) {\n const method = (context.request as { method?: string } | undefined)?.method?.toUpperCase() || 'GET';\n getIsolationScope().setTransactionName(`${method} ${route}`);\n }\n return middlewareLayer(context, next);\n },\n );\n };\n }\n}\n"],"names":["InstrumentationBase","SDK_VERSION","InstrumentationNodeModuleDefinition","isWrapped","KoaLayerType","kLayerPatched","isLayerIgnored","getMiddlewareMetadata","setHttpServerSpanRouteAttribute","AttributeNames","startSpan","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","ATTR_HTTP_ROUTE","getIsolationScope","getDefaultIsolationScope","DEBUG_BUILD","debug"],"mappings":"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"}
@@ -1 +1 @@
1
- {"version":3,"file":"internal-types.js","sources":["../../../../../../src/integrations/tracing/koa/vendored/internal-types.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-koa\n * - Upstream version: @opentelemetry/instrumentation-koa@0.66.0\n * - Some types vendored from @types/koa, @types/koa-compose, and @types/koa__router with simplifications\n */\n/* eslint-disable */\n\ninterface DefaultState {}\n\nexport type Next = () => Promise<any>;\n\ntype ParameterizedContext<_StateT = DefaultState, ContextT = {}, _ResponseBodyT = unknown> = {\n [key: string]: any;\n} & ContextT;\n\ntype Middleware<StateT = DefaultState, ContextT = {}, ResponseBodyT = any> = (\n context: ParameterizedContext<StateT, ContextT, ResponseBodyT>,\n next: Next,\n) => any;\n\ninterface RouterParamContext<StateT = DefaultState, ContextT = {}> {\n params: Record<string, string>;\n router: Router<StateT, ContextT>;\n _matchedRoute: string | RegExp | undefined;\n _matchedRouteName: string | undefined;\n}\n\ninterface Layer {\n path: string | RegExp;\n stack: any[];\n}\n\nexport interface Router<_StateT = DefaultState, _ContextT = {}> {\n stack: Layer[];\n}\n\nexport type KoaContext = ParameterizedContext<DefaultState, RouterParamContext>;\nexport type KoaMiddleware = Middleware<DefaultState, KoaContext> & {\n router?: Router;\n};\n\n/**\n * This symbol is used to mark a Koa layer as being already instrumented\n * since its possible to use a given layer multiple times (ex: middlewares)\n */\nexport const kLayerPatched: unique symbol = Symbol('koa-layer-patched');\n\nexport type KoaPatchedMiddleware = KoaMiddleware & {\n [kLayerPatched]?: boolean;\n};\n"],"names":[],"mappings":";;AA4DO,MAAM,aAAA,0BAAsC,mBAAmB;;;;"}
1
+ {"version":3,"file":"internal-types.js","sources":["../../../../../../src/integrations/tracing/koa/vendored/internal-types.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-koa\n * - Upstream version: @opentelemetry/instrumentation-koa@0.66.0\n * - Some types vendored from @types/koa, @types/koa-compose, and @types/koa__router with simplifications\n */\n\ninterface DefaultState {}\n\nexport type Next = () => Promise<unknown>;\n\ntype ParameterizedContext<_StateT = DefaultState, ContextT = {}, _ResponseBodyT = unknown> = {\n [key: string]: unknown;\n} & ContextT;\n\ntype Middleware<StateT = DefaultState, ContextT = {}, ResponseBodyT = unknown> = (\n context: ParameterizedContext<StateT, ContextT, ResponseBodyT>,\n next: Next,\n) => unknown;\n\ninterface RouterParamContext<StateT = DefaultState, ContextT = {}> {\n params: Record<string, string>;\n router: Router<StateT, ContextT>;\n _matchedRoute: string | RegExp | undefined;\n _matchedRouteName: string | undefined;\n}\n\ninterface Layer {\n path: string | RegExp;\n stack: KoaMiddleware[];\n}\n\nexport interface Router<_StateT = DefaultState, _ContextT = {}> {\n stack: Layer[];\n}\n\nexport type KoaContext = ParameterizedContext<DefaultState, RouterParamContext>;\nexport type KoaMiddleware = Middleware<DefaultState, KoaContext> & {\n router?: Router;\n};\n\n/**\n * This symbol is used to mark a Koa layer as being already instrumented\n * since its possible to use a given layer multiple times (ex: middlewares)\n */\nexport const kLayerPatched: unique symbol = Symbol('koa-layer-patched');\n\nexport type KoaPatchedMiddleware = KoaMiddleware & {\n [kLayerPatched]?: boolean;\n};\n"],"names":[],"mappings":";;AAgDO,MAAM,aAAA,0BAAsC,mBAAmB;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sources":["../../../../../../src/integrations/tracing/koa/vendored/types.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-koa\n * - Upstream version: @opentelemetry/instrumentation-koa@0.66.0\n */\n/* eslint-disable */\n\nimport { Span } from '@opentelemetry/api';\nimport { InstrumentationConfig } from '@opentelemetry/instrumentation';\n\nexport enum KoaLayerType {\n ROUTER = 'router',\n MIDDLEWARE = 'middleware',\n}\n\n/**\n * Information about the current Koa middleware layer\n * The middleware layer type is any by default.\n * One can install koa types packages `@types/koa` and `@types/koa__router`\n * with compatible versions to the koa version used in the project\n * to get more specific types for the middleware layer property.\n *\n * Example use in a custom attribute function:\n * ```ts\n * import type { Middleware, ParameterizedContext, DefaultState } from 'koa';\n * import type { RouterParamContext } from '@koa/router';\n *\n * type KoaContext = ParameterizedContext<DefaultState, RouterParamContext>;\n * type KoaMiddleware = Middleware<DefaultState, KoaContext>;\n *\n * const koaConfig: KoaInstrumentationConfig<KoaContext, KoaMiddleware> = {\n * requestHook: (span: Span, info: KoaRequestInfo<KoaContext, KoaMiddleware>) => {\n * // custom typescript code that can access the typed into.middlewareLayer and info.context\n * }\n *\n */\nexport type KoaRequestInfo<KoaContextType = any, KoaMiddlewareType = any> = {\n context: KoaContextType;\n middlewareLayer: KoaMiddlewareType;\n layerType: KoaLayerType;\n};\n\n/**\n * Function that can be used to add custom attributes to the current span\n * @param span - The Express middleware layer span.\n * @param context - The current KoaContext.\n */\nexport interface KoaRequestCustomAttributeFunction<KoaContextType = any, KoaMiddlewareType = any> {\n (span: Span, info: KoaRequestInfo<KoaContextType, KoaMiddlewareType>): void;\n}\n\n/**\n * Options available for the Koa Instrumentation (see [documentation](https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-Instrumentation-koa#koa-Instrumentation-options))\n */\nexport interface KoaInstrumentationConfig<KoaContextType = any, KoaMiddlewareType = any> extends InstrumentationConfig {\n /** Ignore specific layers based on their type */\n ignoreLayersType?: KoaLayerType[];\n /** Function for adding custom attributes to each middleware layer span */\n requestHook?: KoaRequestCustomAttributeFunction<KoaContextType, KoaMiddlewareType>;\n}\n"],"names":["KoaLayerType"],"mappings":";;AAwBO,IAAK,YAAA,qBAAAA,aAAAA,KAAL;AACL,EAAAA,cAAA,QAAA,CAAA,GAAS,QAAA;AACT,EAAAA,cAAA,YAAA,CAAA,GAAa,YAAA;AAFH,EAAA,OAAAA,aAAAA;AAAA,CAAA,EAAA,YAAA,IAAA,EAAA;;;;"}
1
+ {"version":3,"file":"types.js","sources":["../../../../../../src/integrations/tracing/koa/vendored/types.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-koa\n * - Upstream version: @opentelemetry/instrumentation-koa@0.66.0\n */\n\nimport type { InstrumentationConfig } from '@opentelemetry/instrumentation';\n\nexport enum KoaLayerType {\n ROUTER = 'router',\n MIDDLEWARE = 'middleware',\n}\n\n/**\n * Options available for the Koa Instrumentation (see [documentation](https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-Instrumentation-koa#koa-Instrumentation-options))\n */\nexport interface KoaInstrumentationConfig extends InstrumentationConfig {\n /** Ignore specific layers based on their type */\n ignoreLayersType?: KoaLayerType[];\n}\n"],"names":["KoaLayerType"],"mappings":";;AAWO,IAAK,YAAA,qBAAAA,aAAAA,KAAL;AACL,EAAAA,cAAA,QAAA,CAAA,GAAS,QAAA;AACT,EAAAA,cAAA,YAAA,CAAA,GAAa,YAAA;AAFH,EAAA,OAAAA,aAAAA;AAAA,CAAA,EAAA,YAAA,IAAA,EAAA;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["../../../../../../src/integrations/tracing/koa/vendored/utils.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-koa\n * - Upstream version: @opentelemetry/instrumentation-koa@0.66.0\n */\n/* eslint-disable */\n\nimport { KoaLayerType, KoaInstrumentationConfig } from './types';\nimport { KoaContext, KoaMiddleware } from './internal-types';\nimport { AttributeNames } from './enums/AttributeNames';\nimport { Attributes } from '@opentelemetry/api';\nimport { ATTR_HTTP_ROUTE } from '@opentelemetry/semantic-conventions';\n\nexport const getMiddlewareMetadata = (\n context: KoaContext,\n layer: KoaMiddleware,\n isRouter: boolean,\n layerPath?: string | RegExp,\n): {\n attributes: Attributes;\n name: string;\n} => {\n if (isRouter) {\n return {\n attributes: {\n [AttributeNames.KOA_NAME]: layerPath?.toString(),\n [AttributeNames.KOA_TYPE]: KoaLayerType.ROUTER,\n [ATTR_HTTP_ROUTE]: layerPath?.toString(),\n },\n name: context._matchedRouteName || `router - ${layerPath}`,\n };\n } else {\n return {\n attributes: {\n [AttributeNames.KOA_NAME]: layer.name ?? 'middleware',\n [AttributeNames.KOA_TYPE]: KoaLayerType.MIDDLEWARE,\n },\n name: `middleware - ${layer.name}`,\n };\n }\n};\n\n/**\n * Check whether the given request is ignored by configuration\n * @param [list] List of ignore patterns\n * @param [onException] callback for doing something when an exception has\n * occurred\n */\nexport const isLayerIgnored = (type: KoaLayerType, config?: KoaInstrumentationConfig): boolean => {\n return !!(Array.isArray(config?.ignoreLayersType) && config?.ignoreLayersType?.includes(type));\n};\n"],"names":["AttributeNames","KoaLayerType","ATTR_HTTP_ROUTE"],"mappings":";;;;;;AA2BO,MAAM,qBAAA,GAAwB,CACnC,OAAA,EACA,KAAA,EACA,UACA,SAAA,KAIG;AACH,EAAA,IAAI,QAAA,EAAU;AACZ,IAAA,OAAO;AAAA,MACL,UAAA,EAAY;AAAA,QACV,CAACA,6BAAA,CAAe,QAAQ,GAAG,WAAW,QAAA,EAAS;AAAA,QAC/C,CAACA,6BAAA,CAAe,QAAQ,GAAGC,kBAAA,CAAa,MAAA;AAAA,QACxC,CAACC,mCAAe,GAAG,SAAA,EAAW,QAAA;AAAS,OACzC;AAAA,MACA,IAAA,EAAM,OAAA,CAAQ,iBAAA,IAAqB,CAAA,SAAA,EAAY,SAAS,CAAA;AAAA,KAC1D;AAAA,EACF,CAAA,MAAO;AACL,IAAA,OAAO;AAAA,MACL,UAAA,EAAY;AAAA,QACV,CAACF,6BAAA,CAAe,QAAQ,GAAG,MAAM,IAAA,IAAQ,YAAA;AAAA,QACzC,CAACA,6BAAA,CAAe,QAAQ,GAAGC,kBAAA,CAAa;AAAA,OAC1C;AAAA,MACA,IAAA,EAAM,CAAA,aAAA,EAAgB,KAAA,CAAM,IAAI,CAAA;AAAA,KAClC;AAAA,EACF;AACF;AAQO,MAAM,cAAA,GAAiB,CAAC,IAAA,EAAoB,MAAA,KAA+C;AAChG,EAAA,OAAO,CAAC,EAAE,KAAA,CAAM,OAAA,CAAQ,MAAA,EAAQ,gBAAgB,CAAA,IAAK,MAAA,EAAQ,gBAAA,EAAkB,QAAA,CAAS,IAAI,CAAA,CAAA;AAC9F;;;;;"}
1
+ {"version":3,"file":"utils.js","sources":["../../../../../../src/integrations/tracing/koa/vendored/utils.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-koa\n * - Upstream version: @opentelemetry/instrumentation-koa@0.66.0\n */\n\nimport { KoaLayerType, type KoaInstrumentationConfig } from './types';\nimport type { KoaContext, KoaMiddleware } from './internal-types';\nimport { AttributeNames } from './enums/AttributeNames';\nimport type { Attributes } from '@opentelemetry/api';\nimport { ATTR_HTTP_ROUTE } from '@opentelemetry/semantic-conventions';\n\nexport const getMiddlewareMetadata = (\n context: KoaContext,\n layer: KoaMiddleware,\n isRouter: boolean,\n layerPath?: string | RegExp,\n): {\n attributes: Attributes;\n name: string;\n} => {\n if (isRouter) {\n return {\n attributes: {\n [AttributeNames.KOA_NAME]: layerPath?.toString(),\n [AttributeNames.KOA_TYPE]: KoaLayerType.ROUTER,\n [ATTR_HTTP_ROUTE]: layerPath?.toString(),\n },\n name: context._matchedRouteName || `router - ${layerPath}`,\n };\n } else {\n return {\n attributes: {\n [AttributeNames.KOA_NAME]: layer.name ?? 'middleware',\n [AttributeNames.KOA_TYPE]: KoaLayerType.MIDDLEWARE,\n },\n name: `middleware - ${layer.name}`,\n };\n }\n};\n\n/**\n * Check whether the given request is ignored by configuration\n * @param [list] List of ignore patterns\n * @param [onException] callback for doing something when an exception has\n * occurred\n */\nexport const isLayerIgnored = (type: KoaLayerType, config?: KoaInstrumentationConfig): boolean => {\n return !!(Array.isArray(config?.ignoreLayersType) && config?.ignoreLayersType?.includes(type));\n};\n"],"names":["AttributeNames","KoaLayerType","ATTR_HTTP_ROUTE"],"mappings":";;;;;;AAeO,MAAM,qBAAA,GAAwB,CACnC,OAAA,EACA,KAAA,EACA,UACA,SAAA,KAIG;AACH,EAAA,IAAI,QAAA,EAAU;AACZ,IAAA,OAAO;AAAA,MACL,UAAA,EAAY;AAAA,QACV,CAACA,6BAAA,CAAe,QAAQ,GAAG,WAAW,QAAA,EAAS;AAAA,QAC/C,CAACA,6BAAA,CAAe,QAAQ,GAAGC,kBAAA,CAAa,MAAA;AAAA,QACxC,CAACC,mCAAe,GAAG,SAAA,EAAW,QAAA;AAAS,OACzC;AAAA,MACA,IAAA,EAAM,OAAA,CAAQ,iBAAA,IAAqB,CAAA,SAAA,EAAY,SAAS,CAAA;AAAA,KAC1D;AAAA,EACF,CAAA,MAAO;AACL,IAAA,OAAO;AAAA,MACL,UAAA,EAAY;AAAA,QACV,CAACF,6BAAA,CAAe,QAAQ,GAAG,MAAM,IAAA,IAAQ,YAAA;AAAA,QACzC,CAACA,6BAAA,CAAe,QAAQ,GAAGC,kBAAA,CAAa;AAAA,OAC1C;AAAA,MACA,IAAA,EAAM,CAAA,aAAA,EAAgB,KAAA,CAAM,IAAI,CAAA;AAAA,KAClC;AAAA,EACF;AACF;AAQO,MAAM,cAAA,GAAiB,CAAC,IAAA,EAAoB,MAAA,KAA+C;AAChG,EAAA,OAAO,CAAC,EAAE,KAAA,CAAM,OAAA,CAAQ,MAAA,EAAQ,gBAAgB,CAAA,IAAK,MAAA,EAAQ,gBAAA,EAAkB,QAAA,CAAS,IAAI,CAAA,CAAA;AAC9F;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"instrumentation.js","sources":["../../../../../../src/integrations/tracing/lrumemoizer/vendored/instrumentation.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-lru-memoizer\n * - Upstream version: @opentelemetry/instrumentation-lru-memoizer@0.62.0\n */\n\nimport { context } from '@opentelemetry/api';\nimport { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';\nimport { SDK_VERSION } from '@sentry/core';\n\nconst PACKAGE_NAME = '@sentry/instrumentation-lru-memoizer';\n\ntype Memoizer = (this: unknown, ...args: unknown[]) => unknown;\ntype LruMemoizerModule = ((this: unknown, ...args: unknown[]) => Memoizer) & { sync: unknown };\n\nexport class LruMemoizerInstrumentation extends InstrumentationBase {\n constructor() {\n super(PACKAGE_NAME, SDK_VERSION, {});\n }\n\n init(): InstrumentationNodeModuleDefinition[] {\n return [\n new InstrumentationNodeModuleDefinition(\n 'lru-memoizer',\n ['>=1.3 <4'],\n (moduleExports: LruMemoizerModule) => {\n // moduleExports is a function which receives an options object,\n // and returns a \"memoizer\" function upon invocation.\n // We want to patch this \"memoizer's\" internal function\n const asyncMemoizer = function (this: unknown, ...args: unknown[]): unknown {\n // This following function is invoked every time the user wants to get a (possible) memoized value\n // We replace it with another function in which we bind the current context to the last argument (callback)\n const origMemoizer = moduleExports.apply(this, args) as Memoizer;\n return function (this: unknown, ...memoizerArgs: unknown[]): unknown {\n // last argument is the callback\n const origCallback = memoizerArgs.pop();\n const callbackWithContext =\n typeof origCallback === 'function' ? context.bind(context.active(), origCallback) : origCallback;\n return origMemoizer.apply(this, [...memoizerArgs, callbackWithContext]);\n };\n };\n\n // sync function preserves context, but we still need to export it\n // as the lru-memoizer package does\n return Object.assign(asyncMemoizer, { sync: moduleExports.sync });\n },\n undefined, // no need to disable as this instrumentation does not create any spans\n ),\n ];\n }\n}\n"],"names":["InstrumentationBase","SDK_VERSION","InstrumentationNodeModuleDefinition","context"],"mappings":";;;;;;AAwBA,MAAM,YAAA,GAAe,sCAAA;AAKd,MAAM,mCAAmCA,mCAAA,CAAoB;AAAA,EAClE,WAAA,GAAc;AACZ,IAAA,KAAA,CAAM,YAAA,EAAcC,gBAAA,EAAa,EAAE,CAAA;AAAA,EACrC;AAAA,EAEA,IAAA,GAA8C;AAC5C,IAAA,OAAO;AAAA,MACL,IAAIC,mDAAA;AAAA,QACF,cAAA;AAAA,QACA,CAAC,UAAU,CAAA;AAAA,QACX,CAAC,aAAA,KAAqC;AAIpC,UAAA,MAAM,aAAA,GAAgB,YAA4B,IAAA,EAA0B;AAG1E,YAAA,MAAM,YAAA,GAAe,aAAA,CAAc,KAAA,CAAM,IAAA,EAAM,IAAI,CAAA;AACnD,YAAA,OAAO,YAA4B,YAAA,EAAkC;AAEnE,cAAA,MAAM,YAAA,GAAe,aAAa,GAAA,EAAI;AACtC,cAAA,MAAM,mBAAA,GACJ,OAAO,YAAA,KAAiB,UAAA,GAAaC,WAAA,CAAQ,KAAKA,WAAA,CAAQ,MAAA,EAAO,EAAG,YAAY,CAAA,GAAI,YAAA;AACtF,cAAA,OAAO,aAAa,KAAA,CAAM,IAAA,EAAM,CAAC,GAAG,YAAA,EAAc,mBAAmB,CAAC,CAAA;AAAA,YACxE,CAAA;AAAA,UACF,CAAA;AAIA,UAAA,OAAO,OAAO,MAAA,CAAO,aAAA,EAAe,EAAE,IAAA,EAAM,aAAA,CAAc,MAAM,CAAA;AAAA,QAClE,CAAA;AAAA,QACA;AAAA;AAAA;AACF,KACF;AAAA,EACF;AACF;;;;"}
1
+ {"version":3,"file":"instrumentation.js","sources":["../../../../../../src/integrations/tracing/lrumemoizer/vendored/instrumentation.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-lru-memoizer\n * - Upstream version: @opentelemetry/instrumentation-lru-memoizer@0.62.0\n */\n\nimport { context } from '@opentelemetry/api';\nimport { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';\nimport { SDK_VERSION } from '@sentry/core';\n\nconst PACKAGE_NAME = '@sentry/instrumentation-lru-memoizer';\n\ntype Memoizer = (this: unknown, ...args: unknown[]) => unknown;\ntype LruMemoizerModule = ((this: unknown, ...args: unknown[]) => Memoizer) & { sync: unknown };\n\nexport class LruMemoizerInstrumentation extends InstrumentationBase {\n constructor() {\n super(PACKAGE_NAME, SDK_VERSION, {});\n }\n\n init(): InstrumentationNodeModuleDefinition[] {\n return [\n new InstrumentationNodeModuleDefinition(\n 'lru-memoizer',\n ['>=1.3 <4'],\n (moduleExports: LruMemoizerModule) => {\n // moduleExports is a function which receives an options object,\n // and returns a \"memoizer\" function upon invocation.\n // We want to patch this \"memoizer's\" internal function\n const asyncMemoizer = function (this: unknown, ...args: unknown[]): unknown {\n // This following function is invoked every time the user wants to get a (possible) memoized value\n // We replace it with another function in which we bind the current context to the last argument (callback)\n const origMemoizer = moduleExports.apply(this, args) as Memoizer;\n return function (this: unknown, ...memoizerArgs: unknown[]): unknown {\n // last argument is the callback\n const origCallback = memoizerArgs.pop();\n const callbackWithContext =\n typeof origCallback === 'function' ? context.bind(context.active(), origCallback) : origCallback;\n return origMemoizer.apply(this, [...memoizerArgs, callbackWithContext]);\n };\n };\n\n // sync function preserves context, but we still need to export it\n // as the lru-memoizer package does\n return Object.assign(asyncMemoizer, { sync: moduleExports.sync });\n },\n undefined, // no need to disable as this instrumentation does not create any spans\n ),\n ];\n }\n}\n"],"names":["InstrumentationBase","SDK_VERSION","InstrumentationNodeModuleDefinition","context"],"mappings":";;;;;;AAaA,MAAM,YAAA,GAAe,sCAAA;AAKd,MAAM,mCAAmCA,mCAAA,CAAoB;AAAA,EAClE,WAAA,GAAc;AACZ,IAAA,KAAA,CAAM,YAAA,EAAcC,gBAAA,EAAa,EAAE,CAAA;AAAA,EACrC;AAAA,EAEA,IAAA,GAA8C;AAC5C,IAAA,OAAO;AAAA,MACL,IAAIC,mDAAA;AAAA,QACF,cAAA;AAAA,QACA,CAAC,UAAU,CAAA;AAAA,QACX,CAAC,aAAA,KAAqC;AAIpC,UAAA,MAAM,aAAA,GAAgB,YAA4B,IAAA,EAA0B;AAG1E,YAAA,MAAM,YAAA,GAAe,aAAA,CAAc,KAAA,CAAM,IAAA,EAAM,IAAI,CAAA;AACnD,YAAA,OAAO,YAA4B,YAAA,EAAkC;AAEnE,cAAA,MAAM,YAAA,GAAe,aAAa,GAAA,EAAI;AACtC,cAAA,MAAM,mBAAA,GACJ,OAAO,YAAA,KAAiB,UAAA,GAAaC,WAAA,CAAQ,KAAKA,WAAA,CAAQ,MAAA,EAAO,EAAG,YAAY,CAAA,GAAI,YAAA;AACtF,cAAA,OAAO,aAAa,KAAA,CAAM,IAAA,EAAM,CAAC,GAAG,YAAA,EAAc,mBAAmB,CAAC,CAAA;AAAA,YACxE,CAAA;AAAA,UACF,CAAA;AAIA,UAAA,OAAO,OAAO,MAAA,CAAO,aAAA,EAAe,EAAE,IAAA,EAAM,aAAA,CAAc,MAAM,CAAA;AAAA,QAClE,CAAA;AAAA,QACA;AAAA;AAAA;AACF,KACF;AAAA,EACF;AACF;;;;"}
@@ -5,47 +5,7 @@ const core = require('@sentry/core');
5
5
  const nodeCore = require('@sentry/node-core');
6
6
 
7
7
  const INTEGRATION_NAME = "Mongo";
8
- const instrumentMongo = nodeCore.generateInstrumentOnce(
9
- INTEGRATION_NAME,
10
- () => new instrumentation.MongoDBInstrumentation({
11
- dbStatementSerializer: _defaultDbStatementSerializer,
12
- responseHook(span) {
13
- nodeCore.addOriginToSpan(span, "auto.db.otel.mongo");
14
- }
15
- })
16
- );
17
- function _defaultDbStatementSerializer(commandObj) {
18
- const resultObj = _scrubStatement(commandObj);
19
- return JSON.stringify(resultObj);
20
- }
21
- function _scrubStatement(value) {
22
- if (Array.isArray(value)) {
23
- return value.map((element) => _scrubStatement(element));
24
- }
25
- if (isCommandObj(value)) {
26
- const initial = {};
27
- return Object.entries(value).map(([key, element]) => [key, _scrubStatement(element)]).reduce((prev, current) => {
28
- if (isCommandEntry(current)) {
29
- prev[current[0]] = current[1];
30
- }
31
- return prev;
32
- }, initial);
33
- }
34
- return "?";
35
- }
36
- function isCommandObj(value) {
37
- return typeof value === "object" && value !== null && !isBuffer(value);
38
- }
39
- function isBuffer(value) {
40
- let isBuffer2 = false;
41
- if (typeof Buffer !== "undefined") {
42
- isBuffer2 = Buffer.isBuffer(value);
43
- }
44
- return isBuffer2;
45
- }
46
- function isCommandEntry(value) {
47
- return Array.isArray(value);
48
- }
8
+ const instrumentMongo = nodeCore.generateInstrumentOnce(INTEGRATION_NAME, () => new instrumentation.MongoDBInstrumentation());
49
9
  const _mongoIntegration = (() => {
50
10
  return {
51
11
  name: INTEGRATION_NAME,
@@ -56,7 +16,6 @@ const _mongoIntegration = (() => {
56
16
  });
57
17
  const mongoIntegration = core.defineIntegration(_mongoIntegration);
58
18
 
59
- exports._defaultDbStatementSerializer = _defaultDbStatementSerializer;
60
19
  exports.instrumentMongo = instrumentMongo;
61
20
  exports.mongoIntegration = mongoIntegration;
62
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/mongo/index.ts"],"sourcesContent":["import { MongoDBInstrumentation } from './vendored/instrumentation';\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":["generateInstrumentOnce","MongoDBInstrumentation","addOriginToSpan","isBuffer","defineIntegration"],"mappings":";;;;;;AAKA,MAAM,gBAAA,GAAmB,OAAA;AAElB,MAAM,eAAA,GAAkBA,+BAAA;AAAA,EAC7B,gBAAA;AAAA,EACA,MACE,IAAIC,sCAAA,CAAuB;AAAA,IACzB,qBAAA,EAAuB,6BAAA;AAAA,IACvB,aAAa,IAAA,EAAM;AACjB,MAAAC,wBAAA,CAAgB,MAAM,oBAAoB,CAAA;AAAA,IAC5C;AAAA,GACD;AACL;AAKO,SAAS,8BAA8B,UAAA,EAA6C;AACzF,EAAA,MAAM,SAAA,GAAY,gBAAgB,UAAU,CAAA;AAC5C,EAAA,OAAO,IAAA,CAAK,UAAU,SAAS,CAAA;AACjC;AAEA,SAAS,gBAAgB,KAAA,EAAyB;AAChD,EAAA,IAAI,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA,EAAG;AACxB,IAAA,OAAO,KAAA,CAAM,GAAA,CAAI,CAAA,OAAA,KAAW,eAAA,CAAgB,OAAO,CAAC,CAAA;AAAA,EACtD;AAEA,EAAA,IAAI,YAAA,CAAa,KAAK,CAAA,EAAG;AACvB,IAAA,MAAM,UAAmC,EAAC;AAC1C,IAAA,OAAO,MAAA,CAAO,QAAQ,KAAK,CAAA,CACxB,IAAI,CAAC,CAAC,KAAK,OAAO,CAAA,KAAM,CAAC,GAAA,EAAK,eAAA,CAAgB,OAAO,CAAC,CAAC,EACvD,MAAA,CAAO,CAAC,MAAM,OAAA,KAAY;AACzB,MAAA,IAAI,cAAA,CAAe,OAAO,CAAA,EAAG;AAC3B,QAAA,IAAA,CAAK,OAAA,CAAQ,CAAC,CAAC,CAAA,GAAI,QAAQ,CAAC,CAAA;AAAA,MAC9B;AACA,MAAA,OAAO,IAAA;AAAA,IACT,GAAG,OAAO,CAAA;AAAA,EACd;AAGA,EAAA,OAAO,GAAA;AACT;AAEA,SAAS,aAAa,KAAA,EAA4E;AAChG,EAAA,OAAO,OAAO,KAAA,KAAU,QAAA,IAAY,UAAU,IAAA,IAAQ,CAAC,SAAS,KAAK,CAAA;AACvE;AAEA,SAAS,SAAS,KAAA,EAAyB;AACzC,EAAA,IAAIC,SAAAA,GAAW,KAAA;AACf,EAAA,IAAI,OAAO,WAAW,WAAA,EAAa;AACjC,IAAAA,SAAAA,GAAW,MAAA,CAAO,QAAA,CAAS,KAAK,CAAA;AAAA,EAClC;AACA,EAAA,OAAOA,SAAAA;AACT;AAEA,SAAS,eAAe,KAAA,EAAgE;AACtF,EAAA,OAAO,KAAA,CAAM,QAAQ,KAAK,CAAA;AAC5B;AAEA,MAAM,qBAAqB,MAAM;AAC/B,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AACV,MAAA,eAAA,EAAgB;AAAA,IAClB;AAAA,GACF;AACF,CAAA,CAAA;AAgBO,MAAM,gBAAA,GAAmBC,uBAAkB,iBAAiB;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/mongo/index.ts"],"sourcesContent":["import { MongoDBInstrumentation } from './vendored/instrumentation';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { generateInstrumentOnce } from '@sentry/node-core';\n\nconst INTEGRATION_NAME = 'Mongo';\n\nexport const instrumentMongo = generateInstrumentOnce(INTEGRATION_NAME, () => new MongoDBInstrumentation());\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":["generateInstrumentOnce","MongoDBInstrumentation","defineIntegration"],"mappings":";;;;;;AAKA,MAAM,gBAAA,GAAmB,OAAA;AAElB,MAAM,kBAAkBA,+BAAA,CAAuB,gBAAA,EAAkB,MAAM,IAAIC,wCAAwB;AAE1G,MAAM,qBAAqB,MAAM;AAC/B,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AACV,MAAA,eAAA,EAAgB;AAAA,IAClB;AAAA,GACF;AACF,CAAA,CAAA;AAgBO,MAAM,gBAAA,GAAmBC,uBAAkB,iBAAiB;;;;;"}