@sentry/node 10.58.0 → 10.59.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 (502) hide show
  1. package/build/cjs/index.js +2 -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/vendored/undici.js.map +1 -1
  10. package/build/cjs/integrations/tracing/amqplib/vendored/amqplib.js.map +1 -1
  11. package/build/cjs/integrations/tracing/amqplib/vendored/semconv-obsolete.js.map +1 -1
  12. package/build/cjs/integrations/tracing/amqplib/vendored/semconv.js.map +1 -1
  13. package/build/cjs/integrations/tracing/amqplib/vendored/types.js.map +1 -1
  14. package/build/cjs/integrations/tracing/amqplib/vendored/utils.js.map +1 -1
  15. package/build/cjs/integrations/tracing/connect/index.js +0 -21
  16. package/build/cjs/integrations/tracing/connect/index.js.map +1 -1
  17. package/build/cjs/integrations/tracing/connect/vendored/enums/AttributeNames.js +0 -6
  18. package/build/cjs/integrations/tracing/connect/vendored/enums/AttributeNames.js.map +1 -1
  19. package/build/cjs/integrations/tracing/connect/vendored/instrumentation.js +33 -42
  20. package/build/cjs/integrations/tracing/connect/vendored/instrumentation.js.map +1 -1
  21. package/build/cjs/integrations/tracing/connect/vendored/internal-types.js.map +1 -1
  22. package/build/cjs/integrations/tracing/connect/vendored/utils.js +3 -2
  23. package/build/cjs/integrations/tracing/connect/vendored/utils.js.map +1 -1
  24. package/build/cjs/integrations/tracing/dataloader/vendored/instrumentation.js.map +1 -1
  25. package/build/cjs/integrations/tracing/fastify/v3/instrumentation.js +1 -1
  26. package/build/cjs/integrations/tracing/fastify/v3/instrumentation.js.map +1 -1
  27. package/build/cjs/integrations/tracing/fastify/vendored/instrumentation.js.map +1 -1
  28. package/build/cjs/integrations/tracing/genericPool/index.js +1 -15
  29. package/build/cjs/integrations/tracing/genericPool/index.js.map +1 -1
  30. package/build/cjs/integrations/tracing/genericPool/vendored/instrumentation.js +30 -18
  31. package/build/cjs/integrations/tracing/genericPool/vendored/instrumentation.js.map +1 -1
  32. package/build/cjs/integrations/tracing/graphql/index.js +1 -51
  33. package/build/cjs/integrations/tracing/graphql/index.js.map +1 -1
  34. package/build/cjs/integrations/tracing/graphql/vendored/enum.js.map +1 -1
  35. package/build/cjs/integrations/tracing/graphql/vendored/enums/AttributeNames.js +0 -2
  36. package/build/cjs/integrations/tracing/graphql/vendored/enums/AttributeNames.js.map +1 -1
  37. package/build/cjs/integrations/tracing/graphql/vendored/instrumentation.js +67 -57
  38. package/build/cjs/integrations/tracing/graphql/vendored/instrumentation.js.map +1 -1
  39. package/build/cjs/integrations/tracing/graphql/vendored/internal-types.js.map +1 -1
  40. package/build/cjs/integrations/tracing/graphql/vendored/symbols.js.map +1 -1
  41. package/build/cjs/integrations/tracing/graphql/vendored/utils.js +28 -62
  42. package/build/cjs/integrations/tracing/graphql/vendored/utils.js.map +1 -1
  43. package/build/cjs/integrations/tracing/hapi/index.js +0 -17
  44. package/build/cjs/integrations/tracing/hapi/index.js.map +1 -1
  45. package/build/cjs/integrations/tracing/hapi/vendored/enums/AttributeNames.js.map +1 -1
  46. package/build/cjs/integrations/tracing/hapi/vendored/instrumentation.js +28 -45
  47. package/build/cjs/integrations/tracing/hapi/vendored/instrumentation.js.map +1 -1
  48. package/build/cjs/integrations/tracing/hapi/vendored/internal-types.js.map +1 -1
  49. package/build/cjs/integrations/tracing/hapi/vendored/semconv.js.map +1 -1
  50. package/build/cjs/integrations/tracing/hapi/vendored/utils.js +4 -9
  51. package/build/cjs/integrations/tracing/hapi/vendored/utils.js.map +1 -1
  52. package/build/cjs/integrations/tracing/index.js +1 -0
  53. package/build/cjs/integrations/tracing/index.js.map +1 -1
  54. package/build/cjs/integrations/tracing/kafka/vendored/instrumentation.js.map +1 -1
  55. package/build/cjs/integrations/tracing/kafka/vendored/internal-types.js.map +1 -1
  56. package/build/cjs/integrations/tracing/kafka/vendored/propagator.js.map +1 -1
  57. package/build/cjs/integrations/tracing/kafka/vendored/semconv.js.map +1 -1
  58. package/build/cjs/integrations/tracing/knex/index.js +2 -17
  59. package/build/cjs/integrations/tracing/knex/index.js.map +1 -1
  60. package/build/cjs/integrations/tracing/knex/vendored/instrumentation.js +65 -93
  61. package/build/cjs/integrations/tracing/knex/vendored/instrumentation.js.map +1 -1
  62. package/build/cjs/integrations/tracing/knex/vendored/semconv.js +2 -0
  63. package/build/cjs/integrations/tracing/knex/vendored/semconv.js.map +1 -1
  64. package/build/cjs/integrations/tracing/knex/vendored/utils.js +2 -15
  65. package/build/cjs/integrations/tracing/knex/vendored/utils.js.map +1 -1
  66. package/build/cjs/integrations/tracing/koa/index.js +1 -24
  67. package/build/cjs/integrations/tracing/koa/index.js.map +1 -1
  68. package/build/cjs/integrations/tracing/koa/vendored/enums/AttributeNames.js.map +1 -1
  69. package/build/cjs/integrations/tracing/koa/vendored/instrumentation.js +29 -41
  70. package/build/cjs/integrations/tracing/koa/vendored/instrumentation.js.map +1 -1
  71. package/build/cjs/integrations/tracing/koa/vendored/internal-types.js.map +1 -1
  72. package/build/cjs/integrations/tracing/koa/vendored/types.js.map +1 -1
  73. package/build/cjs/integrations/tracing/koa/vendored/utils.js.map +1 -1
  74. package/build/cjs/integrations/tracing/lrumemoizer/vendored/instrumentation.js.map +1 -1
  75. package/build/cjs/integrations/tracing/mongo/index.js +1 -42
  76. package/build/cjs/integrations/tracing/mongo/index.js.map +1 -1
  77. package/build/cjs/integrations/tracing/mongo/vendored/instrumentation.js +12 -562
  78. package/build/cjs/integrations/tracing/mongo/vendored/instrumentation.js.map +1 -1
  79. package/build/cjs/integrations/tracing/mongo/vendored/internal-types.js.map +1 -1
  80. package/build/cjs/integrations/tracing/mongo/vendored/patches.js +151 -0
  81. package/build/cjs/integrations/tracing/mongo/vendored/patches.js.map +1 -0
  82. package/build/cjs/integrations/tracing/mongo/vendored/semconv.js +0 -4
  83. package/build/cjs/integrations/tracing/mongo/vendored/semconv.js.map +1 -1
  84. package/build/cjs/integrations/tracing/mongo/vendored/utils.js +153 -0
  85. package/build/cjs/integrations/tracing/mongo/vendored/utils.js.map +1 -0
  86. package/build/cjs/integrations/tracing/mongoose/index.js +1 -8
  87. package/build/cjs/integrations/tracing/mongoose/index.js.map +1 -1
  88. package/build/cjs/integrations/tracing/mongoose/vendored/mongoose.js +56 -203
  89. package/build/cjs/integrations/tracing/mongoose/vendored/mongoose.js.map +1 -1
  90. package/build/cjs/integrations/tracing/mongoose/vendored/semconv.js +0 -4
  91. package/build/cjs/integrations/tracing/mongoose/vendored/semconv.js.map +1 -1
  92. package/build/cjs/integrations/tracing/mongoose/vendored/utils.js +19 -49
  93. package/build/cjs/integrations/tracing/mongoose/vendored/utils.js.map +1 -1
  94. package/build/cjs/integrations/tracing/mysql/vendored/AttributeNames.js.map +1 -1
  95. package/build/cjs/integrations/tracing/mysql/vendored/instrumentation.js.map +1 -1
  96. package/build/cjs/integrations/tracing/mysql/vendored/semconv.js.map +1 -1
  97. package/build/cjs/integrations/tracing/mysql/vendored/utils.js.map +1 -1
  98. package/build/cjs/integrations/tracing/mysql2/index.js +1 -8
  99. package/build/cjs/integrations/tracing/mysql2/index.js.map +1 -1
  100. package/build/cjs/integrations/tracing/mysql2/vendored/instrumentation.js +21 -59
  101. package/build/cjs/integrations/tracing/mysql2/vendored/instrumentation.js.map +1 -1
  102. package/build/cjs/integrations/tracing/mysql2/vendored/semconv.js.map +1 -1
  103. package/build/cjs/integrations/tracing/mysql2/vendored/utils.js +14 -33
  104. package/build/cjs/integrations/tracing/mysql2/vendored/utils.js.map +1 -1
  105. package/build/cjs/integrations/tracing/postgres/index.js +0 -4
  106. package/build/cjs/integrations/tracing/postgres/index.js.map +1 -1
  107. package/build/cjs/integrations/tracing/postgres/vendored/enums/AttributeNames.js +0 -1
  108. package/build/cjs/integrations/tracing/postgres/vendored/enums/AttributeNames.js.map +1 -1
  109. package/build/cjs/integrations/tracing/postgres/vendored/enums/SpanNames.js.map +1 -1
  110. package/build/cjs/integrations/tracing/postgres/vendored/instrumentation.js +51 -261
  111. package/build/cjs/integrations/tracing/postgres/vendored/instrumentation.js.map +1 -1
  112. package/build/cjs/integrations/tracing/postgres/vendored/semconv.js +0 -12
  113. package/build/cjs/integrations/tracing/postgres/vendored/semconv.js.map +1 -1
  114. package/build/cjs/integrations/tracing/postgres/vendored/utils.js +43 -167
  115. package/build/cjs/integrations/tracing/postgres/vendored/utils.js.map +1 -1
  116. package/build/cjs/integrations/tracing/prisma/vendored/active-tracing-helper.js.map +1 -1
  117. package/build/cjs/integrations/tracing/prisma/vendored/constants.js.map +1 -1
  118. package/build/cjs/integrations/tracing/prisma/vendored/global.js.map +1 -1
  119. package/build/cjs/integrations/tracing/prisma/vendored/instrumentation.js.map +1 -1
  120. package/build/cjs/integrations/tracing/redis/index.js.map +1 -1
  121. package/build/cjs/integrations/tracing/redis/vendored/ioredis-instrumentation.js +89 -160
  122. package/build/cjs/integrations/tracing/redis/vendored/ioredis-instrumentation.js.map +1 -1
  123. package/build/cjs/integrations/tracing/redis/vendored/redis-common.js.map +1 -1
  124. package/build/cjs/integrations/tracing/redis/vendored/redis-instrumentation.js +92 -231
  125. package/build/cjs/integrations/tracing/redis/vendored/redis-instrumentation.js.map +1 -1
  126. package/build/cjs/integrations/tracing/redis/vendored/semconv.js +0 -2
  127. package/build/cjs/integrations/tracing/redis/vendored/semconv.js.map +1 -1
  128. package/build/cjs/integrations/tracing/tedious/index.js +1 -25
  129. package/build/cjs/integrations/tracing/tedious/index.js.map +1 -1
  130. package/build/cjs/integrations/tracing/tedious/vendored/instrumentation.js +25 -76
  131. package/build/cjs/integrations/tracing/tedious/vendored/instrumentation.js.map +1 -1
  132. package/build/cjs/integrations/tracing/tedious/vendored/semconv.js.map +1 -1
  133. package/build/cjs/integrations/tracing/tedious/vendored/utils.js.map +1 -1
  134. package/build/cjs/sdk/diagnosticsChannelInjection.js +21 -0
  135. package/build/cjs/sdk/diagnosticsChannelInjection.js.map +1 -0
  136. package/build/cjs/sdk/experimentalUseDiagnosticsChannelInjection.js +19 -0
  137. package/build/cjs/sdk/experimentalUseDiagnosticsChannelInjection.js.map +1 -0
  138. package/build/cjs/sdk/index.js +17 -1
  139. package/build/cjs/sdk/index.js.map +1 -1
  140. package/build/esm/index.js +1 -0
  141. package/build/esm/index.js.map +1 -1
  142. package/build/esm/integrations/fs/index.js +4 -85
  143. package/build/esm/integrations/fs/index.js.map +1 -1
  144. package/build/esm/integrations/fs/vendored/constants.js.map +1 -1
  145. package/build/esm/integrations/fs/vendored/instrumentation.js +147 -177
  146. package/build/esm/integrations/fs/vendored/instrumentation.js.map +1 -1
  147. package/build/esm/integrations/fs/vendored/utils.js.map +1 -1
  148. package/build/esm/integrations/node-fetch/vendored/undici.js.map +1 -1
  149. package/build/esm/integrations/tracing/amqplib/vendored/amqplib.js.map +1 -1
  150. package/build/esm/integrations/tracing/amqplib/vendored/semconv-obsolete.js.map +1 -1
  151. package/build/esm/integrations/tracing/amqplib/vendored/semconv.js.map +1 -1
  152. package/build/esm/integrations/tracing/amqplib/vendored/types.js.map +1 -1
  153. package/build/esm/integrations/tracing/amqplib/vendored/utils.js.map +1 -1
  154. package/build/esm/integrations/tracing/connect/index.js +1 -22
  155. package/build/esm/integrations/tracing/connect/index.js.map +1 -1
  156. package/build/esm/integrations/tracing/connect/vendored/enums/AttributeNames.js +1 -6
  157. package/build/esm/integrations/tracing/connect/vendored/enums/AttributeNames.js.map +1 -1
  158. package/build/esm/integrations/tracing/connect/vendored/instrumentation.js +36 -44
  159. package/build/esm/integrations/tracing/connect/vendored/instrumentation.js.map +1 -1
  160. package/build/esm/integrations/tracing/connect/vendored/internal-types.js.map +1 -1
  161. package/build/esm/integrations/tracing/connect/vendored/utils.js +3 -2
  162. package/build/esm/integrations/tracing/connect/vendored/utils.js.map +1 -1
  163. package/build/esm/integrations/tracing/dataloader/vendored/instrumentation.js.map +1 -1
  164. package/build/esm/integrations/tracing/fastify/v3/instrumentation.js +1 -1
  165. package/build/esm/integrations/tracing/fastify/v3/instrumentation.js.map +1 -1
  166. package/build/esm/integrations/tracing/fastify/vendored/instrumentation.js.map +1 -1
  167. package/build/esm/integrations/tracing/genericPool/index.js +3 -17
  168. package/build/esm/integrations/tracing/genericPool/index.js.map +1 -1
  169. package/build/esm/integrations/tracing/genericPool/vendored/instrumentation.js +31 -19
  170. package/build/esm/integrations/tracing/genericPool/vendored/instrumentation.js.map +1 -1
  171. package/build/esm/integrations/tracing/graphql/index.js +3 -53
  172. package/build/esm/integrations/tracing/graphql/index.js.map +1 -1
  173. package/build/esm/integrations/tracing/graphql/vendored/enum.js.map +1 -1
  174. package/build/esm/integrations/tracing/graphql/vendored/enums/AttributeNames.js +0 -2
  175. package/build/esm/integrations/tracing/graphql/vendored/enums/AttributeNames.js.map +1 -1
  176. package/build/esm/integrations/tracing/graphql/vendored/instrumentation.js +69 -59
  177. package/build/esm/integrations/tracing/graphql/vendored/instrumentation.js.map +1 -1
  178. package/build/esm/integrations/tracing/graphql/vendored/internal-types.js.map +1 -1
  179. package/build/esm/integrations/tracing/graphql/vendored/symbols.js.map +1 -1
  180. package/build/esm/integrations/tracing/graphql/vendored/utils.js +29 -62
  181. package/build/esm/integrations/tracing/graphql/vendored/utils.js.map +1 -1
  182. package/build/esm/integrations/tracing/hapi/index.js +1 -18
  183. package/build/esm/integrations/tracing/hapi/index.js.map +1 -1
  184. package/build/esm/integrations/tracing/hapi/vendored/enums/AttributeNames.js.map +1 -1
  185. package/build/esm/integrations/tracing/hapi/vendored/instrumentation.js +30 -47
  186. package/build/esm/integrations/tracing/hapi/vendored/instrumentation.js.map +1 -1
  187. package/build/esm/integrations/tracing/hapi/vendored/internal-types.js.map +1 -1
  188. package/build/esm/integrations/tracing/hapi/vendored/semconv.js.map +1 -1
  189. package/build/esm/integrations/tracing/hapi/vendored/utils.js +5 -10
  190. package/build/esm/integrations/tracing/hapi/vendored/utils.js.map +1 -1
  191. package/build/esm/integrations/tracing/index.js +1 -0
  192. package/build/esm/integrations/tracing/index.js.map +1 -1
  193. package/build/esm/integrations/tracing/kafka/vendored/instrumentation.js.map +1 -1
  194. package/build/esm/integrations/tracing/kafka/vendored/internal-types.js.map +1 -1
  195. package/build/esm/integrations/tracing/kafka/vendored/propagator.js.map +1 -1
  196. package/build/esm/integrations/tracing/kafka/vendored/semconv.js.map +1 -1
  197. package/build/esm/integrations/tracing/knex/index.js +4 -19
  198. package/build/esm/integrations/tracing/knex/index.js.map +1 -1
  199. package/build/esm/integrations/tracing/knex/vendored/instrumentation.js +66 -94
  200. package/build/esm/integrations/tracing/knex/vendored/instrumentation.js.map +1 -1
  201. package/build/esm/integrations/tracing/knex/vendored/semconv.js +2 -1
  202. package/build/esm/integrations/tracing/knex/vendored/semconv.js.map +1 -1
  203. package/build/esm/integrations/tracing/knex/vendored/utils.js +3 -15
  204. package/build/esm/integrations/tracing/knex/vendored/utils.js.map +1 -1
  205. package/build/esm/integrations/tracing/koa/index.js +3 -26
  206. package/build/esm/integrations/tracing/koa/index.js.map +1 -1
  207. package/build/esm/integrations/tracing/koa/vendored/enums/AttributeNames.js.map +1 -1
  208. package/build/esm/integrations/tracing/koa/vendored/instrumentation.js +31 -43
  209. package/build/esm/integrations/tracing/koa/vendored/instrumentation.js.map +1 -1
  210. package/build/esm/integrations/tracing/koa/vendored/internal-types.js.map +1 -1
  211. package/build/esm/integrations/tracing/koa/vendored/types.js.map +1 -1
  212. package/build/esm/integrations/tracing/koa/vendored/utils.js.map +1 -1
  213. package/build/esm/integrations/tracing/lrumemoizer/vendored/instrumentation.js.map +1 -1
  214. package/build/esm/integrations/tracing/mongo/index.js +3 -43
  215. package/build/esm/integrations/tracing/mongo/index.js.map +1 -1
  216. package/build/esm/integrations/tracing/mongo/vendored/instrumentation.js +13 -563
  217. package/build/esm/integrations/tracing/mongo/vendored/instrumentation.js.map +1 -1
  218. package/build/esm/integrations/tracing/mongo/vendored/internal-types.js.map +1 -1
  219. package/build/esm/integrations/tracing/mongo/vendored/patches.js +143 -0
  220. package/build/esm/integrations/tracing/mongo/vendored/patches.js.map +1 -0
  221. package/build/esm/integrations/tracing/mongo/vendored/semconv.js +1 -3
  222. package/build/esm/integrations/tracing/mongo/vendored/semconv.js.map +1 -1
  223. package/build/esm/integrations/tracing/mongo/vendored/utils.js +146 -0
  224. package/build/esm/integrations/tracing/mongo/vendored/utils.js.map +1 -0
  225. package/build/esm/integrations/tracing/mongoose/index.js +2 -9
  226. package/build/esm/integrations/tracing/mongoose/index.js.map +1 -1
  227. package/build/esm/integrations/tracing/mongoose/vendored/mongoose.js +59 -206
  228. package/build/esm/integrations/tracing/mongoose/vendored/mongoose.js.map +1 -1
  229. package/build/esm/integrations/tracing/mongoose/vendored/semconv.js +1 -3
  230. package/build/esm/integrations/tracing/mongoose/vendored/semconv.js.map +1 -1
  231. package/build/esm/integrations/tracing/mongoose/vendored/utils.js +20 -50
  232. package/build/esm/integrations/tracing/mongoose/vendored/utils.js.map +1 -1
  233. package/build/esm/integrations/tracing/mysql/vendored/AttributeNames.js.map +1 -1
  234. package/build/esm/integrations/tracing/mysql/vendored/instrumentation.js.map +1 -1
  235. package/build/esm/integrations/tracing/mysql/vendored/semconv.js.map +1 -1
  236. package/build/esm/integrations/tracing/mysql/vendored/utils.js.map +1 -1
  237. package/build/esm/integrations/tracing/mysql2/index.js +2 -9
  238. package/build/esm/integrations/tracing/mysql2/index.js.map +1 -1
  239. package/build/esm/integrations/tracing/mysql2/vendored/instrumentation.js +26 -64
  240. package/build/esm/integrations/tracing/mysql2/vendored/instrumentation.js.map +1 -1
  241. package/build/esm/integrations/tracing/mysql2/vendored/semconv.js.map +1 -1
  242. package/build/esm/integrations/tracing/mysql2/vendored/utils.js +15 -34
  243. package/build/esm/integrations/tracing/mysql2/vendored/utils.js.map +1 -1
  244. package/build/esm/integrations/tracing/postgres/index.js +1 -5
  245. package/build/esm/integrations/tracing/postgres/index.js.map +1 -1
  246. package/build/esm/integrations/tracing/postgres/vendored/enums/AttributeNames.js +0 -1
  247. package/build/esm/integrations/tracing/postgres/vendored/enums/AttributeNames.js.map +1 -1
  248. package/build/esm/integrations/tracing/postgres/vendored/enums/SpanNames.js.map +1 -1
  249. package/build/esm/integrations/tracing/postgres/vendored/instrumentation.js +52 -262
  250. package/build/esm/integrations/tracing/postgres/vendored/instrumentation.js.map +1 -1
  251. package/build/esm/integrations/tracing/postgres/vendored/semconv.js +1 -7
  252. package/build/esm/integrations/tracing/postgres/vendored/semconv.js.map +1 -1
  253. package/build/esm/integrations/tracing/postgres/vendored/utils.js +44 -165
  254. package/build/esm/integrations/tracing/postgres/vendored/utils.js.map +1 -1
  255. package/build/esm/integrations/tracing/prisma/vendored/active-tracing-helper.js.map +1 -1
  256. package/build/esm/integrations/tracing/prisma/vendored/constants.js.map +1 -1
  257. package/build/esm/integrations/tracing/prisma/vendored/global.js.map +1 -1
  258. package/build/esm/integrations/tracing/prisma/vendored/instrumentation.js.map +1 -1
  259. package/build/esm/integrations/tracing/redis/index.js.map +1 -1
  260. package/build/esm/integrations/tracing/redis/vendored/ioredis-instrumentation.js +92 -163
  261. package/build/esm/integrations/tracing/redis/vendored/ioredis-instrumentation.js.map +1 -1
  262. package/build/esm/integrations/tracing/redis/vendored/redis-common.js.map +1 -1
  263. package/build/esm/integrations/tracing/redis/vendored/redis-instrumentation.js +94 -233
  264. package/build/esm/integrations/tracing/redis/vendored/redis-instrumentation.js.map +1 -1
  265. package/build/esm/integrations/tracing/redis/vendored/semconv.js +1 -2
  266. package/build/esm/integrations/tracing/redis/vendored/semconv.js.map +1 -1
  267. package/build/esm/integrations/tracing/tedious/index.js +3 -27
  268. package/build/esm/integrations/tracing/tedious/index.js.map +1 -1
  269. package/build/esm/integrations/tracing/tedious/vendored/instrumentation.js +29 -79
  270. package/build/esm/integrations/tracing/tedious/vendored/instrumentation.js.map +1 -1
  271. package/build/esm/integrations/tracing/tedious/vendored/semconv.js.map +1 -1
  272. package/build/esm/integrations/tracing/tedious/vendored/utils.js.map +1 -1
  273. package/build/esm/package.json +1 -1
  274. package/build/esm/sdk/diagnosticsChannelInjection.js +17 -0
  275. package/build/esm/sdk/diagnosticsChannelInjection.js.map +1 -0
  276. package/build/esm/sdk/experimentalUseDiagnosticsChannelInjection.js +17 -0
  277. package/build/esm/sdk/experimentalUseDiagnosticsChannelInjection.js.map +1 -0
  278. package/build/esm/sdk/index.js +17 -1
  279. package/build/esm/sdk/index.js.map +1 -1
  280. package/build/import-hook.mjs +6 -0
  281. package/build/types/index.d.ts +1 -0
  282. package/build/types/index.d.ts.map +1 -1
  283. package/build/types/integrations/fs/index.d.ts.map +1 -1
  284. package/build/types/integrations/fs/vendored/constants.d.ts.map +1 -1
  285. package/build/types/integrations/fs/vendored/instrumentation.d.ts +6 -10
  286. package/build/types/integrations/fs/vendored/instrumentation.d.ts.map +1 -1
  287. package/build/types/integrations/fs/vendored/types.d.ts +10 -15
  288. package/build/types/integrations/fs/vendored/types.d.ts.map +1 -1
  289. package/build/types/integrations/fs/vendored/utils.d.ts +2 -2
  290. package/build/types/integrations/fs/vendored/utils.d.ts.map +1 -1
  291. package/build/types/integrations/node-fetch/vendored/internal-types.d.ts.map +1 -1
  292. package/build/types/integrations/node-fetch/vendored/types.d.ts.map +1 -1
  293. package/build/types/integrations/node-fetch/vendored/undici.d.ts.map +1 -1
  294. package/build/types/integrations/tracing/amqplib/vendored/amqplib.d.ts.map +1 -1
  295. package/build/types/integrations/tracing/amqplib/vendored/semconv-obsolete.d.ts.map +1 -1
  296. package/build/types/integrations/tracing/amqplib/vendored/semconv.d.ts.map +1 -1
  297. package/build/types/integrations/tracing/amqplib/vendored/types.d.ts.map +1 -1
  298. package/build/types/integrations/tracing/amqplib/vendored/utils.d.ts.map +1 -1
  299. package/build/types/integrations/tracing/connect/index.d.ts.map +1 -1
  300. package/build/types/integrations/tracing/connect/vendored/enums/AttributeNames.d.ts +0 -4
  301. package/build/types/integrations/tracing/connect/vendored/enums/AttributeNames.d.ts.map +1 -1
  302. package/build/types/integrations/tracing/connect/vendored/instrumentation.d.ts +5 -5
  303. package/build/types/integrations/tracing/connect/vendored/instrumentation.d.ts.map +1 -1
  304. package/build/types/integrations/tracing/connect/vendored/internal-types.d.ts +2 -2
  305. package/build/types/integrations/tracing/connect/vendored/internal-types.d.ts.map +1 -1
  306. package/build/types/integrations/tracing/connect/vendored/utils.d.ts +1 -1
  307. package/build/types/integrations/tracing/connect/vendored/utils.d.ts.map +1 -1
  308. package/build/types/integrations/tracing/dataloader/vendored/instrumentation.d.ts.map +1 -1
  309. package/build/types/integrations/tracing/dataloader/vendored/types.d.ts.map +1 -1
  310. package/build/types/integrations/tracing/fastify/vendored/instrumentation.d.ts.map +1 -1
  311. package/build/types/integrations/tracing/genericPool/index.d.ts.map +1 -1
  312. package/build/types/integrations/tracing/genericPool/vendored/instrumentation.d.ts.map +1 -1
  313. package/build/types/integrations/tracing/graphql/index.d.ts.map +1 -1
  314. package/build/types/integrations/tracing/graphql/vendored/enum.d.ts.map +1 -1
  315. package/build/types/integrations/tracing/graphql/vendored/enums/AttributeNames.d.ts +1 -3
  316. package/build/types/integrations/tracing/graphql/vendored/enums/AttributeNames.d.ts.map +1 -1
  317. package/build/types/integrations/tracing/graphql/vendored/instrumentation.d.ts +7 -2
  318. package/build/types/integrations/tracing/graphql/vendored/instrumentation.d.ts.map +1 -1
  319. package/build/types/integrations/tracing/graphql/vendored/internal-types.d.ts +4 -4
  320. package/build/types/integrations/tracing/graphql/vendored/internal-types.d.ts.map +1 -1
  321. package/build/types/integrations/tracing/graphql/vendored/symbols.d.ts.map +1 -1
  322. package/build/types/integrations/tracing/graphql/vendored/types.d.ts +5 -43
  323. package/build/types/integrations/tracing/graphql/vendored/types.d.ts.map +1 -1
  324. package/build/types/integrations/tracing/graphql/vendored/utils.d.ts +8 -11
  325. package/build/types/integrations/tracing/graphql/vendored/utils.d.ts.map +1 -1
  326. package/build/types/integrations/tracing/hapi/index.d.ts.map +1 -1
  327. package/build/types/integrations/tracing/hapi/vendored/enums/AttributeNames.d.ts.map +1 -1
  328. package/build/types/integrations/tracing/hapi/vendored/instrumentation.d.ts +2 -2
  329. package/build/types/integrations/tracing/hapi/vendored/instrumentation.d.ts.map +1 -1
  330. package/build/types/integrations/tracing/hapi/vendored/internal-types.d.ts.map +1 -1
  331. package/build/types/integrations/tracing/hapi/vendored/semconv.d.ts.map +1 -1
  332. package/build/types/integrations/tracing/hapi/vendored/utils.d.ts +3 -4
  333. package/build/types/integrations/tracing/hapi/vendored/utils.d.ts.map +1 -1
  334. package/build/types/integrations/tracing/index.d.ts.map +1 -1
  335. package/build/types/integrations/tracing/kafka/vendored/instrumentation.d.ts.map +1 -1
  336. package/build/types/integrations/tracing/kafka/vendored/internal-types.d.ts.map +1 -1
  337. package/build/types/integrations/tracing/kafka/vendored/propagator.d.ts.map +1 -1
  338. package/build/types/integrations/tracing/kafka/vendored/semconv.d.ts.map +1 -1
  339. package/build/types/integrations/tracing/kafka/vendored/types.d.ts.map +1 -1
  340. package/build/types/integrations/tracing/knex/index.d.ts.map +1 -1
  341. package/build/types/integrations/tracing/knex/vendored/instrumentation.d.ts +8 -10
  342. package/build/types/integrations/tracing/knex/vendored/instrumentation.d.ts.map +1 -1
  343. package/build/types/integrations/tracing/knex/vendored/semconv.d.ts +1 -0
  344. package/build/types/integrations/tracing/knex/vendored/semconv.d.ts.map +1 -1
  345. package/build/types/integrations/tracing/knex/vendored/utils.d.ts +0 -6
  346. package/build/types/integrations/tracing/knex/vendored/utils.d.ts.map +1 -1
  347. package/build/types/integrations/tracing/koa/index.d.ts.map +1 -1
  348. package/build/types/integrations/tracing/koa/vendored/enums/AttributeNames.d.ts.map +1 -1
  349. package/build/types/integrations/tracing/koa/vendored/instrumentation.d.ts +1 -1
  350. package/build/types/integrations/tracing/koa/vendored/instrumentation.d.ts.map +1 -1
  351. package/build/types/integrations/tracing/koa/vendored/internal-types.d.ts +4 -4
  352. package/build/types/integrations/tracing/koa/vendored/internal-types.d.ts.map +1 -1
  353. package/build/types/integrations/tracing/koa/vendored/types.d.ts +2 -39
  354. package/build/types/integrations/tracing/koa/vendored/types.d.ts.map +1 -1
  355. package/build/types/integrations/tracing/koa/vendored/utils.d.ts +3 -3
  356. package/build/types/integrations/tracing/koa/vendored/utils.d.ts.map +1 -1
  357. package/build/types/integrations/tracing/lrumemoizer/vendored/instrumentation.d.ts.map +1 -1
  358. package/build/types/integrations/tracing/mongo/index.d.ts +0 -4
  359. package/build/types/integrations/tracing/mongo/index.d.ts.map +1 -1
  360. package/build/types/integrations/tracing/mongo/vendored/instrumentation.d.ts +4 -72
  361. package/build/types/integrations/tracing/mongo/vendored/instrumentation.d.ts.map +1 -1
  362. package/build/types/integrations/tracing/mongo/vendored/internal-types.d.ts +0 -59
  363. package/build/types/integrations/tracing/mongo/vendored/internal-types.d.ts.map +1 -1
  364. package/build/types/integrations/tracing/mongo/vendored/patches.d.ts +15 -0
  365. package/build/types/integrations/tracing/mongo/vendored/patches.d.ts.map +1 -0
  366. package/build/types/integrations/tracing/mongo/vendored/semconv.d.ts +0 -54
  367. package/build/types/integrations/tracing/mongo/vendored/semconv.d.ts.map +1 -1
  368. package/build/types/integrations/tracing/mongo/vendored/utils.d.ts +24 -0
  369. package/build/types/integrations/tracing/mongo/vendored/utils.d.ts.map +1 -0
  370. package/build/types/integrations/tracing/mongoose/index.d.ts.map +1 -1
  371. package/build/types/integrations/tracing/mongoose/vendored/mongoose-types.d.ts +3 -0
  372. package/build/types/integrations/tracing/mongoose/vendored/mongoose-types.d.ts.map +1 -1
  373. package/build/types/integrations/tracing/mongoose/vendored/mongoose.d.ts +3 -8
  374. package/build/types/integrations/tracing/mongoose/vendored/mongoose.d.ts.map +1 -1
  375. package/build/types/integrations/tracing/mongoose/vendored/semconv.d.ts +0 -14
  376. package/build/types/integrations/tracing/mongoose/vendored/semconv.d.ts.map +1 -1
  377. package/build/types/integrations/tracing/mongoose/vendored/utils.d.ts +4 -6
  378. package/build/types/integrations/tracing/mongoose/vendored/utils.d.ts.map +1 -1
  379. package/build/types/integrations/tracing/mysql/vendored/AttributeNames.d.ts.map +1 -1
  380. package/build/types/integrations/tracing/mysql/vendored/instrumentation.d.ts.map +1 -1
  381. package/build/types/integrations/tracing/mysql/vendored/mysql-types.d.ts.map +1 -1
  382. package/build/types/integrations/tracing/mysql/vendored/semconv.d.ts.map +1 -1
  383. package/build/types/integrations/tracing/mysql/vendored/types.d.ts.map +1 -1
  384. package/build/types/integrations/tracing/mysql/vendored/utils.d.ts.map +1 -1
  385. package/build/types/integrations/tracing/mysql2/index.d.ts.map +1 -1
  386. package/build/types/integrations/tracing/mysql2/vendored/instrumentation.d.ts +3 -6
  387. package/build/types/integrations/tracing/mysql2/vendored/instrumentation.d.ts.map +1 -1
  388. package/build/types/integrations/tracing/mysql2/vendored/semconv.d.ts.map +1 -1
  389. package/build/types/integrations/tracing/mysql2/vendored/utils.d.ts +3 -5
  390. package/build/types/integrations/tracing/mysql2/vendored/utils.d.ts.map +1 -1
  391. package/build/types/integrations/tracing/postgres/index.d.ts.map +1 -1
  392. package/build/types/integrations/tracing/postgres/vendored/enums/AttributeNames.d.ts +0 -1
  393. package/build/types/integrations/tracing/postgres/vendored/enums/AttributeNames.d.ts.map +1 -1
  394. package/build/types/integrations/tracing/postgres/vendored/enums/SpanNames.d.ts.map +1 -1
  395. package/build/types/integrations/tracing/postgres/vendored/instrumentation.d.ts +1 -9
  396. package/build/types/integrations/tracing/postgres/vendored/instrumentation.d.ts.map +1 -1
  397. package/build/types/integrations/tracing/postgres/vendored/internal-types.d.ts +0 -2
  398. package/build/types/integrations/tracing/postgres/vendored/internal-types.d.ts.map +1 -1
  399. package/build/types/integrations/tracing/postgres/vendored/pg-pool-types.d.ts.map +1 -1
  400. package/build/types/integrations/tracing/postgres/vendored/pg-types.d.ts.map +1 -1
  401. package/build/types/integrations/tracing/postgres/vendored/semconv.d.ts +0 -50
  402. package/build/types/integrations/tracing/postgres/vendored/semconv.d.ts.map +1 -1
  403. package/build/types/integrations/tracing/postgres/vendored/types.d.ts +2 -56
  404. package/build/types/integrations/tracing/postgres/vendored/types.d.ts.map +1 -1
  405. package/build/types/integrations/tracing/postgres/vendored/utils.d.ts +13 -26
  406. package/build/types/integrations/tracing/postgres/vendored/utils.d.ts.map +1 -1
  407. package/build/types/integrations/tracing/prisma/vendored/active-tracing-helper.d.ts.map +1 -1
  408. package/build/types/integrations/tracing/prisma/vendored/constants.d.ts.map +1 -1
  409. package/build/types/integrations/tracing/prisma/vendored/global.d.ts.map +1 -1
  410. package/build/types/integrations/tracing/prisma/vendored/instrumentation.d.ts.map +1 -1
  411. package/build/types/integrations/tracing/prisma/vendored/types.d.ts.map +1 -1
  412. package/build/types/integrations/tracing/redis/index.d.ts.map +1 -1
  413. package/build/types/integrations/tracing/redis/vendored/ioredis-instrumentation.d.ts +3 -8
  414. package/build/types/integrations/tracing/redis/vendored/ioredis-instrumentation.d.ts.map +1 -1
  415. package/build/types/integrations/tracing/redis/vendored/redis-common.d.ts.map +1 -1
  416. package/build/types/integrations/tracing/redis/vendored/redis-instrumentation.d.ts.map +1 -1
  417. package/build/types/integrations/tracing/redis/vendored/semconv.d.ts.map +1 -1
  418. package/build/types/integrations/tracing/redis/vendored/types.d.ts +2 -36
  419. package/build/types/integrations/tracing/redis/vendored/types.d.ts.map +1 -1
  420. package/build/types/integrations/tracing/tedious/index.d.ts.map +1 -1
  421. package/build/types/integrations/tracing/tedious/vendored/instrumentation.d.ts +3 -14
  422. package/build/types/integrations/tracing/tedious/vendored/instrumentation.d.ts.map +1 -1
  423. package/build/types/integrations/tracing/tedious/vendored/semconv.d.ts.map +1 -1
  424. package/build/types/integrations/tracing/tedious/vendored/utils.d.ts.map +1 -1
  425. package/build/types/sdk/diagnosticsChannelInjection.d.ts +41 -0
  426. package/build/types/sdk/diagnosticsChannelInjection.d.ts.map +1 -0
  427. package/build/types/sdk/experimentalUseDiagnosticsChannelInjection.d.ts +34 -0
  428. package/build/types/sdk/experimentalUseDiagnosticsChannelInjection.d.ts.map +1 -0
  429. package/build/types/sdk/index.d.ts.map +1 -1
  430. package/build/types-ts3.8/index.d.ts +1 -0
  431. package/build/types-ts3.8/integrations/fs/vendored/instrumentation.d.ts +6 -10
  432. package/build/types-ts3.8/integrations/fs/vendored/types.d.ts +10 -15
  433. package/build/types-ts3.8/integrations/fs/vendored/utils.d.ts +2 -2
  434. package/build/types-ts3.8/integrations/tracing/connect/vendored/enums/AttributeNames.d.ts +0 -4
  435. package/build/types-ts3.8/integrations/tracing/connect/vendored/instrumentation.d.ts +4 -4
  436. package/build/types-ts3.8/integrations/tracing/connect/vendored/internal-types.d.ts +2 -2
  437. package/build/types-ts3.8/integrations/tracing/graphql/vendored/enums/AttributeNames.d.ts +1 -3
  438. package/build/types-ts3.8/integrations/tracing/graphql/vendored/instrumentation.d.ts +6 -1
  439. package/build/types-ts3.8/integrations/tracing/graphql/vendored/internal-types.d.ts +3 -3
  440. package/build/types-ts3.8/integrations/tracing/graphql/vendored/types.d.ts +4 -42
  441. package/build/types-ts3.8/integrations/tracing/graphql/vendored/utils.d.ts +6 -9
  442. package/build/types-ts3.8/integrations/tracing/hapi/vendored/instrumentation.d.ts +2 -2
  443. package/build/types-ts3.8/integrations/tracing/hapi/vendored/utils.d.ts +1 -2
  444. package/build/types-ts3.8/integrations/tracing/knex/vendored/instrumentation.d.ts +8 -10
  445. package/build/types-ts3.8/integrations/tracing/knex/vendored/semconv.d.ts +1 -0
  446. package/build/types-ts3.8/integrations/tracing/knex/vendored/utils.d.ts +0 -6
  447. package/build/types-ts3.8/integrations/tracing/koa/vendored/internal-types.d.ts +4 -4
  448. package/build/types-ts3.8/integrations/tracing/koa/vendored/types.d.ts +1 -38
  449. package/build/types-ts3.8/integrations/tracing/mongo/index.d.ts +0 -4
  450. package/build/types-ts3.8/integrations/tracing/mongo/vendored/instrumentation.d.ts +4 -72
  451. package/build/types-ts3.8/integrations/tracing/mongo/vendored/internal-types.d.ts +0 -59
  452. package/build/types-ts3.8/integrations/tracing/mongo/vendored/patches.d.ts +15 -0
  453. package/build/types-ts3.8/integrations/tracing/mongo/vendored/semconv.d.ts +0 -54
  454. package/build/types-ts3.8/integrations/tracing/mongo/vendored/utils.d.ts +24 -0
  455. package/build/types-ts3.8/integrations/tracing/mongoose/vendored/mongoose-types.d.ts +3 -0
  456. package/build/types-ts3.8/integrations/tracing/mongoose/vendored/mongoose.d.ts +3 -8
  457. package/build/types-ts3.8/integrations/tracing/mongoose/vendored/semconv.d.ts +0 -14
  458. package/build/types-ts3.8/integrations/tracing/mongoose/vendored/utils.d.ts +4 -6
  459. package/build/types-ts3.8/integrations/tracing/mysql2/vendored/instrumentation.d.ts +3 -6
  460. package/build/types-ts3.8/integrations/tracing/mysql2/vendored/utils.d.ts +3 -5
  461. package/build/types-ts3.8/integrations/tracing/postgres/vendored/enums/AttributeNames.d.ts +0 -1
  462. package/build/types-ts3.8/integrations/tracing/postgres/vendored/instrumentation.d.ts +0 -8
  463. package/build/types-ts3.8/integrations/tracing/postgres/vendored/internal-types.d.ts +0 -2
  464. package/build/types-ts3.8/integrations/tracing/postgres/vendored/semconv.d.ts +0 -50
  465. package/build/types-ts3.8/integrations/tracing/postgres/vendored/types.d.ts +1 -55
  466. package/build/types-ts3.8/integrations/tracing/postgres/vendored/utils.d.ts +13 -26
  467. package/build/types-ts3.8/integrations/tracing/redis/vendored/ioredis-instrumentation.d.ts +3 -8
  468. package/build/types-ts3.8/integrations/tracing/redis/vendored/types.d.ts +2 -36
  469. package/build/types-ts3.8/integrations/tracing/tedious/vendored/instrumentation.d.ts +3 -14
  470. package/build/types-ts3.8/sdk/diagnosticsChannelInjection.d.ts +41 -0
  471. package/build/types-ts3.8/sdk/experimentalUseDiagnosticsChannelInjection.d.ts +34 -0
  472. package/package.json +20 -6
  473. package/build/cjs/integrations/tracing/knex/vendored/constants.js +0 -16
  474. package/build/cjs/integrations/tracing/knex/vendored/constants.js.map +0 -1
  475. package/build/cjs/integrations/tracing/postgres/vendored/internal-types.js +0 -6
  476. package/build/cjs/integrations/tracing/postgres/vendored/internal-types.js.map +0 -1
  477. package/build/cjs/integrations/tracing/utils/sql-common.js +0 -43
  478. package/build/cjs/integrations/tracing/utils/sql-common.js.map +0 -1
  479. package/build/esm/integrations/tracing/knex/vendored/constants.js +0 -13
  480. package/build/esm/integrations/tracing/knex/vendored/constants.js.map +0 -1
  481. package/build/esm/integrations/tracing/postgres/vendored/internal-types.js +0 -4
  482. package/build/esm/integrations/tracing/postgres/vendored/internal-types.js.map +0 -1
  483. package/build/esm/integrations/tracing/utils/sql-common.js +0 -41
  484. package/build/esm/integrations/tracing/utils/sql-common.js.map +0 -1
  485. package/build/types/integrations/tracing/knex/vendored/constants.d.ts +0 -3
  486. package/build/types/integrations/tracing/knex/vendored/constants.d.ts.map +0 -1
  487. package/build/types/integrations/tracing/knex/vendored/types.d.ts +0 -8
  488. package/build/types/integrations/tracing/knex/vendored/types.d.ts.map +0 -1
  489. package/build/types/integrations/tracing/mongo/vendored/types.d.ts +0 -51
  490. package/build/types/integrations/tracing/mongo/vendored/types.d.ts.map +0 -1
  491. package/build/types/integrations/tracing/mongoose/vendored/types.d.ts +0 -36
  492. package/build/types/integrations/tracing/mongoose/vendored/types.d.ts.map +0 -1
  493. package/build/types/integrations/tracing/mysql2/vendored/types.d.ts +0 -18
  494. package/build/types/integrations/tracing/mysql2/vendored/types.d.ts.map +0 -1
  495. package/build/types/integrations/tracing/tedious/vendored/types.d.ts +0 -10
  496. package/build/types/integrations/tracing/tedious/vendored/types.d.ts.map +0 -1
  497. package/build/types-ts3.8/integrations/tracing/knex/vendored/constants.d.ts +0 -3
  498. package/build/types-ts3.8/integrations/tracing/knex/vendored/types.d.ts +0 -8
  499. package/build/types-ts3.8/integrations/tracing/mongo/vendored/types.d.ts +0 -51
  500. package/build/types-ts3.8/integrations/tracing/mongoose/vendored/types.d.ts +0 -36
  501. package/build/types-ts3.8/integrations/tracing/mysql2/vendored/types.d.ts +0 -18
  502. package/build/types-ts3.8/integrations/tracing/tedious/vendored/types.d.ts +0 -10
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/mongoose/index.ts"],"sourcesContent":["import { MongooseInstrumentation } from './vendored/mongoose';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { addOriginToSpan, generateInstrumentOnce } from '@sentry/node-core';\n\nconst INTEGRATION_NAME = 'Mongoose';\n\nexport const instrumentMongoose = generateInstrumentOnce(\n INTEGRATION_NAME,\n () =>\n new MongooseInstrumentation({\n responseHook(span) {\n addOriginToSpan(span, 'auto.db.otel.mongoose');\n },\n }),\n);\n\nconst _mongooseIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentMongoose();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [mongoose](https://www.npmjs.com/package/mongoose) library.\n *\n * For more information, see the [`mongooseIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/mongoose/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.mongooseIntegration()],\n * });\n * ```\n */\nexport const mongooseIntegration = defineIntegration(_mongooseIntegration);\n"],"names":[],"mappings":";;;;AAKA,MAAM,gBAAA,GAAmB,UAAA;AAElB,MAAM,kBAAA,GAAqB,sBAAA;AAAA,EAChC,gBAAA;AAAA,EACA,MACE,IAAI,uBAAA,CAAwB;AAAA,IAC1B,aAAa,IAAA,EAAM;AACjB,MAAA,eAAA,CAAgB,MAAM,uBAAuB,CAAA;AAAA,IAC/C;AAAA,GACD;AACL;AAEA,MAAM,wBAAwB,MAAM;AAClC,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AACV,MAAA,kBAAA,EAAmB;AAAA,IACrB;AAAA,GACF;AACF,CAAA,CAAA;AAgBO,MAAM,mBAAA,GAAsB,kBAAkB,oBAAoB;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/mongoose/index.ts"],"sourcesContent":["import { MongooseInstrumentation } from './vendored/mongoose';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { generateInstrumentOnce } from '@sentry/node-core';\n\nconst INTEGRATION_NAME = 'Mongoose';\n\nexport const instrumentMongoose = generateInstrumentOnce(INTEGRATION_NAME, () => new MongooseInstrumentation());\n\nconst _mongooseIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentMongoose();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [mongoose](https://www.npmjs.com/package/mongoose) library.\n *\n * For more information, see the [`mongooseIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/mongoose/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.mongooseIntegration()],\n * });\n * ```\n */\nexport const mongooseIntegration = defineIntegration(_mongooseIntegration);\n"],"names":[],"mappings":";;;;AAKA,MAAM,gBAAA,GAAmB,UAAA;AAElB,MAAM,qBAAqB,sBAAA,CAAuB,gBAAA,EAAkB,MAAM,IAAI,yBAAyB;AAE9G,MAAM,wBAAwB,MAAM;AAClC,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AACV,MAAA,kBAAA,EAAmB;AAAA,IACrB;AAAA,GACF;AACF,CAAA,CAAA;AAgBO,MAAM,mBAAA,GAAsB,kBAAkB,oBAAoB;;;;"}
@@ -1,12 +1,11 @@
1
- import { trace, context, SpanKind } from '@opentelemetry/api';
2
- import { suppressTracing } from '@opentelemetry/core';
1
+ import { SpanKind } from '@opentelemetry/api';
2
+ import { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';
3
+ import { SDK_VERSION, getActiveSpan, startInactiveSpan, withActiveSpan, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/core';
4
+ import { ATTR_DB_SYSTEM, ATTR_DB_OPERATION } from './semconv.js';
3
5
  import { getAttributesFromCollection, handleCallbackResponse, handlePromiseResponse } from './utils.js';
4
- import { InstrumentationBase, semconvStabilityFromStr, InstrumentationNodeModuleDefinition, SemconvStability } from '@opentelemetry/instrumentation';
5
- import { SDK_VERSION } from '@sentry/core';
6
- import { ATTR_DB_STATEMENT, ATTR_DB_OPERATION, ATTR_DB_SYSTEM, DB_SYSTEM_NAME_VALUE_MONGODB } from './semconv.js';
7
- import { ATTR_DB_QUERY_TEXT, ATTR_DB_OPERATION_NAME, ATTR_DB_SYSTEM_NAME } from '@opentelemetry/semantic-conventions';
8
6
 
9
7
  const PACKAGE_NAME = "@sentry/instrumentation-mongoose";
8
+ const ORIGIN = "auto.db.otel.mongoose";
10
9
  const contextCaptureFunctionsCommon = [
11
10
  "deleteOne",
12
11
  "deleteMany",
@@ -50,12 +49,6 @@ const _ALREADY_INSTRUMENTED = /* @__PURE__ */ Symbol("already-instrumented");
50
49
  class MongooseInstrumentation extends InstrumentationBase {
51
50
  constructor(config = {}) {
52
51
  super(PACKAGE_NAME, SDK_VERSION, config);
53
- this._setSemconvStabilityFromEnv();
54
- }
55
- // Used for testing.
56
- _setSemconvStabilityFromEnv() {
57
- this._netSemconvStability = semconvStabilityFromStr("http", process.env.OTEL_SEMCONV_STABILITY_OPT_IN);
58
- this._dbSemconvStability = semconvStabilityFromStr("database", process.env.OTEL_SEMCONV_STABILITY_OPT_IN);
59
52
  }
60
53
  init() {
61
54
  const module = new InstrumentationNodeModuleDefinition(
@@ -67,37 +60,29 @@ class MongooseInstrumentation extends InstrumentationBase {
67
60
  return module;
68
61
  }
69
62
  patch(module, moduleVersion) {
70
- const moduleExports = module[Symbol.toStringTag] === "Module" ? module.default : module;
71
- this._wrap(moduleExports.Model.prototype, "save", this.patchOnModelMethods("save", moduleVersion));
63
+ const moduleExports = module[Symbol.toStringTag] === "Module" && module.default ? module.default : module;
64
+ this._wrap(moduleExports.Model.prototype, "save", this.patchOnModelMethods("save"));
72
65
  moduleExports.Model.prototype.$save = moduleExports.Model.prototype.save;
73
66
  if (instrumentRemove(moduleVersion)) {
74
- this._wrap(moduleExports.Model.prototype, "remove", this.patchOnModelMethods("remove", moduleVersion));
67
+ this._wrap(moduleExports.Model.prototype, "remove", this.patchOnModelMethods("remove"));
75
68
  }
76
69
  if (needsDocumentMethodPatch(moduleVersion)) {
77
- this._wrap(
78
- moduleExports.Model.prototype,
79
- "updateOne",
80
- this._patchDocumentUpdateMethods("updateOne", moduleVersion)
81
- );
82
- this._wrap(
83
- moduleExports.Model.prototype,
84
- "deleteOne",
85
- this._patchDocumentUpdateMethods("deleteOne", moduleVersion)
86
- );
70
+ this._wrap(moduleExports.Model.prototype, "updateOne", this._patchDocumentUpdateMethods("updateOne"));
71
+ this._wrap(moduleExports.Model.prototype, "deleteOne", this._patchDocumentUpdateMethods("deleteOne"));
87
72
  }
88
- this._wrap(moduleExports.Query.prototype, "exec", this.patchQueryExec(moduleVersion));
89
- this._wrap(moduleExports.Aggregate.prototype, "exec", this.patchAggregateExec(moduleVersion));
73
+ this._wrap(moduleExports.Query.prototype, "exec", this.patchQueryExec());
74
+ this._wrap(moduleExports.Aggregate.prototype, "exec", this.patchAggregateExec());
90
75
  const contextCaptureFunctions = getContextCaptureFunctions(moduleVersion);
91
76
  contextCaptureFunctions.forEach((funcName) => {
92
77
  this._wrap(moduleExports.Query.prototype, funcName, this.patchAndCaptureSpanContext(funcName));
93
78
  });
94
79
  this._wrap(moduleExports.Model, "aggregate", this.patchModelAggregate());
95
- this._wrap(moduleExports.Model, "insertMany", this.patchModelStatic("insertMany", moduleVersion));
96
- this._wrap(moduleExports.Model, "bulkWrite", this.patchModelStatic("bulkWrite", moduleVersion));
80
+ this._wrap(moduleExports.Model, "insertMany", this.patchModelStatic("insertMany"));
81
+ this._wrap(moduleExports.Model, "bulkWrite", this.patchModelStatic("bulkWrite"));
97
82
  return moduleExports;
98
83
  }
99
84
  unpatch(module, moduleVersion) {
100
- const moduleExports = module[Symbol.toStringTag] === "Module" ? module.default : module;
85
+ const moduleExports = module[Symbol.toStringTag] === "Module" && module.default ? module.default : module;
101
86
  const contextCaptureFunctions = getContextCaptureFunctions(moduleVersion);
102
87
  this._unwrap(moduleExports.Model.prototype, "save");
103
88
  moduleExports.Model.prototype.$save = moduleExports.Model.prototype.save;
@@ -117,140 +102,54 @@ class MongooseInstrumentation extends InstrumentationBase {
117
102
  this._unwrap(moduleExports.Model, "insertMany");
118
103
  this._unwrap(moduleExports.Model, "bulkWrite");
119
104
  }
120
- patchAggregateExec(moduleVersion) {
105
+ patchAggregateExec() {
121
106
  const self = this;
122
107
  return (originalAggregate) => {
123
108
  return function exec(callback) {
124
- if (self.getConfig().requireParentSpan && trace.getSpan(context.active()) === void 0) {
125
- return originalAggregate.apply(this, arguments);
126
- }
127
109
  const parentSpan = this[_STORED_PARENT_SPAN];
128
- const attributes = {};
129
- const { dbStatementSerializer } = self.getConfig();
130
- if (dbStatementSerializer) {
131
- const statement = dbStatementSerializer("aggregate", {
132
- options: this.options,
133
- aggregatePipeline: this._pipeline
134
- });
135
- if (self._dbSemconvStability & SemconvStability.OLD) {
136
- attributes[ATTR_DB_STATEMENT] = statement;
137
- }
138
- if (self._dbSemconvStability & SemconvStability.STABLE) {
139
- attributes[ATTR_DB_QUERY_TEXT] = statement;
140
- }
141
- }
142
- const span = self._startSpan(
143
- this._model.collection,
144
- this._model?.modelName,
145
- "aggregate",
146
- attributes,
147
- parentSpan
148
- );
149
- return self._handleResponse(span, originalAggregate, this, arguments, callback, moduleVersion);
110
+ const span = self._startSpan(this._model.collection, this._model?.modelName, "aggregate", parentSpan);
111
+ return self._handleResponse(span, originalAggregate, this, arguments, callback);
150
112
  };
151
113
  };
152
114
  }
153
- patchQueryExec(moduleVersion) {
115
+ patchQueryExec() {
154
116
  const self = this;
155
117
  return (originalExec) => {
156
118
  return function exec(callback) {
157
119
  if (this[_ALREADY_INSTRUMENTED]) {
158
120
  return originalExec.apply(this, arguments);
159
121
  }
160
- if (self.getConfig().requireParentSpan && trace.getSpan(context.active()) === void 0) {
161
- return originalExec.apply(this, arguments);
162
- }
163
122
  const parentSpan = this[_STORED_PARENT_SPAN];
164
- const attributes = {};
165
- const { dbStatementSerializer } = self.getConfig();
166
- if (dbStatementSerializer) {
167
- const statement = dbStatementSerializer(this.op, {
168
- // Use public API methods (getFilter/getOptions) for better compatibility
169
- condition: this.getFilter?.() ?? this._conditions,
170
- updates: this._update,
171
- options: this.getOptions?.() ?? this.options,
172
- fields: this._fields
173
- });
174
- if (self._dbSemconvStability & SemconvStability.OLD) {
175
- attributes[ATTR_DB_STATEMENT] = statement;
176
- }
177
- if (self._dbSemconvStability & SemconvStability.STABLE) {
178
- attributes[ATTR_DB_QUERY_TEXT] = statement;
179
- }
180
- }
181
- const span = self._startSpan(this.mongooseCollection, this.model.modelName, this.op, attributes, parentSpan);
182
- return self._handleResponse(span, originalExec, this, arguments, callback, moduleVersion);
123
+ const span = self._startSpan(this.mongooseCollection, this.model.modelName, this.op, parentSpan);
124
+ return self._handleResponse(span, originalExec, this, arguments, callback);
183
125
  };
184
126
  };
185
127
  }
186
- patchOnModelMethods(op, moduleVersion) {
128
+ patchOnModelMethods(op) {
187
129
  const self = this;
188
130
  return (originalOnModelFunction) => {
189
131
  return function method(options, callback) {
190
- if (self.getConfig().requireParentSpan && trace.getSpan(context.active()) === void 0) {
191
- return originalOnModelFunction.apply(this, arguments);
192
- }
193
- const serializePayload = { document: this };
194
- if (options && !(options instanceof Function)) {
195
- serializePayload.options = options;
196
- }
197
- const attributes = {};
198
- const { dbStatementSerializer } = self.getConfig();
199
- if (dbStatementSerializer) {
200
- const statement = dbStatementSerializer(op, serializePayload);
201
- if (self._dbSemconvStability & SemconvStability.OLD) {
202
- attributes[ATTR_DB_STATEMENT] = statement;
203
- }
204
- if (self._dbSemconvStability & SemconvStability.STABLE) {
205
- attributes[ATTR_DB_QUERY_TEXT] = statement;
206
- }
207
- }
208
- const span = self._startSpan(this.constructor.collection, this.constructor.modelName, op, attributes);
132
+ const span = self._startSpan(this.constructor.collection, this.constructor.modelName, op);
209
133
  if (options instanceof Function) {
210
134
  callback = options;
211
- options = void 0;
212
135
  }
213
- return self._handleResponse(span, originalOnModelFunction, this, arguments, callback, moduleVersion);
136
+ return self._handleResponse(span, originalOnModelFunction, this, arguments, callback);
214
137
  };
215
138
  };
216
139
  }
217
140
  // Patch document instance methods (doc.updateOne/deleteOne) for Mongoose 8.21.0+.
218
- _patchDocumentUpdateMethods(op, moduleVersion) {
141
+ _patchDocumentUpdateMethods(op) {
219
142
  const self = this;
220
143
  return (originalMethod) => {
221
144
  return function method(update, options, callback) {
222
- if (self.getConfig().requireParentSpan && trace.getSpan(context.active()) === void 0) {
223
- return originalMethod.apply(this, arguments);
224
- }
225
145
  let actualCallback = callback;
226
- let actualUpdate = update;
227
- let actualOptions = options;
228
146
  if (typeof update === "function") {
229
147
  actualCallback = update;
230
- actualUpdate = void 0;
231
- actualOptions = void 0;
232
148
  } else if (typeof options === "function") {
233
149
  actualCallback = options;
234
- actualOptions = void 0;
235
150
  }
236
- const attributes = {};
237
- const dbStatementSerializer = self.getConfig().dbStatementSerializer;
238
- if (dbStatementSerializer) {
239
- const statement = dbStatementSerializer(op, {
240
- // Document instance methods automatically use the document's _id as filter
241
- condition: { _id: this._id },
242
- updates: actualUpdate,
243
- options: actualOptions
244
- });
245
- if (self._dbSemconvStability & SemconvStability.OLD) {
246
- attributes[ATTR_DB_STATEMENT] = statement;
247
- }
248
- if (self._dbSemconvStability & SemconvStability.STABLE) {
249
- attributes[ATTR_DB_QUERY_TEXT] = statement;
250
- }
251
- }
252
- const span = self._startSpan(this.constructor.collection, this.constructor.modelName, op, attributes);
253
- const result = self._handleResponse(span, originalMethod, this, arguments, actualCallback, moduleVersion);
151
+ const span = self._startSpan(this.constructor.collection, this.constructor.modelName, op);
152
+ const result = self._handleResponse(span, originalMethod, this, arguments, actualCallback);
254
153
  if (result && typeof result === "object") {
255
154
  result[_ALREADY_INSTRUMENTED] = true;
256
155
  }
@@ -258,45 +157,15 @@ class MongooseInstrumentation extends InstrumentationBase {
258
157
  };
259
158
  };
260
159
  }
261
- patchModelStatic(op, moduleVersion) {
160
+ patchModelStatic(op) {
262
161
  const self = this;
263
162
  return (original) => {
264
163
  return function patchedStatic(docsOrOps, options, callback) {
265
- if (self.getConfig().requireParentSpan && trace.getSpan(context.active()) === void 0) {
266
- return original.apply(this, arguments);
267
- }
268
164
  if (typeof options === "function") {
269
165
  callback = options;
270
- options = void 0;
271
- }
272
- const serializePayload = {};
273
- switch (op) {
274
- case "insertMany":
275
- serializePayload.documents = docsOrOps;
276
- break;
277
- case "bulkWrite":
278
- serializePayload.operations = docsOrOps;
279
- break;
280
- default:
281
- serializePayload.document = docsOrOps;
282
- break;
283
166
  }
284
- if (options !== void 0) {
285
- serializePayload.options = options;
286
- }
287
- const attributes = {};
288
- const { dbStatementSerializer } = self.getConfig();
289
- if (dbStatementSerializer) {
290
- const statement = dbStatementSerializer(op, serializePayload);
291
- if (self._dbSemconvStability & SemconvStability.OLD) {
292
- attributes[ATTR_DB_STATEMENT] = statement;
293
- }
294
- if (self._dbSemconvStability & SemconvStability.STABLE) {
295
- attributes[ATTR_DB_QUERY_TEXT] = statement;
296
- }
297
- }
298
- const span = self._startSpan(this.collection, this.modelName, op, attributes);
299
- return self._handleResponse(span, original, this, arguments, callback, moduleVersion);
167
+ const span = self._startSpan(this.collection, this.modelName, op);
168
+ return self._handleResponse(span, original, this, arguments, callback);
300
169
  };
301
170
  };
302
171
  }
@@ -305,65 +174,49 @@ class MongooseInstrumentation extends InstrumentationBase {
305
174
  // on the Aggregate object to capture the context on, so we patch
306
175
  // the aggregate of Model, and set the context on the Aggregate object
307
176
  patchModelAggregate() {
308
- const self = this;
309
177
  return (original) => {
310
178
  return function captureSpanContext() {
311
- const currentSpan = trace.getSpan(context.active());
312
- const aggregate = self._callOriginalFunction(() => original.apply(this, arguments));
179
+ const currentSpan = getActiveSpan();
180
+ const aggregate = original.apply(this, arguments);
313
181
  if (aggregate) aggregate[_STORED_PARENT_SPAN] = currentSpan;
314
182
  return aggregate;
315
183
  };
316
184
  };
317
185
  }
318
- patchAndCaptureSpanContext(funcName) {
319
- const self = this;
186
+ patchAndCaptureSpanContext(_funcName) {
320
187
  return (original) => {
321
188
  return function captureSpanContext() {
322
- this[_STORED_PARENT_SPAN] = trace.getSpan(context.active());
323
- return self._callOriginalFunction(() => original.apply(this, arguments));
189
+ this[_STORED_PARENT_SPAN] = getActiveSpan();
190
+ return original.apply(this, arguments);
324
191
  };
325
192
  };
326
193
  }
327
- _startSpan(collection, modelName, operation, attributes, parentSpan) {
328
- const finalAttributes = {
329
- ...attributes,
330
- ...getAttributesFromCollection(collection, this._dbSemconvStability, this._netSemconvStability)
194
+ _startSpan(collection, modelName, operation, parentSpan) {
195
+ const attributes = {
196
+ ...getAttributesFromCollection(collection),
197
+ // eslint-disable-next-line typescript/no-deprecated
198
+ [ATTR_DB_OPERATION]: operation,
199
+ // eslint-disable-next-line typescript/no-deprecated
200
+ [ATTR_DB_SYSTEM]: "mongoose",
201
+ // keep for backwards compatibility
202
+ [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN
331
203
  };
332
- if (this._dbSemconvStability & SemconvStability.OLD) {
333
- finalAttributes[ATTR_DB_OPERATION] = operation;
334
- finalAttributes[ATTR_DB_SYSTEM] = "mongoose";
335
- }
336
- if (this._dbSemconvStability & SemconvStability.STABLE) {
337
- finalAttributes[ATTR_DB_OPERATION_NAME] = operation;
338
- finalAttributes[ATTR_DB_SYSTEM_NAME] = DB_SYSTEM_NAME_VALUE_MONGODB;
339
- }
340
- const spanName = this._dbSemconvStability & SemconvStability.STABLE ? `${operation} ${collection.name}` : `mongoose.${modelName}.${operation}`;
341
- return this.tracer.startSpan(
342
- spanName,
343
- {
344
- kind: SpanKind.CLIENT,
345
- attributes: finalAttributes
346
- },
347
- parentSpan ? trace.setSpan(context.active(), parentSpan) : void 0
348
- );
349
- }
350
- _handleResponse(span, exec, originalThis, args, callback, moduleVersion = void 0) {
351
- const self = this;
352
- if (callback instanceof Function) {
353
- return self._callOriginalFunction(
354
- () => handleCallbackResponse(callback, exec, originalThis, span, args, self.getConfig().responseHook, moduleVersion)
355
- );
356
- } else {
357
- const response = self._callOriginalFunction(() => exec.apply(originalThis, args));
358
- return handlePromiseResponse(response, span, self.getConfig().responseHook, moduleVersion);
359
- }
204
+ return startInactiveSpan({
205
+ name: `mongoose.${modelName}.${operation}`,
206
+ kind: SpanKind.CLIENT,
207
+ attributes,
208
+ parentSpan
209
+ });
360
210
  }
361
- _callOriginalFunction(originalFunction) {
362
- if (this.getConfig().suppressInternalInstrumentation) {
363
- return context.with(suppressTracing(context.active()), originalFunction);
364
- } else {
365
- return originalFunction();
366
- }
211
+ _handleResponse(span, exec, originalThis, args, callback) {
212
+ return withActiveSpan(span, () => {
213
+ if (callback instanceof Function) {
214
+ return handleCallbackResponse(callback, exec, originalThis, span, args);
215
+ } else {
216
+ const response = exec.apply(originalThis, args);
217
+ return handlePromiseResponse(response, span);
218
+ }
219
+ });
367
220
  }
368
221
  }
369
222
 
@@ -1 +1 @@
1
- {"version":3,"file":"mongoose.js","sources":["../../../../../../src/integrations/tracing/mongoose/vendored/mongoose.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-mongoose\n * - Upstream version: @opentelemetry/instrumentation-mongoose@0.64.0\n * - Types vendored from mongoose as simplified interfaces\n * - Minor TypeScript strictness adjustments for this repository's compiler settings\n */\n/* eslint-disable */\n\nimport { context, Span, trace, Attributes, SpanKind } from '@opentelemetry/api';\nimport { suppressTracing } from '@opentelemetry/core';\nimport type * as mongoose from './mongoose-types';\nimport { MongooseInstrumentationConfig, SerializerPayload } from './types';\nimport { handleCallbackResponse, handlePromiseResponse, getAttributesFromCollection } from './utils';\nimport {\n InstrumentationBase,\n InstrumentationModuleDefinition,\n InstrumentationNodeModuleDefinition,\n SemconvStability,\n semconvStabilityFromStr,\n} from '@opentelemetry/instrumentation';\nimport { SDK_VERSION } from '@sentry/core';\nimport { ATTR_DB_OPERATION, ATTR_DB_STATEMENT, ATTR_DB_SYSTEM, DB_SYSTEM_NAME_VALUE_MONGODB } from './semconv';\nimport { ATTR_DB_OPERATION_NAME, ATTR_DB_QUERY_TEXT, ATTR_DB_SYSTEM_NAME } from '@opentelemetry/semantic-conventions';\n\nconst PACKAGE_NAME = '@sentry/instrumentation-mongoose';\n\nconst contextCaptureFunctionsCommon = [\n 'deleteOne',\n 'deleteMany',\n 'find',\n 'findOne',\n 'estimatedDocumentCount',\n 'countDocuments',\n 'distinct',\n 'where',\n '$where',\n 'findOneAndUpdate',\n 'findOneAndDelete',\n 'findOneAndReplace',\n];\n\nconst contextCaptureFunctions6 = ['remove', 'count', 'findOneAndRemove', ...contextCaptureFunctionsCommon];\nconst contextCaptureFunctions7 = ['count', 'findOneAndRemove', ...contextCaptureFunctionsCommon];\nconst contextCaptureFunctions8 = [...contextCaptureFunctionsCommon];\n\nfunction getContextCaptureFunctions(moduleVersion: string | undefined): string[] {\n /* istanbul ignore next */\n if (!moduleVersion) {\n return contextCaptureFunctionsCommon;\n } else if (moduleVersion.startsWith('6.') || moduleVersion.startsWith('5.')) {\n return contextCaptureFunctions6;\n } else if (moduleVersion.startsWith('7.')) {\n return contextCaptureFunctions7;\n } else {\n return contextCaptureFunctions8;\n }\n}\n\nfunction instrumentRemove(moduleVersion: string | undefined): boolean {\n return (moduleVersion && (moduleVersion.startsWith('5.') || moduleVersion.startsWith('6.'))) || false;\n}\n\n/**\n * 8.21.0 changed Document.updateOne/deleteOne so that the Query is not fully built when Query.exec() is called.\n * @param moduleVersion\n */\nfunction needsDocumentMethodPatch(moduleVersion: string | undefined): boolean {\n if (!moduleVersion || !moduleVersion.startsWith('8.')) {\n return false;\n }\n\n const minor = parseInt(moduleVersion.split('.')[1]!, 10);\n return minor >= 21;\n}\n\n// when mongoose functions are called, we store the original call context\n// and then set it as the parent for the spans created by Query/Aggregate exec()\n// calls. this bypass the unlinked spans issue on thenables await operations.\nexport const _STORED_PARENT_SPAN: unique symbol = Symbol('stored-parent-span');\n\n// Prevents double-instrumentation when doc.updateOne/deleteOne (Mongoose 8.21.0+)\n// creates a span and returns a Query that also calls exec()\nexport const _ALREADY_INSTRUMENTED: unique symbol = Symbol('already-instrumented');\n\nexport class MongooseInstrumentation extends InstrumentationBase<MongooseInstrumentationConfig> {\n private _netSemconvStability!: SemconvStability;\n private _dbSemconvStability!: SemconvStability;\n\n constructor(config: MongooseInstrumentationConfig = {}) {\n super(PACKAGE_NAME, SDK_VERSION, config);\n this._setSemconvStabilityFromEnv();\n }\n\n // Used for testing.\n private _setSemconvStabilityFromEnv() {\n this._netSemconvStability = semconvStabilityFromStr('http', process.env.OTEL_SEMCONV_STABILITY_OPT_IN);\n this._dbSemconvStability = semconvStabilityFromStr('database', process.env.OTEL_SEMCONV_STABILITY_OPT_IN);\n }\n\n protected init(): InstrumentationModuleDefinition {\n const module = new InstrumentationNodeModuleDefinition(\n 'mongoose',\n ['>=5.9.7 <10'],\n this.patch.bind(this),\n this.unpatch.bind(this),\n );\n return module;\n }\n\n private patch(module: any, moduleVersion: string | undefined) {\n const moduleExports: typeof mongoose = module[Symbol.toStringTag] === 'Module' ? module.default : module;\n\n this._wrap(moduleExports.Model.prototype, 'save', this.patchOnModelMethods('save', moduleVersion));\n // mongoose applies this code on module require:\n // Model.prototype.$save = Model.prototype.save;\n // which captures the save function before it is patched.\n // so we need to apply the same logic after instrumenting the save function.\n moduleExports.Model.prototype.$save = moduleExports.Model.prototype.save;\n\n if (instrumentRemove(moduleVersion)) {\n this._wrap(moduleExports.Model.prototype, 'remove', this.patchOnModelMethods('remove', moduleVersion));\n }\n\n // Mongoose 8.21.0+ changed Document.updateOne()/deleteOne() so that the Query is not fully built when Query.exec() is called.\n if (needsDocumentMethodPatch(moduleVersion)) {\n this._wrap(\n moduleExports.Model.prototype,\n 'updateOne',\n this._patchDocumentUpdateMethods('updateOne', moduleVersion),\n );\n this._wrap(\n moduleExports.Model.prototype,\n 'deleteOne',\n this._patchDocumentUpdateMethods('deleteOne', moduleVersion),\n );\n }\n\n this._wrap(moduleExports.Query.prototype, 'exec', this.patchQueryExec(moduleVersion));\n this._wrap(moduleExports.Aggregate.prototype, 'exec', this.patchAggregateExec(moduleVersion));\n\n const contextCaptureFunctions = getContextCaptureFunctions(moduleVersion);\n\n contextCaptureFunctions.forEach((funcName: string) => {\n this._wrap(moduleExports.Query.prototype, funcName as any, this.patchAndCaptureSpanContext(funcName));\n });\n this._wrap(moduleExports.Model, 'aggregate', this.patchModelAggregate());\n\n this._wrap(moduleExports.Model, 'insertMany', this.patchModelStatic('insertMany', moduleVersion));\n this._wrap(moduleExports.Model, 'bulkWrite', this.patchModelStatic('bulkWrite', moduleVersion));\n\n return moduleExports;\n }\n\n private unpatch(module: any, moduleVersion: string | undefined): void {\n const moduleExports: typeof mongoose = module[Symbol.toStringTag] === 'Module' ? module.default : module;\n\n const contextCaptureFunctions = getContextCaptureFunctions(moduleVersion);\n\n this._unwrap(moduleExports.Model.prototype, 'save');\n // revert the patch for $save which we applied by aliasing it to patched `save`\n moduleExports.Model.prototype.$save = moduleExports.Model.prototype.save;\n\n if (instrumentRemove(moduleVersion)) {\n this._unwrap(moduleExports.Model.prototype, 'remove');\n }\n\n if (needsDocumentMethodPatch(moduleVersion)) {\n this._unwrap(moduleExports.Model.prototype, 'updateOne');\n this._unwrap(moduleExports.Model.prototype, 'deleteOne');\n }\n\n this._unwrap(moduleExports.Query.prototype, 'exec');\n this._unwrap(moduleExports.Aggregate.prototype, 'exec');\n\n contextCaptureFunctions.forEach((funcName: string) => {\n this._unwrap(moduleExports.Query.prototype, funcName as any);\n });\n this._unwrap(moduleExports.Model, 'aggregate');\n\n this._unwrap(moduleExports.Model, 'insertMany');\n this._unwrap(moduleExports.Model, 'bulkWrite');\n }\n\n private patchAggregateExec(moduleVersion: string | undefined) {\n const self = this;\n return (originalAggregate: Function) => {\n return function exec(this: any, callback?: Function) {\n if (self.getConfig().requireParentSpan && trace.getSpan(context.active()) === undefined) {\n return originalAggregate.apply(this, arguments);\n }\n\n const parentSpan = this[_STORED_PARENT_SPAN];\n const attributes: Attributes = {};\n const { dbStatementSerializer } = self.getConfig();\n if (dbStatementSerializer) {\n const statement = dbStatementSerializer('aggregate', {\n options: this.options,\n aggregatePipeline: this._pipeline,\n });\n if (self._dbSemconvStability & SemconvStability.OLD) {\n attributes[ATTR_DB_STATEMENT] = statement;\n }\n if (self._dbSemconvStability & SemconvStability.STABLE) {\n attributes[ATTR_DB_QUERY_TEXT] = statement;\n }\n }\n\n const span = self._startSpan(\n this._model.collection,\n this._model?.modelName,\n 'aggregate',\n attributes,\n parentSpan,\n );\n\n return self._handleResponse(span, originalAggregate, this, arguments, callback, moduleVersion);\n };\n };\n }\n\n private patchQueryExec(moduleVersion: string | undefined) {\n const self = this;\n return (originalExec: Function) => {\n return function exec(this: any, callback?: Function) {\n // Skip if already instrumented by document instance method patch\n if (this[_ALREADY_INSTRUMENTED]) {\n return originalExec.apply(this, arguments);\n }\n\n if (self.getConfig().requireParentSpan && trace.getSpan(context.active()) === undefined) {\n return originalExec.apply(this, arguments);\n }\n\n const parentSpan = this[_STORED_PARENT_SPAN];\n const attributes: Attributes = {};\n const { dbStatementSerializer } = self.getConfig();\n if (dbStatementSerializer) {\n const statement = dbStatementSerializer(this.op, {\n // Use public API methods (getFilter/getOptions) for better compatibility\n condition: this.getFilter?.() ?? this._conditions,\n updates: this._update,\n options: this.getOptions?.() ?? this.options,\n fields: this._fields,\n });\n if (self._dbSemconvStability & SemconvStability.OLD) {\n attributes[ATTR_DB_STATEMENT] = statement;\n }\n if (self._dbSemconvStability & SemconvStability.STABLE) {\n attributes[ATTR_DB_QUERY_TEXT] = statement;\n }\n }\n const span = self._startSpan(this.mongooseCollection, this.model.modelName, this.op, attributes, parentSpan);\n\n return self._handleResponse(span, originalExec, this, arguments, callback, moduleVersion);\n };\n };\n }\n\n private patchOnModelMethods(op: string, moduleVersion: string | undefined) {\n const self = this;\n return (originalOnModelFunction: Function) => {\n return function method(this: any, options?: any, callback?: Function) {\n if (self.getConfig().requireParentSpan && trace.getSpan(context.active()) === undefined) {\n return originalOnModelFunction.apply(this, arguments);\n }\n\n const serializePayload: SerializerPayload = { document: this };\n if (options && !(options instanceof Function)) {\n serializePayload.options = options;\n }\n const attributes: Attributes = {};\n const { dbStatementSerializer } = self.getConfig();\n if (dbStatementSerializer) {\n const statement = dbStatementSerializer(op, serializePayload);\n if (self._dbSemconvStability & SemconvStability.OLD) {\n attributes[ATTR_DB_STATEMENT] = statement;\n }\n if (self._dbSemconvStability & SemconvStability.STABLE) {\n attributes[ATTR_DB_QUERY_TEXT] = statement;\n }\n }\n const span = self._startSpan(this.constructor.collection, this.constructor.modelName, op, attributes);\n\n if (options instanceof Function) {\n callback = options;\n options = undefined;\n }\n\n return self._handleResponse(span, originalOnModelFunction, this, arguments, callback, moduleVersion);\n };\n };\n }\n\n // Patch document instance methods (doc.updateOne/deleteOne) for Mongoose 8.21.0+.\n private _patchDocumentUpdateMethods(op: string, moduleVersion: string | undefined) {\n const self = this;\n return (originalMethod: Function) => {\n return function method(this: any, update?: any, options?: any, callback?: Function) {\n if (self.getConfig().requireParentSpan && trace.getSpan(context.active()) === undefined) {\n return originalMethod.apply(this, arguments);\n }\n\n // determine actual callback since different argument patterns are allowed\n let actualCallback: Function | undefined = callback;\n let actualUpdate = update;\n let actualOptions = options;\n\n if (typeof update === 'function') {\n actualCallback = update;\n actualUpdate = undefined;\n actualOptions = undefined;\n } else if (typeof options === 'function') {\n actualCallback = options;\n actualOptions = undefined;\n }\n\n const attributes: Attributes = {};\n const dbStatementSerializer = self.getConfig().dbStatementSerializer;\n if (dbStatementSerializer) {\n const statement = dbStatementSerializer(op, {\n // Document instance methods automatically use the document's _id as filter\n condition: { _id: this._id },\n updates: actualUpdate,\n options: actualOptions,\n });\n if (self._dbSemconvStability & SemconvStability.OLD) {\n attributes[ATTR_DB_STATEMENT] = statement;\n }\n if (self._dbSemconvStability & SemconvStability.STABLE) {\n attributes[ATTR_DB_QUERY_TEXT] = statement;\n }\n }\n\n const span = self._startSpan(this.constructor.collection, this.constructor.modelName, op, attributes);\n\n const result = self._handleResponse(span, originalMethod, this, arguments, actualCallback, moduleVersion);\n\n // Mark returned Query to prevent double-instrumentation when exec() is eventually called\n if (result && typeof result === 'object') {\n result[_ALREADY_INSTRUMENTED] = true;\n }\n\n return result;\n };\n };\n }\n\n private patchModelStatic(op: string, moduleVersion: string | undefined) {\n const self = this;\n return (original: Function) => {\n return function patchedStatic(this: any, docsOrOps: any, options?: any, callback?: Function) {\n if (self.getConfig().requireParentSpan && trace.getSpan(context.active()) === undefined) {\n return original.apply(this, arguments);\n }\n if (typeof options === 'function') {\n callback = options;\n options = undefined;\n }\n\n const serializePayload: SerializerPayload = {};\n switch (op) {\n case 'insertMany':\n serializePayload.documents = docsOrOps;\n break;\n case 'bulkWrite':\n serializePayload.operations = docsOrOps;\n break;\n default:\n serializePayload.document = docsOrOps;\n break;\n }\n if (options !== undefined) {\n serializePayload.options = options;\n }\n\n const attributes: Attributes = {};\n const { dbStatementSerializer } = self.getConfig();\n if (dbStatementSerializer) {\n const statement = dbStatementSerializer(op, serializePayload);\n if (self._dbSemconvStability & SemconvStability.OLD) {\n attributes[ATTR_DB_STATEMENT] = statement;\n }\n if (self._dbSemconvStability & SemconvStability.STABLE) {\n attributes[ATTR_DB_QUERY_TEXT] = statement;\n }\n }\n\n const span = self._startSpan(this.collection, this.modelName, op, attributes);\n\n return self._handleResponse(span, original, this, arguments, callback, moduleVersion);\n };\n };\n }\n\n // we want to capture the otel span on the object which is calling exec.\n // in the special case of aggregate, we need have no function to path\n // on the Aggregate object to capture the context on, so we patch\n // the aggregate of Model, and set the context on the Aggregate object\n private patchModelAggregate() {\n const self = this;\n return (original: Function) => {\n return function captureSpanContext(this: any) {\n const currentSpan = trace.getSpan(context.active());\n const aggregate = self._callOriginalFunction(() => original.apply(this, arguments));\n if (aggregate) aggregate[_STORED_PARENT_SPAN] = currentSpan;\n return aggregate;\n };\n };\n }\n\n private patchAndCaptureSpanContext(funcName: string) {\n const self = this;\n return (original: Function) => {\n return function captureSpanContext(this: any) {\n this[_STORED_PARENT_SPAN] = trace.getSpan(context.active());\n return self._callOriginalFunction(() => original.apply(this, arguments));\n };\n };\n }\n\n private _startSpan(\n collection: mongoose.Collection,\n modelName: string,\n operation: string,\n attributes: Attributes,\n parentSpan?: Span,\n ): Span {\n const finalAttributes: Attributes = {\n ...attributes,\n ...getAttributesFromCollection(collection, this._dbSemconvStability, this._netSemconvStability),\n };\n\n if (this._dbSemconvStability & SemconvStability.OLD) {\n finalAttributes[ATTR_DB_OPERATION] = operation;\n finalAttributes[ATTR_DB_SYSTEM] = 'mongoose'; // keep for backwards compatibility\n }\n if (this._dbSemconvStability & SemconvStability.STABLE) {\n finalAttributes[ATTR_DB_OPERATION_NAME] = operation;\n finalAttributes[ATTR_DB_SYSTEM_NAME] = DB_SYSTEM_NAME_VALUE_MONGODB; // actual db system name\n }\n\n const spanName =\n this._dbSemconvStability & SemconvStability.STABLE\n ? `${operation} ${collection.name}`\n : `mongoose.${modelName}.${operation}`;\n\n return this.tracer.startSpan(\n spanName,\n {\n kind: SpanKind.CLIENT,\n attributes: finalAttributes,\n },\n parentSpan ? trace.setSpan(context.active(), parentSpan) : undefined,\n );\n }\n\n private _handleResponse(\n span: Span,\n exec: Function,\n originalThis: any,\n args: IArguments,\n callback?: Function,\n moduleVersion: string | undefined = undefined,\n ) {\n const self = this;\n if (callback instanceof Function) {\n return self._callOriginalFunction(() =>\n handleCallbackResponse(callback, exec, originalThis, span, args, self.getConfig().responseHook, moduleVersion),\n );\n } else {\n const response = self._callOriginalFunction(() => exec.apply(originalThis, args));\n return handlePromiseResponse(response, span, self.getConfig().responseHook, moduleVersion);\n }\n }\n\n private _callOriginalFunction<T>(originalFunction: (...args: any[]) => T): T {\n if (this.getConfig().suppressInternalInstrumentation) {\n return context.with(suppressTracing(context.active()), originalFunction);\n } else {\n return originalFunction();\n }\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAuCA,MAAM,YAAA,GAAe,kCAAA;AAErB,MAAM,6BAAA,GAAgC;AAAA,EACpC,WAAA;AAAA,EACA,YAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA,EACA,wBAAA;AAAA,EACA,gBAAA;AAAA,EACA,UAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,kBAAA;AAAA,EACA,kBAAA;AAAA,EACA;AACF,CAAA;AAEA,MAAM,2BAA2B,CAAC,QAAA,EAAU,OAAA,EAAS,kBAAA,EAAoB,GAAG,6BAA6B,CAAA;AACzG,MAAM,wBAAA,GAA2B,CAAC,OAAA,EAAS,kBAAA,EAAoB,GAAG,6BAA6B,CAAA;AAC/F,MAAM,wBAAA,GAA2B,CAAC,GAAG,6BAA6B,CAAA;AAElE,SAAS,2BAA2B,aAAA,EAA6C;AAE/E,EAAA,IAAI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AA,IACF,CAAA,MAAO;AACL,MAAA,MAAM,QAAA,GAAW,KAAK,qBAAA,CAAsB,MAAM,KAAK,KAAA,CAAM,YAAA,EAAc,IAAI,CAAC,CAAA;AAChF,MAAA,OAAO,sBAAsB,QAAA,EAAU,IAAA,EAAM,KAAK,SAAA,EAAU,CAAE,cAAc,aAAa,CAAA;AAAA,IAC3F;AAAA,EACF;AAAA,EAEQ,sBAAyB,gBAAA,EAA4C;AAC3E,IAAA,IAAI,IAAA,CAAK,SAAA,EAAU,CAAE,+BAAA,EAAiC;AACpD,MAAA,OAAO,QAAQ,IAAA,CAAK,eAAA,CAAgB,QAAQ,MAAA,EAAQ,GAAG,gBAAgB,CAAA;AAAA,IACzE,CAAA,MAAO;AACL,MAAA,OAAO,gBAAA,EAAiB;AAAA,IAC1B;AAAA,EACF;AACF;;;;"}
1
+ {"version":3,"file":"mongoose.js","sources":["../../../../../../src/integrations/tracing/mongoose/vendored/mongoose.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-mongoose\n * - Upstream version: @opentelemetry/instrumentation-mongoose@0.64.0\n * - Types vendored from mongoose as simplified interfaces\n * - Minor TypeScript strictness adjustments for this repository's compiler settings\n * - Refactored to use Sentry's span APIs instead of OpenTelemetry tracing APIs\n */\n\nimport { SpanKind } from '@opentelemetry/api';\nimport {\n type InstrumentationConfig,\n InstrumentationBase,\n type InstrumentationModuleDefinition,\n InstrumentationNodeModuleDefinition,\n} from '@opentelemetry/instrumentation';\nimport type { Span, SpanAttributes } from '@sentry/core';\nimport {\n getActiveSpan,\n SDK_VERSION,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n startInactiveSpan,\n withActiveSpan,\n} from '@sentry/core';\nimport type * as mongoose from './mongoose-types';\nimport { ATTR_DB_OPERATION, ATTR_DB_SYSTEM } from './semconv';\nimport { getAttributesFromCollection, handleCallbackResponse, handlePromiseResponse } from './utils';\n\nconst PACKAGE_NAME = '@sentry/instrumentation-mongoose';\nconst ORIGIN = 'auto.db.otel.mongoose';\n\ntype MongooseModuleExports = typeof mongoose;\n\n// The raw imported `mongoose` module: either the CJS object itself, or an ESM\n// namespace wrapper exposing the same shape under `.default`.\ntype MongooseModule = MongooseModuleExports & {\n default?: MongooseModuleExports;\n [Symbol.toStringTag]?: string;\n};\n\nconst contextCaptureFunctionsCommon = [\n 'deleteOne',\n 'deleteMany',\n 'find',\n 'findOne',\n 'estimatedDocumentCount',\n 'countDocuments',\n 'distinct',\n 'where',\n '$where',\n 'findOneAndUpdate',\n 'findOneAndDelete',\n 'findOneAndReplace',\n];\n\nconst contextCaptureFunctions6 = ['remove', 'count', 'findOneAndRemove', ...contextCaptureFunctionsCommon];\nconst contextCaptureFunctions7 = ['count', 'findOneAndRemove', ...contextCaptureFunctionsCommon];\nconst contextCaptureFunctions8 = [...contextCaptureFunctionsCommon];\n\nfunction getContextCaptureFunctions(moduleVersion: string | undefined): string[] {\n /* istanbul ignore next */\n if (!moduleVersion) {\n return contextCaptureFunctionsCommon;\n } else if (moduleVersion.startsWith('6.') || moduleVersion.startsWith('5.')) {\n return contextCaptureFunctions6;\n } else if (moduleVersion.startsWith('7.')) {\n return contextCaptureFunctions7;\n } else {\n return contextCaptureFunctions8;\n }\n}\n\nfunction instrumentRemove(moduleVersion: string | undefined): boolean {\n return (moduleVersion && (moduleVersion.startsWith('5.') || moduleVersion.startsWith('6.'))) || false;\n}\n\n/**\n * 8.21.0 changed Document.updateOne/deleteOne so that the Query is not fully built when Query.exec() is called.\n * @param moduleVersion\n */\nfunction needsDocumentMethodPatch(moduleVersion: string | undefined): boolean {\n if (!moduleVersion || !moduleVersion.startsWith('8.')) {\n return false;\n }\n\n const minor = parseInt(moduleVersion.split('.')[1]!, 10);\n return minor >= 21;\n}\n\n// when mongoose functions are called, we store the original call context\n// and then set it as the parent for the spans created by Query/Aggregate exec()\n// calls. this bypass the unlinked spans issue on thenables await operations.\nexport const _STORED_PARENT_SPAN: unique symbol = Symbol('stored-parent-span');\n\n// Prevents double-instrumentation when doc.updateOne/deleteOne (Mongoose 8.21.0+)\n// creates a span and returns a Query that also calls exec()\nexport const _ALREADY_INSTRUMENTED: unique symbol = Symbol('already-instrumented');\n\nexport class MongooseInstrumentation extends InstrumentationBase<InstrumentationConfig> {\n constructor(config: InstrumentationConfig = {}) {\n super(PACKAGE_NAME, SDK_VERSION, config);\n }\n\n protected init(): InstrumentationModuleDefinition {\n const module = new InstrumentationNodeModuleDefinition(\n 'mongoose',\n ['>=5.9.7 <10'],\n this.patch.bind(this),\n this.unpatch.bind(this),\n );\n return module;\n }\n\n private patch(module: MongooseModule, moduleVersion: string | undefined) {\n const moduleExports: MongooseModuleExports =\n module[Symbol.toStringTag] === 'Module' && module.default ? module.default : module;\n\n this._wrap(moduleExports.Model.prototype, 'save', this.patchOnModelMethods('save'));\n // mongoose applies this code on module require:\n // Model.prototype.$save = Model.prototype.save;\n // which captures the save function before it is patched.\n // so we need to apply the same logic after instrumenting the save function.\n moduleExports.Model.prototype.$save = moduleExports.Model.prototype.save;\n\n if (instrumentRemove(moduleVersion)) {\n this._wrap(moduleExports.Model.prototype, 'remove', this.patchOnModelMethods('remove'));\n }\n\n // Mongoose 8.21.0+ changed Document.updateOne()/deleteOne() so that the Query is not fully built when Query.exec() is called.\n if (needsDocumentMethodPatch(moduleVersion)) {\n this._wrap(moduleExports.Model.prototype, 'updateOne', this._patchDocumentUpdateMethods('updateOne'));\n this._wrap(moduleExports.Model.prototype, 'deleteOne', this._patchDocumentUpdateMethods('deleteOne'));\n }\n\n this._wrap(moduleExports.Query.prototype, 'exec', this.patchQueryExec());\n this._wrap(moduleExports.Aggregate.prototype, 'exec', this.patchAggregateExec());\n\n const contextCaptureFunctions = getContextCaptureFunctions(moduleVersion);\n\n contextCaptureFunctions.forEach((funcName: string) => {\n this._wrap(moduleExports.Query.prototype, funcName as any, this.patchAndCaptureSpanContext(funcName));\n });\n this._wrap(moduleExports.Model, 'aggregate', this.patchModelAggregate());\n\n this._wrap(moduleExports.Model, 'insertMany', this.patchModelStatic('insertMany'));\n this._wrap(moduleExports.Model, 'bulkWrite', this.patchModelStatic('bulkWrite'));\n\n return moduleExports;\n }\n\n private unpatch(module: MongooseModule, moduleVersion: string | undefined): void {\n const moduleExports: MongooseModuleExports =\n module[Symbol.toStringTag] === 'Module' && module.default ? module.default : module;\n\n const contextCaptureFunctions = getContextCaptureFunctions(moduleVersion);\n\n this._unwrap(moduleExports.Model.prototype, 'save');\n // revert the patch for $save which we applied by aliasing it to patched `save`\n moduleExports.Model.prototype.$save = moduleExports.Model.prototype.save;\n\n if (instrumentRemove(moduleVersion)) {\n this._unwrap(moduleExports.Model.prototype, 'remove');\n }\n\n if (needsDocumentMethodPatch(moduleVersion)) {\n this._unwrap(moduleExports.Model.prototype, 'updateOne');\n this._unwrap(moduleExports.Model.prototype, 'deleteOne');\n }\n\n this._unwrap(moduleExports.Query.prototype, 'exec');\n this._unwrap(moduleExports.Aggregate.prototype, 'exec');\n\n contextCaptureFunctions.forEach((funcName: string) => {\n this._unwrap(moduleExports.Query.prototype, funcName as any);\n });\n this._unwrap(moduleExports.Model, 'aggregate');\n\n this._unwrap(moduleExports.Model, 'insertMany');\n this._unwrap(moduleExports.Model, 'bulkWrite');\n }\n\n private patchAggregateExec() {\n const self = this;\n return (originalAggregate: Function) => {\n return function exec(this: any, callback?: Function) {\n const parentSpan = this[_STORED_PARENT_SPAN];\n const span = self._startSpan(this._model.collection, this._model?.modelName, 'aggregate', parentSpan);\n\n return self._handleResponse(span, originalAggregate, this, arguments, callback);\n };\n };\n }\n\n private patchQueryExec() {\n const self = this;\n return (originalExec: Function) => {\n return function exec(this: any, callback?: Function) {\n // Skip if already instrumented by document instance method patch\n if (this[_ALREADY_INSTRUMENTED]) {\n return originalExec.apply(this, arguments);\n }\n\n const parentSpan = this[_STORED_PARENT_SPAN];\n const span = self._startSpan(this.mongooseCollection, this.model.modelName, this.op, parentSpan);\n\n return self._handleResponse(span, originalExec, this, arguments, callback);\n };\n };\n }\n\n private patchOnModelMethods(op: string) {\n const self = this;\n return (originalOnModelFunction: Function) => {\n return function method(this: any, options?: any, callback?: Function) {\n const span = self._startSpan(this.constructor.collection, this.constructor.modelName, op);\n\n if (options instanceof Function) {\n // oxlint-disable-next-line no-param-reassign\n callback = options;\n }\n\n return self._handleResponse(span, originalOnModelFunction, this, arguments, callback);\n };\n };\n }\n\n // Patch document instance methods (doc.updateOne/deleteOne) for Mongoose 8.21.0+.\n private _patchDocumentUpdateMethods(op: string) {\n const self = this;\n return (originalMethod: Function) => {\n return function method(this: any, update?: any, options?: any, callback?: Function) {\n // determine actual callback since different argument patterns are allowed\n let actualCallback: Function | undefined = callback;\n if (typeof update === 'function') {\n actualCallback = update;\n } else if (typeof options === 'function') {\n actualCallback = options;\n }\n\n const span = self._startSpan(this.constructor.collection, this.constructor.modelName, op);\n\n const result = self._handleResponse(span, originalMethod, this, arguments, actualCallback);\n\n // Mark returned Query to prevent double-instrumentation when exec() is eventually called\n if (result && typeof result === 'object') {\n result[_ALREADY_INSTRUMENTED] = true;\n }\n\n return result;\n };\n };\n }\n\n private patchModelStatic(op: string) {\n const self = this;\n return (original: Function) => {\n return function patchedStatic(this: any, docsOrOps: any, options?: any, callback?: Function) {\n if (typeof options === 'function') {\n // oxlint-disable-next-line no-param-reassign\n callback = options;\n }\n\n const span = self._startSpan(this.collection, this.modelName, op);\n\n return self._handleResponse(span, original, this, arguments, callback);\n };\n };\n }\n\n // we want to capture the otel span on the object which is calling exec.\n // in the special case of aggregate, we need have no function to path\n // on the Aggregate object to capture the context on, so we patch\n // the aggregate of Model, and set the context on the Aggregate object\n private patchModelAggregate() {\n return (original: Function) => {\n return function captureSpanContext(this: any) {\n const currentSpan = getActiveSpan();\n const aggregate = original.apply(this, arguments);\n if (aggregate) aggregate[_STORED_PARENT_SPAN] = currentSpan;\n return aggregate;\n };\n };\n }\n\n private patchAndCaptureSpanContext(_funcName: string) {\n return (original: Function) => {\n return function captureSpanContext(this: any) {\n this[_STORED_PARENT_SPAN] = getActiveSpan();\n return original.apply(this, arguments);\n };\n };\n }\n\n private _startSpan(collection: mongoose.Collection, modelName: string, operation: string, parentSpan?: Span): Span {\n const attributes: SpanAttributes = {\n ...getAttributesFromCollection(collection),\n // eslint-disable-next-line typescript/no-deprecated\n [ATTR_DB_OPERATION]: operation,\n // eslint-disable-next-line typescript/no-deprecated\n [ATTR_DB_SYSTEM]: 'mongoose', // keep for backwards compatibility\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN,\n };\n\n return startInactiveSpan({\n name: `mongoose.${modelName}.${operation}`,\n kind: SpanKind.CLIENT,\n attributes,\n parentSpan,\n });\n }\n\n private _handleResponse(span: Span, exec: Function, originalThis: any, args: IArguments, callback?: Function) {\n // Activate the span while the underlying operation runs so that nested instrumentation\n // (e.g. the mongodb driver spans) is parented to this span. `withActiveSpan` returns the\n // callback's result untouched, so lazy mongoose Query thenables are handed back unexecuted.\n return withActiveSpan(span, () => {\n if (callback instanceof Function) {\n return handleCallbackResponse(callback, exec, originalThis, span, args);\n } else {\n const response = exec.apply(originalThis, args);\n return handlePromiseResponse(response, span);\n }\n });\n }\n}\n"],"names":[],"mappings":";;;;;;AA+BA,MAAM,YAAA,GAAe,kCAAA;AACrB,MAAM,MAAA,GAAS,uBAAA;AAWf,MAAM,6BAAA,GAAgC;AAAA,EACpC,WAAA;AAAA,EACA,YAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA,EACA,wBAAA;AAAA,EACA,gBAAA;AAAA,EACA,UAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,kBAAA;AAAA,EACA,kBAAA;AAAA,EACA;AACF,CAAA;AAEA,MAAM,2BAA2B,CAAC,QAAA,EAAU,OAAA,EAAS,kBA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AA,EACH;AAAA,EAEQ,eAAA,CAAgB,IAAA,EAAY,IAAA,EAAgB,YAAA,EAAmB,MAAkB,QAAA,EAAqB;AAI5G,IAAA,OAAO,cAAA,CAAe,MAAM,MAAM;AAChC,MAAA,IAAI,oBAAoB,QAAA,EAAU;AAChC,QAAA,OAAO,sBAAA,CAAuB,QAAA,EAAU,IAAA,EAAM,YAAA,EAAc,MAAM,IAAI,CAAA;AAAA,MACxE,CAAA,MAAO;AACL,QAAA,MAAM,QAAA,GAAW,IAAA,CAAK,KAAA,CAAM,YAAA,EAAc,IAAI,CAAA;AAC9C,QAAA,OAAO,qBAAA,CAAsB,UAAU,IAAI,CAAA;AAAA,MAC7C;AAAA,IACF,CAAC,CAAA;AAAA,EACH;AACF;;;;"}
@@ -1,12 +1,10 @@
1
1
  const ATTR_DB_MONGODB_COLLECTION = "db.mongodb.collection";
2
2
  const ATTR_DB_NAME = "db.name";
3
3
  const ATTR_DB_OPERATION = "db.operation";
4
- const ATTR_DB_STATEMENT = "db.statement";
5
4
  const ATTR_DB_SYSTEM = "db.system";
6
5
  const ATTR_DB_USER = "db.user";
7
6
  const ATTR_NET_PEER_NAME = "net.peer.name";
8
7
  const ATTR_NET_PEER_PORT = "net.peer.port";
9
- const DB_SYSTEM_NAME_VALUE_MONGODB = "mongodb";
10
8
 
11
- export { ATTR_DB_MONGODB_COLLECTION, ATTR_DB_NAME, ATTR_DB_OPERATION, ATTR_DB_STATEMENT, ATTR_DB_SYSTEM, ATTR_DB_USER, ATTR_NET_PEER_NAME, ATTR_NET_PEER_PORT, DB_SYSTEM_NAME_VALUE_MONGODB };
9
+ export { ATTR_DB_MONGODB_COLLECTION, ATTR_DB_NAME, ATTR_DB_OPERATION, ATTR_DB_SYSTEM, ATTR_DB_USER, ATTR_NET_PEER_NAME, ATTR_NET_PEER_PORT };
12
10
  //# sourceMappingURL=semconv.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"semconv.js","sources":["../../../../../../src/integrations/tracing/mongoose/vendored/semconv.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-mongoose\n * - Upstream version: @opentelemetry/instrumentation-mongoose@0.64.0\n */\n/* eslint-disable */\n\n/**\n * Deprecated, use `db.collection.name` instead.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `db.collection.name`.\n */\nexport const ATTR_DB_MONGODB_COLLECTION = 'db.mongodb.collection' as const;\n\n/**\n * Deprecated, use `db.namespace` instead.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `db.namespace`.\n */\nexport const ATTR_DB_NAME = 'db.name' as const;\n\n/**\n * Deprecated, use `db.operation.name` instead.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `db.operation.name`.\n */\nexport const ATTR_DB_OPERATION = 'db.operation' as const;\n\n/**\n * The database statement being executed.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `db.query.text`.\n */\nexport const ATTR_DB_STATEMENT = 'db.statement' as const;\n\n/**\n * Deprecated, use `db.system.name` instead.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `db.system.name`.\n */\nexport const ATTR_DB_SYSTEM = 'db.system' as const;\n\n/**\n * Deprecated, no replacement at this time.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Removed, no replacement at this time.\n */\nexport const ATTR_DB_USER = 'db.user' as const;\n\n/**\n * Deprecated, use `server.address` on client spans and `client.address` on server spans.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `server.address` on client spans and `client.address` on server spans.\n */\nexport const ATTR_NET_PEER_NAME = 'net.peer.name' as const;\n\n/**\n * Deprecated, use `server.port` on client spans and `client.port` on server spans.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `server.port` on client spans and `client.port` on server spans.\n */\nexport const ATTR_NET_PEER_PORT = 'net.peer.port' as const;\n\n/**\n * Enum value \"mongodb\" for attribute {@link ATTR_DB_SYSTEM_NAME}.\n *\n * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const DB_SYSTEM_NAME_VALUE_MONGODB = 'mongodb' as const;\n"],"names":[],"mappings":"AA4BO,MAAM,0BAAA,GAA6B;AASnC,MAAM,YAAA,GAAe;AASrB,MAAM,iBAAA,GAAoB;AAS1B,MAAM,iBAAA,GAAoB;AAS1B,MAAM,cAAA,GAAiB;AASvB,MAAM,YAAA,GAAe;AASrB,MAAM,kBAAA,GAAqB;AAS3B,MAAM,kBAAA,GAAqB;AAO3B,MAAM,4BAAA,GAA+B;;;;"}
1
+ {"version":3,"file":"semconv.js","sources":["../../../../../../src/integrations/tracing/mongoose/vendored/semconv.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-mongoose\n * - Upstream version: @opentelemetry/instrumentation-mongoose@0.64.0\n */\n\n/**\n * Deprecated, use `db.collection.name` instead.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `db.collection.name`.\n */\nexport const ATTR_DB_MONGODB_COLLECTION = 'db.mongodb.collection' as const;\n\n/**\n * Deprecated, use `db.namespace` instead.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `db.namespace`.\n */\nexport const ATTR_DB_NAME = 'db.name' as const;\n\n/**\n * Deprecated, use `db.operation.name` instead.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `db.operation.name`.\n */\nexport const ATTR_DB_OPERATION = 'db.operation' as const;\n\n/**\n * Deprecated, use `db.system.name` instead.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `db.system.name`.\n */\nexport const ATTR_DB_SYSTEM = 'db.system' as const;\n\n/**\n * Deprecated, no replacement at this time.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Removed, no replacement at this time.\n */\nexport const ATTR_DB_USER = 'db.user' as const;\n\n/**\n * Deprecated, use `server.address` on client spans and `client.address` on server spans.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `server.address` on client spans and `client.address` on server spans.\n */\nexport const ATTR_NET_PEER_NAME = 'net.peer.name' as const;\n\n/**\n * Deprecated, use `server.port` on client spans and `client.port` on server spans.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `server.port` on client spans and `client.port` on server spans.\n */\nexport const ATTR_NET_PEER_PORT = 'net.peer.port' as const;\n"],"names":[],"mappings":"AAgBO,MAAM,0BAAA,GAA6B;AASnC,MAAM,YAAA,GAAe;AASrB,MAAM,iBAAA,GAAoB;AAS1B,MAAM,cAAA,GAAiB;AASvB,MAAM,YAAA,GAAe;AASrB,MAAM,kBAAA,GAAqB;AAS3B,MAAM,kBAAA,GAAqB;;;;"}