@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":"utils.js","sources":["../../../../../../src/integrations/tracing/graphql/vendored/utils.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-graphql\n * - Upstream version: @opentelemetry/instrumentation-graphql@0.66.0\n * - Types from `graphql` package inlined as simplified interfaces\n * - Minor TypeScript strictness adjustments\n */\n/* eslint-disable */\n\nimport type {\n DocumentNode,\n GraphQLFieldResolver,\n GraphQLObjectType,\n GraphQLOutputType,\n GraphQLResolveInfo,\n GraphQLType,\n GraphQLUnionType,\n Location,\n Maybe,\n Token,\n} from './graphql-types';\nimport * as api from '@opentelemetry/api';\nimport { AllowedOperationTypes, SpanNames, TokenKind } from './enum';\nimport { AttributeNames } from './enums/AttributeNames';\nimport { OTEL_GRAPHQL_DATA_SYMBOL, OTEL_PATCHED_SYMBOL } from './symbols';\nimport { GraphQLField, GraphQLPath, ObjectWithGraphQLData, OtelPatched } from './internal-types';\nimport { GraphQLInstrumentationParsedConfig } from './types';\n\nconst OPERATION_VALUES = Object.values(AllowedOperationTypes);\n\n// https://github.com/graphql/graphql-js/blob/main/src/jsutils/isPromise.ts\nexport const isPromise = (value: any): value is Promise<unknown> => {\n return typeof value?.then === 'function';\n};\n\n// https://github.com/graphql/graphql-js/blob/main/src/jsutils/isObjectLike.ts\nconst isObjectLike = (value: unknown): value is { [key: string]: unknown } => {\n return typeof value == 'object' && value !== null;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction addInputVariableAttribute(span: api.Span, key: string, variable: any) {\n if (Array.isArray(variable)) {\n variable.forEach((value, idx) => {\n addInputVariableAttribute(span, `${key}.${idx}`, value);\n });\n } else if (variable instanceof Object) {\n Object.entries(variable).forEach(([nestedKey, value]) => {\n addInputVariableAttribute(span, `${key}.${nestedKey}`, value);\n });\n } else {\n span.setAttribute(`${AttributeNames.VARIABLES}${String(key)}`, variable);\n }\n}\n\nexport function addInputVariableAttributes(span: api.Span, variableValues: { [key: string]: any }) {\n Object.entries(variableValues).forEach(([key, value]) => {\n addInputVariableAttribute(span, key, value);\n });\n}\n\nexport function addSpanSource(\n span: api.Span,\n loc?: Location,\n allowValues?: boolean,\n start?: number,\n end?: number,\n): void {\n const source = getSourceFromLocation(loc, allowValues, start, end);\n span.setAttribute(AttributeNames.SOURCE, source);\n}\n\nfunction createFieldIfNotExists(\n tracer: api.Tracer,\n getConfig: () => GraphQLInstrumentationParsedConfig,\n contextValue: any,\n info: GraphQLResolveInfo,\n path: string[],\n): {\n field: GraphQLField;\n spanAdded: boolean;\n} {\n let field = getField(contextValue, path);\n if (field) {\n return { field, spanAdded: false };\n }\n\n const config = getConfig();\n const parentSpan = config.flatResolveSpans ? getRootSpan(contextValue) : getParentFieldSpan(contextValue, path);\n\n field = {\n span: createResolverSpan(tracer, getConfig, contextValue, info, path, parentSpan),\n };\n\n addField(contextValue, path, field);\n\n return { field, spanAdded: true };\n}\n\nfunction createResolverSpan(\n tracer: api.Tracer,\n getConfig: () => GraphQLInstrumentationParsedConfig,\n contextValue: any,\n info: GraphQLResolveInfo,\n path: string[],\n parentSpan?: api.Span,\n): api.Span {\n const attributes: api.SpanAttributes = {\n [AttributeNames.FIELD_NAME]: info.fieldName,\n [AttributeNames.FIELD_PATH]: path.join('.'),\n [AttributeNames.FIELD_TYPE]: info.returnType.toString(),\n [AttributeNames.PARENT_NAME]: info.parentType.name,\n };\n\n const span = tracer.startSpan(\n `${SpanNames.RESOLVE} ${attributes[AttributeNames.FIELD_PATH]}`,\n {\n attributes,\n },\n parentSpan ? api.trace.setSpan(api.context.active(), parentSpan) : undefined,\n );\n\n const document = contextValue[OTEL_GRAPHQL_DATA_SYMBOL].source;\n const fieldNode = info.fieldNodes.find(fieldNode => fieldNode.kind === 'Field');\n\n if (fieldNode) {\n addSpanSource(span, document.loc, getConfig().allowValues, fieldNode.loc?.start, fieldNode.loc?.end);\n }\n\n return span;\n}\n\nexport function endSpan(span: api.Span, error?: Error): void {\n if (error) {\n span.recordException(error);\n }\n span.end();\n}\n\nexport function getOperation(document: DocumentNode, operationName?: Maybe<string>): DefinitionNodeLike | undefined {\n if (!document || !Array.isArray(document.definitions)) {\n return undefined;\n }\n\n if (operationName) {\n return document.definitions\n .filter(definition => OPERATION_VALUES.indexOf((definition as any)?.operation) !== -1)\n .find(definition => operationName === (definition as any)?.name?.value);\n } else {\n return document.definitions.find(definition => OPERATION_VALUES.indexOf((definition as any)?.operation) !== -1);\n }\n}\n\ntype DefinitionNodeLike = DocumentNode['definitions'][number];\n\nfunction addField(contextValue: any, path: string[], field: GraphQLField) {\n return (contextValue[OTEL_GRAPHQL_DATA_SYMBOL].fields[path.join('.')] = field);\n}\n\nfunction getField(contextValue: any, path: string[]): GraphQLField {\n return contextValue[OTEL_GRAPHQL_DATA_SYMBOL].fields[path.join('.')];\n}\n\nfunction getParentFieldSpan(contextValue: any, path: string[]): api.Span {\n for (let i = path.length - 1; i > 0; i--) {\n const field = getField(contextValue, path.slice(0, i));\n\n if (field) {\n return field.span;\n }\n }\n\n return getRootSpan(contextValue);\n}\n\nfunction getRootSpan(contextValue: any): api.Span {\n return contextValue[OTEL_GRAPHQL_DATA_SYMBOL].span;\n}\n\nfunction pathToArray(mergeItems: boolean, path: GraphQLPath): string[] {\n const flattened: string[] = [];\n let curr: GraphQLPath | undefined = path;\n while (curr) {\n let key = curr.key;\n\n if (mergeItems && typeof key === 'number') {\n key = '*';\n }\n flattened.push(String(key));\n curr = curr.prev;\n }\n return flattened.reverse();\n}\n\nfunction repeatBreak(i: number): string {\n return repeatChar('\\n', i);\n}\n\nfunction repeatSpace(i: number): string {\n return repeatChar(' ', i);\n}\n\nfunction repeatChar(char: string, to: number): string {\n let text = '';\n for (let i = 0; i < to; i++) {\n text += char;\n }\n return text;\n}\n\nconst KindsToBeRemoved: string[] = [TokenKind.FLOAT, TokenKind.STRING, TokenKind.INT, TokenKind.BLOCK_STRING];\n\nexport function getSourceFromLocation(\n loc?: Location,\n allowValues = false,\n inputStart?: number,\n inputEnd?: number,\n): string {\n let source = '';\n\n if (loc?.startToken) {\n const start = typeof inputStart === 'number' ? inputStart : loc.start;\n const end = typeof inputEnd === 'number' ? inputEnd : loc.end;\n\n let next: Token | null = loc.startToken.next;\n let previousLine: number | undefined = 1;\n while (next) {\n if (next.start < start) {\n next = next.next;\n previousLine = next?.line;\n continue;\n }\n if (next.end > end) {\n next = next.next;\n previousLine = next?.line;\n continue;\n }\n let value = next.value || next.kind;\n let space = '';\n if (!allowValues && KindsToBeRemoved.indexOf(next.kind) >= 0) {\n // value = repeatChar('*', value.length);\n value = '*';\n }\n if (next.kind === TokenKind.STRING) {\n value = `\"${value}\"`;\n }\n if (next.kind === TokenKind.EOF) {\n value = '';\n }\n if (next.line > previousLine!) {\n source += repeatBreak(next.line - previousLine!);\n previousLine = next.line;\n space = repeatSpace(next.column - 1);\n } else {\n if (next.line === next.prev?.line) {\n space = repeatSpace(next.start - (next.prev?.end || 0));\n }\n }\n source += space + value;\n if (next) {\n next = next.next!;\n }\n }\n }\n\n return source;\n}\n\nexport function wrapFields(\n type: Maybe<GraphQLObjectType & OtelPatched>,\n tracer: api.Tracer,\n getConfig: () => GraphQLInstrumentationParsedConfig,\n): void {\n if (!type || (type as any)[OTEL_PATCHED_SYMBOL]) {\n return;\n }\n const fields = type.getFields();\n\n (type as any)[OTEL_PATCHED_SYMBOL] = true;\n\n Object.keys(fields).forEach(key => {\n const field = fields[key];\n\n if (!field) {\n return;\n }\n\n if (field.resolve) {\n field.resolve = wrapFieldResolver(tracer, getConfig, field.resolve);\n }\n\n if (field.type) {\n const unwrappedTypes = unwrapType(field.type);\n for (const unwrappedType of unwrappedTypes) {\n wrapFields(unwrappedType as any, tracer, getConfig);\n }\n }\n });\n}\n\nfunction unwrapType(type: GraphQLOutputType): readonly GraphQLObjectType[] {\n // unwrap wrapping types (non-nullable and list types)\n if ('ofType' in type) {\n return unwrapType(type.ofType);\n }\n\n // unwrap union types\n if (isGraphQLUnionType(type)) {\n return type.getTypes();\n }\n\n // return object types\n if (isGraphQLObjectType(type)) {\n return [type];\n }\n\n return [];\n}\n\nfunction isGraphQLUnionType(type: GraphQLType): type is GraphQLUnionType {\n return 'getTypes' in type && typeof type.getTypes === 'function';\n}\n\nfunction isGraphQLObjectType(type: GraphQLType): type is GraphQLObjectType {\n return 'getFields' in type && typeof type.getFields === 'function';\n}\n\nconst handleResolveSpanError = (resolveSpan: api.Span, err: any, shouldEndSpan: boolean) => {\n if (!shouldEndSpan) {\n return;\n }\n resolveSpan.recordException(err);\n resolveSpan.setStatus({\n code: api.SpanStatusCode.ERROR,\n message: err.message,\n });\n resolveSpan.end();\n};\n\nconst handleResolveSpanSuccess = (resolveSpan: api.Span, shouldEndSpan: boolean) => {\n if (!shouldEndSpan) {\n return;\n }\n resolveSpan.end();\n};\n\nexport function wrapFieldResolver<TSource = any, TContext = any, TArgs = any>(\n tracer: api.Tracer,\n getConfig: () => GraphQLInstrumentationParsedConfig,\n fieldResolver: Maybe<GraphQLFieldResolver<TSource, TContext, TArgs> & OtelPatched>,\n isDefaultResolver = false,\n): GraphQLFieldResolver<TSource, TContext & ObjectWithGraphQLData, TArgs> & OtelPatched {\n if ((wrappedFieldResolver as OtelPatched)[OTEL_PATCHED_SYMBOL] || typeof fieldResolver !== 'function') {\n return fieldResolver!;\n }\n\n function wrappedFieldResolver(\n this: GraphQLFieldResolver<TSource, TContext, TArgs>,\n source: TSource,\n args: TArgs,\n contextValue: TContext & ObjectWithGraphQLData,\n info: GraphQLResolveInfo,\n ) {\n if (!fieldResolver) {\n return undefined;\n }\n const config = getConfig();\n\n // follows what graphql is doing to decide if this is a trivial resolver\n // for which we don't need to create a resolve span\n if (\n config.ignoreTrivialResolveSpans &&\n isDefaultResolver &&\n (isObjectLike(source) || typeof source === 'function')\n ) {\n const property = (source as any)[info.fieldName];\n // a function execution is not trivial and should be recorder.\n // property which is not a function is just a value and we don't want a \"resolve\" span for it\n if (typeof property !== 'function') {\n return fieldResolver.call(this, source, args, contextValue, info);\n }\n }\n\n if (!contextValue[OTEL_GRAPHQL_DATA_SYMBOL]) {\n return fieldResolver.call(this, source, args, contextValue, info);\n }\n const path = pathToArray(config.mergeItems, info && info.path);\n const depth = path.filter((item: any) => typeof item === 'string').length;\n\n let span: api.Span;\n let shouldEndSpan = false;\n if (config.depth >= 0 && config.depth < depth) {\n span = getParentFieldSpan(contextValue, path);\n } else {\n const { field, spanAdded } = createFieldIfNotExists(tracer, getConfig, contextValue, info, path);\n span = field.span;\n shouldEndSpan = spanAdded;\n }\n\n return api.context.with(api.trace.setSpan(api.context.active(), span), () => {\n try {\n const res = fieldResolver.call(this, source, args, contextValue, info);\n if (isPromise(res)) {\n return res.then(\n (r: any) => {\n handleResolveSpanSuccess(span, shouldEndSpan);\n return r;\n },\n (err: Error) => {\n handleResolveSpanError(span, err, shouldEndSpan);\n throw err;\n },\n );\n } else {\n handleResolveSpanSuccess(span, shouldEndSpan);\n return res;\n }\n } catch (err: any) {\n handleResolveSpanError(span, err, shouldEndSpan);\n throw err;\n }\n });\n }\n\n (wrappedFieldResolver as OtelPatched)[OTEL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"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-graphql\n * - Upstream version: @opentelemetry/instrumentation-graphql@0.66.0\n * - Types from `graphql` package inlined as simplified interfaces\n * - Minor TypeScript strictness adjustments\n * - Span lifecycle migrated from the OpenTelemetry tracer to the @sentry/core span API\n */\n\nimport type {\n DocumentNode,\n GraphQLFieldResolver,\n GraphQLObjectType,\n GraphQLOutputType,\n GraphQLResolveInfo,\n GraphQLType,\n GraphQLUnionType,\n Location,\n Maybe,\n Token,\n} from './graphql-types';\nimport type { Span, SpanAttributes } from '@sentry/core';\nimport { SPAN_STATUS_ERROR, startInactiveSpan, withActiveSpan } from '@sentry/core';\nimport { AllowedOperationTypes, SpanNames, TokenKind } from './enum';\nimport { AttributeNames } from './enums/AttributeNames';\nimport { OTEL_GRAPHQL_DATA_SYMBOL, OTEL_PATCHED_SYMBOL } from './symbols';\nimport type { GraphQLField, GraphQLPath, ObjectWithGraphQLData, OtelPatched } from './internal-types';\nimport type { GraphQLInstrumentationParsedConfig } from './types';\n\nconst OPERATION_VALUES = Object.values(AllowedOperationTypes);\n\n// https://github.com/graphql/graphql-js/blob/main/src/jsutils/isPromise.ts\nexport const isPromise = (value: any): value is Promise<unknown> => {\n return typeof value?.then === 'function';\n};\n\n// https://github.com/graphql/graphql-js/blob/main/src/jsutils/isObjectLike.ts\nconst isObjectLike = (value: unknown): value is { [key: string]: unknown } => {\n return typeof value == 'object' && value !== null;\n};\n\nexport function addSpanSource(span: Span, loc?: Location, start?: number, end?: number): void {\n const source = getSourceFromLocation(loc, start, end);\n span.setAttribute(AttributeNames.SOURCE, source);\n}\n\nfunction createFieldIfNotExists(\n contextValue: any,\n info: GraphQLResolveInfo,\n path: string[],\n): {\n field: GraphQLField;\n spanAdded: boolean;\n} {\n let field = getField(contextValue, path);\n if (field) {\n return { field, spanAdded: false };\n }\n\n const parentSpan = getParentFieldSpan(contextValue, path);\n\n field = {\n span: createResolverSpan(contextValue, info, path, parentSpan),\n };\n\n addField(contextValue, path, field);\n\n return { field, spanAdded: true };\n}\n\nfunction createResolverSpan(contextValue: any, info: GraphQLResolveInfo, path: string[], parentSpan?: Span): Span {\n const attributes: SpanAttributes = {\n [AttributeNames.FIELD_NAME]: info.fieldName,\n [AttributeNames.FIELD_PATH]: path.join('.'),\n [AttributeNames.FIELD_TYPE]: info.returnType.toString(),\n [AttributeNames.PARENT_NAME]: info.parentType.name,\n };\n\n const span = startInactiveSpan({\n name: `${SpanNames.RESOLVE} ${attributes[AttributeNames.FIELD_PATH]}`,\n attributes,\n parentSpan,\n });\n\n const document = contextValue[OTEL_GRAPHQL_DATA_SYMBOL].source;\n const fieldNode = info.fieldNodes.find(fieldNode => fieldNode.kind === 'Field');\n\n if (fieldNode) {\n addSpanSource(span, document.loc, fieldNode.loc?.start, fieldNode.loc?.end);\n }\n\n return span;\n}\n\nexport function endSpan(span: Span, error?: Error): void {\n if (error) {\n span.setStatus({ code: SPAN_STATUS_ERROR, message: error.message });\n }\n span.end();\n}\n\nexport function getOperation(document: DocumentNode, operationName?: Maybe<string>): DefinitionNodeLike | undefined {\n if (!document || !Array.isArray(document.definitions)) {\n return undefined;\n }\n\n if (operationName) {\n return document.definitions\n .filter(definition => OPERATION_VALUES.indexOf(definition?.operation) !== -1)\n .find(definition => operationName === definition?.name?.value);\n } else {\n return document.definitions.find(definition => OPERATION_VALUES.indexOf(definition?.operation) !== -1);\n }\n}\n\ntype DefinitionNodeLike = DocumentNode['definitions'][number];\n\nfunction addField(contextValue: any, path: string[], field: GraphQLField) {\n return (contextValue[OTEL_GRAPHQL_DATA_SYMBOL].fields[path.join('.')] = field);\n}\n\nfunction getField(contextValue: any, path: string[]): GraphQLField {\n return contextValue[OTEL_GRAPHQL_DATA_SYMBOL].fields[path.join('.')];\n}\n\nfunction getParentFieldSpan(contextValue: any, path: string[]): Span {\n for (let i = path.length - 1; i > 0; i--) {\n const field = getField(contextValue, path.slice(0, i));\n\n if (field) {\n return field.span;\n }\n }\n\n return getRootSpan(contextValue);\n}\n\nfunction getRootSpan(contextValue: any): Span {\n return contextValue[OTEL_GRAPHQL_DATA_SYMBOL].span;\n}\n\nfunction pathToArray(path: GraphQLPath): string[] {\n const flattened: string[] = [];\n let curr: GraphQLPath | undefined = path;\n while (curr) {\n flattened.push(String(curr.key));\n curr = curr.prev;\n }\n return flattened.reverse();\n}\n\nfunction repeatBreak(i: number): string {\n return repeatChar('\\n', i);\n}\n\nfunction repeatSpace(i: number): string {\n return repeatChar(' ', i);\n}\n\nfunction repeatChar(char: string, to: number): string {\n let text = '';\n for (let i = 0; i < to; i++) {\n text += char;\n }\n return text;\n}\n\nconst KindsToBeRemoved: string[] = [TokenKind.FLOAT, TokenKind.STRING, TokenKind.INT, TokenKind.BLOCK_STRING];\n\nexport function getSourceFromLocation(loc?: Location, inputStart?: number, inputEnd?: number): string {\n let source = '';\n\n if (loc?.startToken) {\n const start = typeof inputStart === 'number' ? inputStart : loc.start;\n const end = typeof inputEnd === 'number' ? inputEnd : loc.end;\n\n let next: Token | null = loc.startToken.next;\n let previousLine: number | undefined = 1;\n while (next) {\n if (next.start < start) {\n next = next.next;\n previousLine = next?.line;\n continue;\n }\n if (next.end > end) {\n next = next.next;\n previousLine = next?.line;\n continue;\n }\n let value = next.value || next.kind;\n let space = '';\n if (KindsToBeRemoved.indexOf(next.kind) >= 0) {\n value = '*';\n }\n if (next.kind === TokenKind.STRING) {\n value = `\"${value}\"`;\n }\n if (next.kind === TokenKind.EOF) {\n value = '';\n }\n if (next.line > previousLine!) {\n source += repeatBreak(next.line - previousLine!);\n previousLine = next.line;\n space = repeatSpace(next.column - 1);\n } else {\n if (next.line === next.prev?.line) {\n space = repeatSpace(next.start - (next.prev?.end || 0));\n }\n }\n source += space + value;\n if (next) {\n next = next.next!;\n }\n }\n }\n\n return source;\n}\n\nexport function wrapFields(\n type: Maybe<GraphQLObjectType & OtelPatched>,\n getConfig: () => GraphQLInstrumentationParsedConfig,\n): void {\n if (!type || (type as any)[OTEL_PATCHED_SYMBOL]) {\n return;\n }\n const fields = type.getFields();\n\n (type as any)[OTEL_PATCHED_SYMBOL] = true;\n\n Object.keys(fields).forEach(key => {\n const field = fields[key];\n\n if (!field) {\n return;\n }\n\n if (field.resolve) {\n field.resolve = wrapFieldResolver(getConfig, field.resolve);\n }\n\n if (field.type) {\n const unwrappedTypes = unwrapType(field.type);\n for (const unwrappedType of unwrappedTypes) {\n wrapFields(unwrappedType as any, getConfig);\n }\n }\n });\n}\n\nfunction unwrapType(type: GraphQLOutputType): readonly GraphQLObjectType[] {\n // unwrap wrapping types (non-nullable and list types)\n if ('ofType' in type) {\n return unwrapType(type.ofType);\n }\n\n // unwrap union types\n if (isGraphQLUnionType(type)) {\n return type.getTypes();\n }\n\n // return object types\n if (isGraphQLObjectType(type)) {\n return [type];\n }\n\n return [];\n}\n\nfunction isGraphQLUnionType(type: GraphQLType): type is GraphQLUnionType {\n return 'getTypes' in type && typeof type.getTypes === 'function';\n}\n\nfunction isGraphQLObjectType(type: GraphQLType): type is GraphQLObjectType {\n return 'getFields' in type && typeof type.getFields === 'function';\n}\n\nconst handleResolveSpanError = (resolveSpan: Span, err: any, shouldEndSpan: boolean) => {\n if (!shouldEndSpan) {\n return;\n }\n resolveSpan.setStatus({\n code: SPAN_STATUS_ERROR,\n message: err.message,\n });\n resolveSpan.end();\n};\n\nconst handleResolveSpanSuccess = (resolveSpan: Span, shouldEndSpan: boolean) => {\n if (!shouldEndSpan) {\n return;\n }\n resolveSpan.end();\n};\n\nexport function wrapFieldResolver<TSource = any, TContext = any, TArgs = any>(\n getConfig: () => GraphQLInstrumentationParsedConfig,\n fieldResolver: Maybe<GraphQLFieldResolver<TSource, TContext, TArgs> & OtelPatched>,\n isDefaultResolver = false,\n): GraphQLFieldResolver<TSource, TContext & ObjectWithGraphQLData, TArgs> & OtelPatched {\n if ((wrappedFieldResolver as OtelPatched)[OTEL_PATCHED_SYMBOL] || typeof fieldResolver !== 'function') {\n return fieldResolver!;\n }\n\n function wrappedFieldResolver(\n this: GraphQLFieldResolver<TSource, TContext, TArgs>,\n source: TSource,\n args: TArgs,\n contextValue: TContext & ObjectWithGraphQLData,\n info: GraphQLResolveInfo,\n ) {\n if (!fieldResolver) {\n return undefined;\n }\n const config = getConfig();\n\n // follows what graphql is doing to decide if this is a trivial resolver\n // for which we don't need to create a resolve span\n if (\n config.ignoreTrivialResolveSpans &&\n isDefaultResolver &&\n (isObjectLike(source) || typeof source === 'function')\n ) {\n const property = (source as any)[info.fieldName];\n // a function execution is not trivial and should be recorder.\n // property which is not a function is just a value and we don't want a \"resolve\" span for it\n if (typeof property !== 'function') {\n return fieldResolver.call(this, source, args, contextValue, info);\n }\n }\n\n if (!contextValue[OTEL_GRAPHQL_DATA_SYMBOL]) {\n return fieldResolver.call(this, source, args, contextValue, info);\n }\n const path = pathToArray(info?.path);\n\n const { field, spanAdded } = createFieldIfNotExists(contextValue, info, path);\n const span = field.span;\n const shouldEndSpan = spanAdded;\n\n return withActiveSpan(span, () => {\n try {\n const res = fieldResolver.call(this, source, args, contextValue, info);\n if (isPromise(res)) {\n return res.then(\n (r: any) => {\n handleResolveSpanSuccess(span, shouldEndSpan);\n return r;\n },\n (err: Error) => {\n handleResolveSpanError(span, err, shouldEndSpan);\n throw err;\n },\n );\n } else {\n handleResolveSpanSuccess(span, shouldEndSpan);\n return res;\n }\n } catch (err: any) {\n handleResolveSpanError(span, err, shouldEndSpan);\n throw err;\n }\n });\n }\n\n (wrappedFieldResolver as OtelPatched)[OTEL_PATCHED_SYMBOL] = true;\n\n return wrappedFieldResolver;\n}\n"],"names":["AllowedOperationTypes","AttributeNames","startInactiveSpan","SpanNames","OTEL_GRAPHQL_DATA_SYMBOL","fieldNode","SPAN_STATUS_ERROR","TokenKind","OTEL_PATCHED_SYMBOL","with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A,OAAO,GAAA;AAAA,QACT;AAAA,MACF,SAAS,GAAA,EAAU;AACjB,QAAA,sBAAA,CAAuB,IAAA,EAAM,KAAK,aAAa,CAAA;AAC/C,QAAA,MAAM,GAAA;AAAA,MACR;AAAA,IACF,CAAC,CAAA;AAAA,EACH;AAEA,EAAC,oBAAA,CAAqCD,2BAAmB,CAAA,GAAI,IAAA;AAE7D,EAAA,OAAO,oBAAA;AACT;;;;;;;;;;"}
@@ -50,25 +50,8 @@ const hapiErrorPlugin = {
50
50
  };
51
51
  async function setupHapiErrorHandler(server) {
52
52
  await server.register(hapiErrorPlugin);
53
- const client = core.getClient();
54
- if (client) {
55
- client.on("spanStart", (span) => {
56
- addHapiSpanAttributes(span);
57
- });
58
- }
59
53
  nodeCore.ensureIsWrapped(server.register, "hapi");
60
54
  }
61
- function addHapiSpanAttributes(span) {
62
- const attributes = core.spanToJSON(span).data;
63
- const type = attributes["hapi.type"];
64
- if (attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_OP] || !type) {
65
- return;
66
- }
67
- span.setAttributes({
68
- [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.http.otel.hapi",
69
- [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: `${type}.hapi`
70
- });
71
- }
72
55
 
73
56
  exports.hapiErrorPlugin = hapiErrorPlugin;
74
57
  exports.hapiIntegration = hapiIntegration;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/hapi/index.ts"],"sourcesContent":["import { HapiInstrumentation } from './vendored/instrumentation';\nimport type { IntegrationFn, Span } from '@sentry/core';\nimport {\n captureException,\n debug,\n defineIntegration,\n getClient,\n getDefaultIsolationScope,\n getIsolationScope,\n SDK_VERSION,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n spanToJSON,\n} from '@sentry/core';\nimport { ensureIsWrapped, generateInstrumentOnce } from '@sentry/node-core';\nimport { DEBUG_BUILD } from '../../../debug-build';\nimport type { Request, RequestEvent, Server } from './types';\n\nconst INTEGRATION_NAME = 'Hapi';\n\nexport const instrumentHapi = generateInstrumentOnce(INTEGRATION_NAME, () => new HapiInstrumentation());\n\nconst _hapiIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentHapi();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for [Hapi](https://hapi.dev/).\n *\n * If you also want to capture errors, you need to call `setupHapiErrorHandler(server)` after you set up your server.\n *\n * For more information, see the [hapi documentation](https://docs.sentry.io/platforms/javascript/guides/hapi/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.hapiIntegration()],\n * })\n * ```\n */\nexport const hapiIntegration = defineIntegration(_hapiIntegration);\n\nfunction isErrorEvent(event: unknown): event is RequestEvent {\n return !!(event && typeof event === 'object' && 'error' in event && event.error);\n}\n\nfunction sendErrorToSentry(errorData: object): void {\n captureException(errorData, {\n mechanism: {\n type: 'auto.function.hapi',\n handled: false,\n },\n });\n}\n\nexport const hapiErrorPlugin = {\n name: 'SentryHapiErrorPlugin',\n version: SDK_VERSION,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n register: async function (serverArg: Record<any, any>) {\n const server = serverArg as unknown as Server;\n\n server.events.on({ name: 'request', channels: ['error'] }, (request: Request, event: RequestEvent) => {\n if (getIsolationScope() !== getDefaultIsolationScope()) {\n const route = request.route;\n if (route.path) {\n getIsolationScope().setTransactionName(`${route.method.toUpperCase()} ${route.path}`);\n }\n } else {\n DEBUG_BUILD &&\n debug.warn('Isolation scope is still the default isolation scope - skipping setting transactionName');\n }\n\n if (isErrorEvent(event)) {\n sendErrorToSentry(event.error);\n }\n });\n },\n};\n\n/**\n * Add a Hapi plugin to capture errors to Sentry.\n *\n * @param server The Hapi server to attach the error handler to\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n * const Hapi = require('@hapi/hapi');\n *\n * const init = async () => {\n * const server = Hapi.server();\n *\n * // all your routes here\n *\n * await Sentry.setupHapiErrorHandler(server);\n *\n * await server.start();\n * };\n * ```\n */\nexport async function setupHapiErrorHandler(server: Server): Promise<void> {\n await server.register(hapiErrorPlugin);\n\n // Sadly, middleware spans do not go through `requestHook`, so we handle those here\n // We register this hook in this method, because if we register it in the integration `setup`,\n // it would always run even for users that are not even using hapi\n const client = getClient();\n if (client) {\n client.on('spanStart', span => {\n addHapiSpanAttributes(span);\n });\n }\n\n ensureIsWrapped(server.register, 'hapi');\n}\n\nfunction addHapiSpanAttributes(span: Span): void {\n const attributes = spanToJSON(span).data;\n\n // this is one of: router, plugin, server.ext\n const type = attributes['hapi.type'];\n\n // If this is already set, or we have no Hapi span, no need to process again...\n if (attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP] || !type) {\n return;\n }\n\n span.setAttributes({\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.otel.hapi',\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: `${type}.hapi`,\n });\n}\n"],"names":["generateInstrumentOnce","HapiInstrumentation","defineIntegration","captureException","SDK_VERSION","getIsolationScope","getDefaultIsolationScope","DEBUG_BUILD","debug","getClient","ensureIsWrapped","spanToJSON","SEMANTIC_ATTRIBUTE_SENTRY_OP","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN"],"mappings":";;;;;;;AAkBA,MAAM,gBAAA,GAAmB,MAAA;AAElB,MAAM,iBAAiBA,+BAAA,CAAuB,gBAAA,EAAkB,MAAM,IAAIC,qCAAqB;AAEtG,MAAM,oBAAoB,MAAM;AAC9B,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AACV,MAAA,cAAA,EAAe;AAAA,IACjB;AAAA,GACF;AACF,CAAA,CAAA;AAkBO,MAAM,eAAA,GAAkBC,uBAAkB,gBAAgB;AAEjE,SAAS,aAAa,KAAA,EA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eAAe,CAAA;AAKrC,EAAA,MAAM,SAASC,cAAA,EAAU;AACzB,EAAA,IAAI,MAAA,EAAQ;AACV,IAAA,MAAA,CAAO,EAAA,CAAG,aAAa,CAAA,IAAA,KAAQ;AAC7B,MAAA,qBAAA,CAAsB,IAAI,CAAA;AAAA,IAC5B,CAAC,CAAA;AAAA,EACH;AAEA,EAAAC,wBAAA,CAAgB,MAAA,CAAO,UAAU,MAAM,CAAA;AACzC;AAEA,SAAS,sBAAsB,IAAA,EAAkB;AAC/C,EAAA,MAAM,UAAA,GAAaC,eAAA,CAAW,IAAI,CAAA,CAAE,IAAA;AAGpC,EAAA,MAAM,IAAA,GAAO,WAAW,WAAW,CAAA;AAGnC,EAAA,IAAI,UAAA,CAAWC,iCAA4B,CAAA,IAAK,CAAC,IAAA,EAAM;AACrD,IAAA;AAAA,EACF;AAEA,EAAA,IAAA,CAAK,aAAA,CAAc;AAAA,IACjB,CAACC,qCAAgC,GAAG,qBAAA;AAAA,IACpC,CAACD,iCAA4B,GAAG,CAAA,EAAG,IAAI,CAAA,KAAA;AAAA,GACxC,CAAA;AACH;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/hapi/index.ts"],"sourcesContent":["import { HapiInstrumentation } from './vendored/instrumentation';\nimport type { IntegrationFn } from '@sentry/core';\nimport {\n captureException,\n debug,\n defineIntegration,\n getDefaultIsolationScope,\n getIsolationScope,\n SDK_VERSION,\n} from '@sentry/core';\nimport { ensureIsWrapped, generateInstrumentOnce } from '@sentry/node-core';\nimport { DEBUG_BUILD } from '../../../debug-build';\nimport type { Request, RequestEvent, Server } from './types';\n\nconst INTEGRATION_NAME = 'Hapi';\n\nexport const instrumentHapi = generateInstrumentOnce(INTEGRATION_NAME, () => new HapiInstrumentation());\n\nconst _hapiIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentHapi();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for [Hapi](https://hapi.dev/).\n *\n * If you also want to capture errors, you need to call `setupHapiErrorHandler(server)` after you set up your server.\n *\n * For more information, see the [hapi documentation](https://docs.sentry.io/platforms/javascript/guides/hapi/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.hapiIntegration()],\n * })\n * ```\n */\nexport const hapiIntegration = defineIntegration(_hapiIntegration);\n\nfunction isErrorEvent(event: unknown): event is RequestEvent {\n return !!(event && typeof event === 'object' && 'error' in event && event.error);\n}\n\nfunction sendErrorToSentry(errorData: object): void {\n captureException(errorData, {\n mechanism: {\n type: 'auto.function.hapi',\n handled: false,\n },\n });\n}\n\nexport const hapiErrorPlugin = {\n name: 'SentryHapiErrorPlugin',\n version: SDK_VERSION,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n register: async function (serverArg: Record<any, any>) {\n const server = serverArg as unknown as Server;\n\n server.events.on({ name: 'request', channels: ['error'] }, (request: Request, event: RequestEvent) => {\n if (getIsolationScope() !== getDefaultIsolationScope()) {\n const route = request.route;\n if (route.path) {\n getIsolationScope().setTransactionName(`${route.method.toUpperCase()} ${route.path}`);\n }\n } else {\n DEBUG_BUILD &&\n debug.warn('Isolation scope is still the default isolation scope - skipping setting transactionName');\n }\n\n if (isErrorEvent(event)) {\n sendErrorToSentry(event.error);\n }\n });\n },\n};\n\n/**\n * Add a Hapi plugin to capture errors to Sentry.\n *\n * @param server The Hapi server to attach the error handler to\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n * const Hapi = require('@hapi/hapi');\n *\n * const init = async () => {\n * const server = Hapi.server();\n *\n * // all your routes here\n *\n * await Sentry.setupHapiErrorHandler(server);\n *\n * await server.start();\n * };\n * ```\n */\nexport async function setupHapiErrorHandler(server: Server): Promise<void> {\n await server.register(hapiErrorPlugin);\n ensureIsWrapped(server.register, 'hapi');\n}\n"],"names":["generateInstrumentOnce","HapiInstrumentation","defineIntegration","captureException","SDK_VERSION","getIsol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AA,CAAM,MAAA,CAAO,aAAa,CAAA,CAAA,EAAI,KAAA,CAAM,IAAI,CAAA,CAAE,CAAA;AAAA,QACtF;AAAA,MACF,CAAA,MAAO;AACL,QAAAE,sBAAA,IACEC,UAAA,CAAM,KAAK,yFAAyF,CAAA;AAAA,MACxG;AAEA,MAAA,IAAI,YAAA,CAAa,KAAK,CAAA,EAAG;AACvB,QAAA,iBAAA,CAAkB,MAAM,KAAK,CAAA;AAAA,MAC/B;AAAA,IACF,CAAC,CAAA;AAAA,EACH;AACF;AAuBA,eAAsB,sBAAsB,MAAA,EAA+B;AACzE,EAAA,MAAM,MAAA,CAAO,SAAS,eAAe,CAAA;AACrC,EAAAC,wBAAA,CAAgB,MAAA,CAAO,UAAU,MAAM,CAAA;AACzC;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"AttributeNames.js","sources":["../../../../../../../src/integrations/tracing/hapi/vendored/enums/AttributeNames.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-hapi\n * - Upstream version: @opentelemetry/instrumentation-hapi@0.64.0\n */\n/* eslint-disable */\n\nexport enum AttributeNames {\n HAPI_TYPE = 'hapi.type',\n PLUGIN_NAME = 'hapi.plugin.name',\n EXT_TYPE = 'server.ext.type',\n}\n"],"names":["AttributeNames"],"mappings":";;AAqBO,IAAK,cAAA,qBAAAA,eAAAA,KAAL;AACL,EAAAA,gBAAA,WAAA,CAAA,GAAY,WAAA;AACZ,EAAAA,gBAAA,aAAA,CAAA,GAAc,kBAAA;AACd,EAAAA,gBAAA,UAAA,CAAA,GAAW,iBAAA;AAHD,EAAA,OAAAA,eAAAA;AAAA,CAAA,EAAA,cAAA,IAAA,EAAA;;;;"}
1
+ {"version":3,"file":"AttributeNames.js","sources":["../../../../../../../src/integrations/tracing/hapi/vendored/enums/AttributeNames.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-hapi\n * - Upstream version: @opentelemetry/instrumentation-hapi@0.64.0\n */\n/* eslint-disable */\n\nexport enum AttributeNames {\n HAPI_TYPE = 'hapi.type',\n PLUGIN_NAME = 'hapi.plugin.name',\n EXT_TYPE = 'server.ext.type',\n}\n"],"names":["AttributeNames"],"mappings":";;AAUO,IAAK,cAAA,qBAAAA,eAAAA,KAAL;AACL,EAAAA,gBAAA,WAAA,CAAA,GAAY,WAAA;AACZ,EAAAA,gBAAA,aAAA,CAAA,GAAc,kBAAA;AACd,EAAAA,gBAAA,UAAA,CAAA,GAAW,iBAAA;AAHD,EAAA,OAAAA,eAAAA;AAAA,CAAA,EAAA,cAAA,IAAA,EAAA;;;;"}
@@ -4,6 +4,7 @@ const api = require('@opentelemetry/api');
4
4
  const setHttpServerSpanRouteAttribute = require('../../../../utils/setHttpServerSpanRouteAttribute.js');
5
5
  const instrumentation = require('@opentelemetry/instrumentation');
6
6
  const core = require('@sentry/core');
7
+ const AttributeNames = require('./enums/AttributeNames.js');
7
8
  const internalTypes = require('./internal-types.js');
8
9
  const utils = require('./utils.js');
9
10
 
@@ -11,7 +12,6 @@ const PACKAGE_NAME = "@sentry/instrumentation-hapi";
11
12
  class HapiInstrumentation extends instrumentation.InstrumentationBase {
12
13
  constructor(config = {}) {
13
14
  super(PACKAGE_NAME, core.SDK_VERSION, config);
14
- this._semconvStability = instrumentation.semconvStabilityFromStr("http", process.env.OTEL_SEMCONV_STABILITY_OPT_IN);
15
15
  }
16
16
  init() {
17
17
  return new instrumentation.InstrumentationNodeModuleDefinition(
@@ -182,31 +182,22 @@ class HapiInstrumentation extends instrumentation.InstrumentationBase {
182
182
  } else if (utils.isPatchableExtMethod(method)) {
183
183
  if (method[internalTypes.handlerPatched] === true) return method;
184
184
  method[internalTypes.handlerPatched] = true;
185
- const newHandler = async function(...params) {
185
+ const newHandler = function(...params) {
186
186
  if (api.trace.getSpan(api.context.active()) === void 0) {
187
- return await method.apply(this, params);
187
+ return method.apply(this, params);
188
188
  }
189
189
  const metadata = utils.getExtMetadata(extPoint, pluginName, method.name);
190
- const span = instrumentation.tracer.startSpan(metadata.name, {
191
- attributes: metadata.attributes
192
- });
193
- try {
194
- return await api.context.with(
195
- api.trace.setSpan(api.context.active(), span),
196
- method,
197
- void 0,
198
- ...params
199
- );
200
- } catch (err) {
201
- span.recordException(err);
202
- span.setStatus({
203
- code: api.SpanStatusCode.ERROR,
204
- message: err.message
205
- });
206
- throw err;
207
- } finally {
208
- span.end();
209
- }
190
+ return core.startSpan(
191
+ {
192
+ name: metadata.name,
193
+ op: `${metadata.attributes[AttributeNames.AttributeNames.HAPI_TYPE]}.hapi`,
194
+ attributes: {
195
+ ...metadata.attributes,
196
+ [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.http.otel.hapi"
197
+ }
198
+ },
199
+ () => method.apply(void 0, params)
200
+ );
210
201
  };
211
202
  return newHandler;
212
203
  }
@@ -220,34 +211,26 @@ class HapiInstrumentation extends instrumentation.InstrumentationBase {
220
211
  * for adding this server route. Else, signifies that the route was added directly
221
212
  */
222
213
  _wrapRouteHandler(route, pluginName) {
223
- const instrumentation = this;
224
214
  if (route[internalTypes.handlerPatched] === true) return route;
225
215
  route[internalTypes.handlerPatched] = true;
226
216
  const wrapHandler = (oldHandler) => {
227
- return async function(...params) {
217
+ return function(...params) {
228
218
  if (api.trace.getSpan(api.context.active()) === void 0) {
229
- return await oldHandler.call(this, ...params);
219
+ return oldHandler.call(this, ...params);
230
220
  }
231
221
  setHttpServerSpanRouteAttribute.setHttpServerSpanRouteAttribute(route.path);
232
- const metadata = utils.getRouteMetadata(route, instrumentation._semconvStability, pluginName);
233
- const span = instrumentation.tracer.startSpan(metadata.name, {
234
- attributes: metadata.attributes
235
- });
236
- try {
237
- return await api.context.with(
238
- api.trace.setSpan(api.context.active(), span),
239
- () => oldHandler.call(this, ...params)
240
- );
241
- } catch (err) {
242
- span.recordException(err);
243
- span.setStatus({
244
- code: api.SpanStatusCode.ERROR,
245
- message: err.message
246
- });
247
- throw err;
248
- } finally {
249
- span.end();
250
- }
222
+ const metadata = utils.getRouteMetadata(route, pluginName);
223
+ return core.startSpan(
224
+ {
225
+ name: metadata.name,
226
+ op: `${metadata.attributes[AttributeNames.AttributeNames.HAPI_TYPE]}.hapi`,
227
+ attributes: {
228
+ ...metadata.attributes,
229
+ [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.http.otel.hapi"
230
+ }
231
+ },
232
+ () => oldHandler.call(this, ...params)
233
+ );
251
234
  };
252
235
  };
253
236
  if (typeof route.handler === "function") {
@@ -1 +1 @@
1
- {"version":3,"file":"instrumentation.js","sources":["../../../../../../src/integrations/tracing/hapi/vendored/instrumentation.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-hapi\n * - Upstream version: @opentelemetry/instrumentation-hapi@0.64.0\n * - Types vendored from @hapi/hapi as simplified interfaces\n * - Minor TypeScript strictness adjustments for this repository's compiler settings\n */\n/* eslint-disable */\n\nimport * as api from '@opentelemetry/api';\nimport { setHttpServerSpanRouteAttribute } from '../../../../utils/setHttpServerSpanRouteAttribute';\nimport {\n InstrumentationBase,\n InstrumentationConfig,\n InstrumentationNodeModuleDefinition,\n isWrapped,\n SemconvStability,\n semconvStabilityFromStr,\n} from '@opentelemetry/instrumentation';\n\nimport type * as Hapi from './hapi-types';\nimport { SDK_VERSION } from '@sentry/core';\nimport {\n HapiComponentName,\n HapiServerRouteInput,\n handlerPatched,\n PatchableServerRoute,\n HapiServerRouteInputMethod,\n HapiPluginInput,\n RegisterFunction,\n PatchableExtMethod,\n ServerExtDirectInput,\n} from './internal-types';\nimport {\n getRouteMetadata,\n getPluginName,\n isLifecycleExtType,\n isLifecycleExtEventObj,\n getExtMetadata,\n isDirectExtInput,\n isPatchableExtMethod,\n getPluginFromInput,\n} from './utils';\n\nconst PACKAGE_NAME = '@sentry/instrumentation-hapi';\n\n/** Hapi instrumentation for OpenTelemetry */\nexport class HapiInstrumentation extends InstrumentationBase {\n private _semconvStability: SemconvStability;\n\n constructor(config: InstrumentationConfig = {}) {\n super(PACKAGE_NAME, SDK_VERSION, config);\n this._semconvStability = semconvStabilityFromStr('http', process.env.OTEL_SEMCONV_STABILITY_OPT_IN);\n }\n\n protected init() {\n return new InstrumentationNodeModuleDefinition(\n HapiComponentName,\n ['>=17.0.0 <22'],\n (module: any) => {\n const moduleExports: typeof Hapi = module[Symbol.toStringTag] === 'Module' ? module.default : module;\n if (!isWrapped(moduleExports.server)) {\n this._wrap(moduleExports, 'server', this._getServerPatch.bind(this) as any);\n }\n\n if (!isWrapped(moduleExports.Server)) {\n this._wrap(moduleExports, 'Server', this._getServerPatch.bind(this) as any);\n }\n return moduleExports;\n },\n (module: any) => {\n const moduleExports: typeof Hapi = module[Symbol.toStringTag] === 'Module' ? module.default : module;\n this._massUnwrap([moduleExports], ['server', 'Server']);\n },\n );\n }\n\n /**\n * Patches the Hapi.server and Hapi.Server functions in order to instrument\n * the server.route, server.ext, and server.register functions via calls to the\n * @function _getServerRoutePatch, @function _getServerExtPatch, and\n * @function _getServerRegisterPatch functions\n * @param original - the original Hapi Server creation function\n */\n private _getServerPatch(original: (options?: Hapi.ServerOptions) => Hapi.Server) {\n const instrumentation: HapiInstrumentation = this;\n const self = this;\n return function server(this: Hapi.Server, opts?: Hapi.ServerOptions) {\n const newServer: Hapi.Server = original.apply(this, [opts]);\n\n self._wrap(newServer, 'route', originalRouter => {\n return instrumentation._getServerRoutePatch.bind(instrumentation)(originalRouter);\n });\n\n // Casting as any is necessary here due to multiple overloads on the Hapi.ext\n // function, which requires supporting a variety of different parameters\n // as extension inputs\n self._wrap(newServer, 'ext', originalExtHandler => {\n return instrumentation._getServerExtPatch.bind(instrumentation)(originalExtHandler as any);\n });\n\n // Casting as any is necessary here due to multiple overloads on the Hapi.Server.register\n // function, which requires supporting a variety of different types of Plugin inputs\n self._wrap(newServer, 'register', instrumentation._getServerRegisterPatch.bind(instrumentation) as any);\n return newServer;\n };\n }\n\n /**\n * Patches the plugin register function used by the Hapi Server. This function\n * goes through each plugin that is being registered and adds instrumentation\n * via a call to the @function _wrapRegisterHandler function.\n * @param {RegisterFunction<T>} original - the original register function which\n * registers each plugin on the server\n */\n private _getServerRegisterPatch<T>(original: RegisterFunction<T>): RegisterFunction<T> {\n const instrumentation: HapiInstrumentation = this;\n return function register(this: Hapi.Server, pluginInput: HapiPluginInput<T>, options?: Hapi.ServerRegisterOptions) {\n if (Array.isArray(pluginInput)) {\n for (const pluginObj of pluginInput) {\n const plugin = getPluginFromInput(pluginObj);\n instrumentation._wrapRegisterHandler(plugin);\n }\n } else {\n const plugin = getPluginFromInput(pluginInput);\n instrumentation._wrapRegisterHandler(plugin);\n }\n return original.apply(this, [pluginInput, options]);\n };\n }\n\n /**\n * Patches the Server.ext function which adds extension methods to the specified\n * point along the request lifecycle. This function accepts the full range of\n * accepted input into the standard Hapi `server.ext` function. For each extension,\n * it adds instrumentation to the handler via a call to the @function _wrapExtMethods\n * function.\n * @param original - the original ext function which adds the extension method to the server\n * @param {string} [pluginName] - if present, represents the name of the plugin responsible\n * for adding this server extension. Else, signifies that the extension was added directly\n */\n private _getServerExtPatch(original: (...args: unknown[]) => unknown, pluginName?: string) {\n const instrumentation: HapiInstrumentation = this;\n\n return function ext(this: ThisParameterType<typeof original>, ...args: Parameters<typeof original>) {\n if (Array.isArray(args[0])) {\n const eventsList: Hapi.ServerExtEventsObject[] | Hapi.ServerExtEventsRequestObject[] = args[0];\n for (let i = 0; i < eventsList.length; i++) {\n const eventObj = eventsList[i]!;\n if (isLifecycleExtType(eventObj.type)) {\n const lifecycleEventObj = eventObj as Hapi.ServerExtEventsRequestObject;\n const handler = instrumentation._wrapExtMethods(lifecycleEventObj.method, eventObj.type, pluginName);\n lifecycleEventObj.method = handler;\n eventsList[i] = lifecycleEventObj;\n }\n }\n return original.apply(this, args);\n } else if (isDirectExtInput(args)) {\n const extInput: ServerExtDirectInput = args;\n const method: PatchableExtMethod = extInput[1];\n const handler = instrumentation._wrapExtMethods(method, extInput[0], pluginName);\n return original.apply(this, [extInput[0], handler, extInput[2]]);\n } else if (isLifecycleExtEventObj(args[0])) {\n const lifecycleEventObj = args[0];\n const handler = instrumentation._wrapExtMethods(lifecycleEventObj.method, lifecycleEventObj.type, pluginName);\n lifecycleEventObj.method = handler;\n return original.call(this, lifecycleEventObj);\n }\n return original.apply(this, args);\n };\n }\n\n /**\n * Patches the Server.route function. This function accepts either one or an array\n * of Hapi.ServerRoute objects and adds instrumentation on each route via a call to\n * the @function _wrapRouteHandler function.\n * @param {HapiServerRouteInputMethod} original - the original route function which adds\n * the route to the server\n * @param {string} [pluginName] - if present, represents the name of the plugin responsible\n * for adding this server route. Else, signifies that the route was added directly\n */\n private _getServerRoutePatch(original: HapiServerRouteInputMethod, pluginName?: string) {\n const instrumentation: HapiInstrumentation = this;\n return function route(this: Hapi.Server, route: HapiServerRouteInput): void {\n if (Array.isArray(route)) {\n for (let i = 0; i < route.length; i++) {\n const newRoute = instrumentation._wrapRouteHandler.call(instrumentation, route[i]!, pluginName);\n route[i] = newRoute;\n }\n } else {\n route = instrumentation._wrapRouteHandler.call(instrumentation, route, pluginName);\n }\n return original.apply(this, [route]);\n };\n }\n\n /**\n * Wraps newly registered plugins to add instrumentation to the plugin's clone of\n * the original server. Specifically, wraps the server.route and server.ext functions\n * via calls to @function _getServerRoutePatch and @function _getServerExtPatch\n * @param {Hapi.Plugin<T>} plugin - the new plugin which is being instrumented\n */\n private _wrapRegisterHandler<T>(plugin: Hapi.Plugin<T>): void {\n const instrumentation: HapiInstrumentation = this;\n const pluginName = getPluginName(plugin);\n const oldRegister = plugin.register;\n const self = this;\n const newRegisterHandler = function (this: typeof plugin, server: Hapi.Server, options: T) {\n self._wrap(server, 'route', original => {\n return instrumentation._getServerRoutePatch.bind(instrumentation)(original, pluginName);\n });\n\n // Casting as any is necessary here due to multiple overloads on the Hapi.ext\n // function, which requires supporting a variety of different parameters\n // as extension inputs\n self._wrap(server, 'ext', originalExtHandler => {\n return instrumentation._getServerExtPatch.bind(instrumentation)(originalExtHandler as any, pluginName);\n });\n return oldRegister.call(this, server, options);\n };\n plugin.register = newRegisterHandler;\n }\n\n /**\n * Wraps request extension methods to add instrumentation to each new extension handler.\n * Patches each individual extension in order to create the\n * span and propagate context. It does not create spans when there is no parent span.\n * @param {PatchableExtMethod | PatchableExtMethod[]} method - the request extension\n * handler which is being instrumented\n * @param {Hapi.ServerRequestExtType} extPoint - the point in the Hapi request lifecycle\n * which this extension targets\n * @param {string} [pluginName] - if present, represents the name of the plugin responsible\n * for adding this server route. Else, signifies that the route was added directly\n */\n private _wrapExtMethods<T extends PatchableExtMethod | PatchableExtMethod[]>(\n method: T,\n extPoint: Hapi.ServerRequestExtType,\n pluginName?: string,\n ): T {\n const instrumentation: HapiInstrumentation = this;\n if (method instanceof Array) {\n for (let i = 0; i < method.length; i++) {\n method[i] = instrumentation._wrapExtMethods(method[i]!, extPoint) as PatchableExtMethod;\n }\n return method;\n } else if (isPatchableExtMethod(method)) {\n if (method[handlerPatched] === true) return method;\n method[handlerPatched] = true;\n\n const newHandler: PatchableExtMethod = async function (this: any, ...params: Parameters<Hapi.Lifecycle.Method>) {\n if (api.trace.getSpan(api.context.active()) === undefined) {\n return await method.apply(this, params);\n }\n const metadata = getExtMetadata(extPoint, pluginName, method.name);\n const span = instrumentation.tracer.startSpan(metadata.name, {\n attributes: metadata.attributes,\n });\n try {\n return await api.context.with<Parameters<Hapi.Lifecycle.Method>, Hapi.Lifecycle.Method>(\n api.trace.setSpan(api.context.active(), span),\n method,\n undefined,\n ...params,\n );\n } catch (err: any) {\n span.recordException(err);\n span.setStatus({\n code: api.SpanStatusCode.ERROR,\n message: err.message,\n });\n throw err;\n } finally {\n span.end();\n }\n };\n return newHandler as T;\n }\n return method;\n }\n\n /**\n * Patches each individual route handler method in order to create the\n * span and propagate context. It does not create spans when there is no parent span.\n * @param {PatchableServerRoute} route - the route handler which is being instrumented\n * @param {string} [pluginName] - if present, represents the name of the plugin responsible\n * for adding this server route. Else, signifies that the route was added directly\n */\n private _wrapRouteHandler(route: PatchableServerRoute, pluginName?: string): PatchableServerRoute {\n const instrumentation: HapiInstrumentation = this;\n if (route[handlerPatched] === true) return route;\n route[handlerPatched] = true;\n\n const wrapHandler: (oldHandler: Hapi.Lifecycle.Method) => Hapi.Lifecycle.Method = oldHandler => {\n return async function (this: any, ...params: Parameters<Hapi.Lifecycle.Method>) {\n if (api.trace.getSpan(api.context.active()) === undefined) {\n return await oldHandler.call(this, ...params);\n }\n setHttpServerSpanRouteAttribute(route.path);\n const metadata = getRouteMetadata(route, instrumentation._semconvStability, pluginName);\n const span = instrumentation.tracer.startSpan(metadata.name, {\n attributes: metadata.attributes,\n });\n try {\n return await api.context.with(api.trace.setSpan(api.context.active(), span), () =>\n oldHandler.call(this, ...params),\n );\n } catch (err: any) {\n span.recordException(err);\n span.setStatus({\n code: api.SpanStatusCode.ERROR,\n message: err.message,\n });\n throw err;\n } finally {\n span.end();\n }\n };\n };\n\n if (typeof route.handler === 'function') {\n route.handler = wrapHandler(route.handler as Hapi.Lifecycle.Method);\n } else if (typeof route.options === 'function') {\n const oldOptions = route.options;\n route.options = function (server) {\n const options = oldOptions(server);\n if (typeof options.handler === 'function') {\n options.handler = wrapHandler(options.handler as Hapi.Lifecycle.Method);\n }\n return options;\n };\n } else if (typeof route.options?.handler === 'function') {\n route.options.handler = wrapHandler(route.options.handler as Hapi.Lifecycle.Method);\n }\n return route;\n }\n}\n"],"names":["InstrumentationBase","SDK_VERSION","semconvStabilityFromStr","InstrumentationNodeModuleDefinition","HapiComponentName","isWrapped","getPluginFromInput","isLifecycleExtType","isDirectExtInput","isLifecycleExtEventObj","getPluginName","isPatchableExtMethod","handlerPatched","getExtMetadata","setHttpServerSpanRouteAttribute","getRouteMetadata"],"mappings":";;;;;;;;;AA0DA,MAAM,YAAA,GAAe,8BAAA;AAGd,MAAM,4BAA4BA,mCAAA,CAAoB;AAAA,EAG3D,WAAA,CAAY,MAAA,GAAgC,EAAC,EAAG;AAC9C,IAAA,KAAA,CAAM,YAAA,EAAcC,kBAAa,MAAM,CAAA;AACvC,IAAA,IAAA,CAAK,iBAAA,GAAoBC,uCAAA,CAAwB,MAAA,EAAQ,OAAA,CAAQ,IAAI,6BAA6B,CAAA;AAAA,EACpG;AAAA,EAEU,IAAA,GAAO;AACf,IAAA,OAAO,IAAIC,mDAAA;AAAA,MACTC,+BAAA;AAAA,MACA,CAAC,cAAc,CAAA;AAAA,MACf,CAAC,MAAA,KAAgB;AACf,QAAA,MAAM,gBAA6B,MAAA,CAAO,MAAA,CAAO,WAAW,CAAA,KAAM,QAAA,GAAW,OAAO,OAAA,GAAU,MAAA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,IAAW,OAAO,KAAA,CAAM,OAAA,KAAY,UAAA,EAAY;AAC9C,MAAA,MAAM,aAAa,KAAA,CAAM,OAAA;AACzB,MAAA,KAAA,CAAM,OAAA,GAAU,SAAU,MAAA,EAAQ;AAChC,QAAA,MAAM,OAAA,GAAU,WAAW,MAAM,CAAA;AACjC,QAAA,IAAI,OAAO,OAAA,CAAQ,OAAA,KAAY,UAAA,EAAY;AACzC,UAAA,OAAA,CAAQ,OAAA,GAAU,WAAA,CAAY,OAAA,CAAQ,OAAgC,CAAA;AAAA,QACxE;AACA,QAAA,OAAO,OAAA;AAAA,MACT,CAAA;AAAA,IACF,CAAA,MAAA,IAAW,OAAO,KAAA,CAAM,OAAA,EAAS,YAAY,UAAA,EAAY;AACvD,MAAA,KAAA,CAAM,OAAA,CAAQ,OAAA,GAAU,WAAA,CAAY,KAAA,CAAM,QAAQ,OAAgC,CAAA;AAAA,IACpF;AACA,IAAA,OAAO,KAAA;AAAA,EACT;AACF;;;;"}
1
+ {"version":3,"file":"instrumentation.js","sources":["../../../../../../src/integrations/tracing/hapi/vendored/instrumentation.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-hapi\n * - Upstream version: @opentelemetry/instrumentation-hapi@0.64.0\n * - Types vendored from @hapi/hapi as simplified interfaces\n * - Minor TypeScript strictness adjustments for this repository's compiler settings\n * - Span creation migrated to the @sentry/core API; op/origin folded into span creation\n */\n\nimport * as api from '@opentelemetry/api';\nimport { setHttpServerSpanRouteAttribute } from '../../../../utils/setHttpServerSpanRouteAttribute';\nimport type { InstrumentationConfig } from '@opentelemetry/instrumentation';\nimport { InstrumentationBase, InstrumentationNodeModuleDefinition, isWrapped } from '@opentelemetry/instrumentation';\n\nimport type * as Hapi from './hapi-types';\nimport { SDK_VERSION, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, startSpan } from '@sentry/core';\nimport { AttributeNames } from './enums/AttributeNames';\nimport {\n HapiComponentName,\n handlerPatched,\n type HapiServerRouteInput,\n type PatchableServerRoute,\n type HapiServerRouteInputMethod,\n type HapiPluginInput,\n type RegisterFunction,\n type PatchableExtMethod,\n type ServerExtDirectInput,\n} from './internal-types';\nimport {\n getRouteMetadata,\n getPluginName,\n isLifecycleExtType,\n isLifecycleExtEventObj,\n getExtMetadata,\n isDirectExtInput,\n isPatchableExtMethod,\n getPluginFromInput,\n} from './utils';\n\nconst PACKAGE_NAME = '@sentry/instrumentation-hapi';\n\n/** Hapi instrumentation for OpenTelemetry */\nexport class HapiInstrumentation extends InstrumentationBase {\n constructor(config: InstrumentationConfig = {}) {\n super(PACKAGE_NAME, SDK_VERSION, config);\n }\n\n protected init() {\n return new InstrumentationNodeModuleDefinition(\n HapiComponentName,\n ['>=17.0.0 <22'],\n (module: any) => {\n const moduleExports: typeof Hapi = module[Symbol.toStringTag] === 'Module' ? module.default : module;\n if (!isWrapped(moduleExports.server)) {\n this._wrap(moduleExports, 'server', this._getServerPatch.bind(this));\n }\n\n if (!isWrapped(moduleExports.Server)) {\n this._wrap(moduleExports, 'Server', this._getServerPatch.bind(this));\n }\n return moduleExports;\n },\n (module: any) => {\n const moduleExports: typeof Hapi = module[Symbol.toStringTag] === 'Module' ? module.default : module;\n this._massUnwrap([moduleExports], ['server', 'Server']);\n },\n );\n }\n\n /**\n * Patches the Hapi.server and Hapi.Server functions in order to instrument\n * the server.route, server.ext, and server.register functions via calls to the\n * @function _getServerRoutePatch, @function _getServerExtPatch, and\n * @function _getServerRegisterPatch functions\n * @param original - the original Hapi Server creation function\n */\n private _getServerPatch(original: (options?: Hapi.ServerOptions) => Hapi.Server) {\n const instrumentation: HapiInstrumentation = this;\n const self = this;\n return function server(this: Hapi.Server, opts?: Hapi.ServerOptions) {\n const newServer: Hapi.Server = original.apply(this, [opts]);\n\n self._wrap(newServer, 'route', originalRouter => {\n return instrumentation._getServerRoutePatch.bind(instrumentation)(originalRouter);\n });\n\n // Casting as any is necessary here due to multiple overloads on the Hapi.ext\n // function, which requires supporting a variety of different parameters\n // as extension inputs\n self._wrap(newServer, 'ext', originalExtHandler => {\n return instrumentation._getServerExtPatch.bind(instrumentation)(originalExtHandler as any);\n });\n\n // Casting as any is necessary here due to multiple overloads on the Hapi.Server.register\n // function, which requires supporting a variety of different types of Plugin inputs\n self._wrap(newServer, 'register', instrumentation._getServerRegisterPatch.bind(instrumentation));\n return newServer;\n };\n }\n\n /**\n * Patches the plugin register function used by the Hapi Server. This function\n * goes through each plugin that is being registered and adds instrumentation\n * via a call to the @function _wrapRegisterHandler function.\n * @param {RegisterFunction<T>} original - the original register function which\n * registers each plugin on the server\n */\n private _getServerRegisterPatch<T>(original: RegisterFunction<T>): RegisterFunction<T> {\n const instrumentation: HapiInstrumentation = this;\n return function register(this: Hapi.Server, pluginInput: HapiPluginInput<T>, options?: Hapi.ServerRegisterOptions) {\n if (Array.isArray(pluginInput)) {\n for (const pluginObj of pluginInput) {\n const plugin = getPluginFromInput(pluginObj);\n instrumentation._wrapRegisterHandler(plugin);\n }\n } else {\n const plugin = getPluginFromInput(pluginInput);\n instrumentation._wrapRegisterHandler(plugin);\n }\n return original.apply(this, [pluginInput, options]);\n };\n }\n\n /**\n * Patches the Server.ext function which adds extension methods to the specified\n * point along the request lifecycle. This function accepts the full range of\n * accepted input into the standard Hapi `server.ext` function. For each extension,\n * it adds instrumentation to the handler via a call to the @function _wrapExtMethods\n * function.\n * @param original - the original ext function which adds the extension method to the server\n * @param {string} [pluginName] - if present, represents the name of the plugin responsible\n * for adding this server extension. Else, signifies that the extension was added directly\n */\n private _getServerExtPatch(original: (...args: unknown[]) => unknown, pluginName?: string) {\n const instrumentation: HapiInstrumentation = this;\n\n return function ext(this: ThisParameterType<typeof original>, ...args: Parameters<typeof original>) {\n if (Array.isArray(args[0])) {\n const eventsList: Hapi.ServerExtEventsObject[] | Hapi.ServerExtEventsRequestObject[] = args[0];\n for (let i = 0; i < eventsList.length; i++) {\n const eventObj = eventsList[i]!;\n if (isLifecycleExtType(eventObj.type)) {\n const lifecycleEventObj = eventObj as Hapi.ServerExtEventsRequestObject;\n const handler = instrumentation._wrapExtMethods(lifecycleEventObj.method, eventObj.type, pluginName);\n lifecycleEventObj.method = handler;\n eventsList[i] = lifecycleEventObj;\n }\n }\n return original.apply(this, args);\n } else if (isDirectExtInput(args)) {\n const extInput: ServerExtDirectInput = args;\n const method: PatchableExtMethod = extInput[1];\n const handler = instrumentation._wrapExtMethods(method, extInput[0], pluginName);\n return original.apply(this, [extInput[0], handler, extInput[2]]);\n } else if (isLifecycleExtEventObj(args[0])) {\n const lifecycleEventObj = args[0];\n const handler = instrumentation._wrapExtMethods(lifecycleEventObj.method, lifecycleEventObj.type, pluginName);\n lifecycleEventObj.method = handler;\n return original.call(this, lifecycleEventObj);\n }\n return original.apply(this, args);\n };\n }\n\n /**\n * Patches the Server.route function. This function accepts either one or an array\n * of Hapi.ServerRoute objects and adds instrumentation on each route via a call to\n * the @function _wrapRouteHandler function.\n * @param {HapiServerRouteInputMethod} original - the original route function which adds\n * the route to the server\n * @param {string} [pluginName] - if present, represents the name of the plugin responsible\n * for adding this server route. Else, signifies that the route was added directly\n */\n private _getServerRoutePatch(original: HapiServerRouteInputMethod, pluginName?: string) {\n const instrumentation: HapiInstrumentation = this;\n return function route(this: Hapi.Server, route: HapiServerRouteInput): void {\n if (Array.isArray(route)) {\n for (let i = 0; i < route.length; i++) {\n const newRoute = instrumentation._wrapRouteHandler.call(instrumentation, route[i]!, pluginName);\n route[i] = newRoute;\n }\n } else {\n // oxlint-disable-next-line no-param-reassign\n route = instrumentation._wrapRouteHandler.call(instrumentation, route, pluginName);\n }\n return original.apply(this, [route]);\n };\n }\n\n /**\n * Wraps newly registered plugins to add instrumentation to the plugin's clone of\n * the original server. Specifically, wraps the server.route and server.ext functions\n * via calls to @function _getServerRoutePatch and @function _getServerExtPatch\n * @param {Hapi.Plugin<T>} plugin - the new plugin which is being instrumented\n */\n private _wrapRegisterHandler<T>(plugin: Hapi.Plugin<T>): void {\n const instrumentation: HapiInstrumentation = this;\n const pluginName = getPluginName(plugin);\n const oldRegister = plugin.register;\n const self = this;\n const newRegisterHandler = function (this: typeof plugin, server: Hapi.Server, options: T) {\n self._wrap(server, 'route', original => {\n return instrumentation._getServerRoutePatch.bind(instrumentation)(original, pluginName);\n });\n\n // Casting as any is necessary here due to multiple overloads on the Hapi.ext\n // function, which requires supporting a variety of different parameters\n // as extension inputs\n self._wrap(server, 'ext', originalExtHandler => {\n return instrumentation._getServerExtPatch.bind(instrumentation)(originalExtHandler as any, pluginName);\n });\n return oldRegister.call(this, server, options);\n };\n plugin.register = newRegisterHandler;\n }\n\n /**\n * Wraps request extension methods to add instrumentation to each new extension handler.\n * Patches each individual extension in order to create the\n * span and propagate context. It does not create spans when there is no parent span.\n * @param {PatchableExtMethod | PatchableExtMethod[]} method - the request extension\n * handler which is being instrumented\n * @param {Hapi.ServerRequestExtType} extPoint - the point in the Hapi request lifecycle\n * which this extension targets\n * @param {string} [pluginName] - if present, represents the name of the plugin responsible\n * for adding this server route. Else, signifies that the route was added directly\n */\n private _wrapExtMethods<T extends PatchableExtMethod | PatchableExtMethod[]>(\n method: T,\n extPoint: Hapi.ServerRequestExtType,\n pluginName?: string,\n ): T {\n const instrumentation: HapiInstrumentation = this;\n if (method instanceof Array) {\n for (let i = 0; i < method.length; i++) {\n method[i] = instrumentation._wrapExtMethods(method[i]!, extPoint);\n }\n return method;\n } else if (isPatchableExtMethod(method)) {\n if (method[handlerPatched] === true) return method;\n method[handlerPatched] = true;\n\n const newHandler: PatchableExtMethod = function (this: any, ...params: Parameters<Hapi.Lifecycle.Method>) {\n if (api.trace.getSpan(api.context.active()) === undefined) {\n return method.apply(this, params);\n }\n const metadata = getExtMetadata(extPoint, pluginName, method.name);\n return startSpan(\n {\n name: metadata.name,\n op: `${metadata.attributes[AttributeNames.HAPI_TYPE]}.hapi`,\n attributes: {\n ...metadata.attributes,\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.otel.hapi',\n },\n },\n () => method.apply(undefined, params),\n );\n };\n return newHandler as T;\n }\n return method;\n }\n\n /**\n * Patches each individual route handler method in order to create the\n * span and propagate context. It does not create spans when there is no parent span.\n * @param {PatchableServerRoute} route - the route handler which is being instrumented\n * @param {string} [pluginName] - if present, represents the name of the plugin responsible\n * for adding this server route. Else, signifies that the route was added directly\n */\n private _wrapRouteHandler(route: PatchableServerRoute, pluginName?: string): PatchableServerRoute {\n if (route[handlerPatched] === true) return route;\n route[handlerPatched] = true;\n\n const wrapHandler: (oldHandler: Hapi.Lifecycle.Method) => Hapi.Lifecycle.Method = oldHandler => {\n return function (this: any, ...params: Parameters<Hapi.Lifecycle.Method>) {\n if (api.trace.getSpan(api.context.active()) === undefined) {\n return oldHandler.call(this, ...params);\n }\n setHttpServerSpanRouteAttribute(route.path);\n const metadata = getRouteMetadata(route, pluginName);\n return startSpan(\n {\n name: metadata.name,\n op: `${metadata.attributes[AttributeNames.HAPI_TYPE]}.hapi`,\n attributes: {\n ...metadata.attributes,\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.otel.hapi',\n },\n },\n () => oldHandler.call(this, ...params),\n );\n };\n };\n\n if (typeof route.handler === 'function') {\n route.handler = wrapHandler(route.handler as Hapi.Lifecycle.Method);\n } else if (typeof route.options === 'function') {\n const oldOptions = route.options;\n route.options = function (server) {\n const options = oldOptions(server);\n if (typeof options.handler === 'function') {\n options.handler = wrapHandler(options.handler as Hapi.Lifecycle.Method);\n }\n return options;\n };\n } else if (typeof route.options?.handler === 'function') {\n route.options.handler = wrapHandler(route.options.handler as Hapi.Lifecycle.Method);\n }\n return route;\n }\n}\n"],"names":["InstrumentationBase","SDK_VERSION","InstrumentationNodeModuleDefinition","HapiComponentName","isWrapped","getPluginFromInput","isLifecycleExtType","isDirectExtInput","isLifecycleExtEventObj","getPluginName","isPatchableExtMethod","handlerPatched","getExtMetadata","startSpan","AttributeNames","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","setHttpServerSpanRouteAttribute","getRouteMetadata"],"mappings":";;;;;;;;;;AA0CA,MAAM,YAAA,GAAe,8BAAA;AAGd,MAAM,4BAA4BA,mCAAA,CAAoB;AAAA,EAC3D,WAAA,CAAY,MAAA,GAAgC,EAAC,EAAG;AAC9C,IAAA,KAAA,CAAM,YAAA,EAAcC,kBAAa,MAAM,CAAA;AAAA,EACzC;AAAA,EAEU,IAAA,GAAO;AACf,IAAA,OAAO,IAAIC,mDAAA;AAAA,MACTC,+BAAA;AAAA,MACA,CAAC,cAAc,CAAA;AAAA,MACf,CAAC,MAAA,KAAgB;AACf,QAAA,MAAM,gBAA6B,MAAA,CAAO,MAAA,CAAO,WAAW,CAAA,KAAM,QAAA,GAAW,OAAO,OAAA,GAAU,MAAA;AAC9F,QAAA,IAAI,CAACC,yBAAA,CAAU,aAAA,CAAc,MAAM,CAAA,EAAG;AACpC,UAAA,IAAA,CAAK,MAAM,aAAA,EAAe,QAAA,EAAU,KAAK,eAAA,CAAgB,IAAA,CAAK,IAAI,CAAC,CAAA;AAAA,QACrE;AAEA,QAAA,IAAI,CAACA,yBAAA,CAAU,aAAA,CAAc,MAAM,CAAA,EAAG;AACpC,UAAA,IAAA,CAAK,MAAM,aAAA,EAAe,QAAA,EAAU,KAAK,eAAA,CAAgB,IAAA,CAAK,IAAI,CAAC,CAAA;AAAA,QACrE;AACA,QAAA,OAAO,aAAA;AAAA,MACT,CAAA;AAAA,MACA,CAAC,MAAA,KAAgB;AACf,QAAA,MAAM,gBAA6B,MAAA,CAAO,MAAA,CAAO,WAAW,CAAA,KAAM,QAAA,GAAW,OAAO,OAAA,GAAU,MAAA;AAC9F,QAAA,IAAA,CAAK,YAAY,CAAC,aAAa,GAAG,CAAC,QAAA,EAAU,QAAQ,CAAC,CAAA;AAAA,MACxD;AA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AAA,KAAA,CAAM,OAAA,GAAU,SAAU,MAAA,EAAQ;AAChC,QAAA,MAAM,OAAA,GAAU,WAAW,MAAM,CAAA;AACjC,QAAA,IAAI,OAAO,OAAA,CAAQ,OAAA,KAAY,UAAA,EAAY;AACzC,UAAA,OAAA,CAAQ,OAAA,GAAU,WAAA,CAAY,OAAA,CAAQ,OAAgC,CAAA;AAAA,QACxE;AACA,QAAA,OAAO,OAAA;AAAA,MACT,CAAA;AAAA,IACF,CAAA,MAAA,IAAW,OAAO,KAAA,CAAM,OAAA,EAAS,YAAY,UAAA,EAAY;AACvD,MAAA,KAAA,CAAM,OAAA,CAAQ,OAAA,GAAU,WAAA,CAAY,KAAA,CAAM,QAAQ,OAAgC,CAAA;AAAA,IACpF;AACA,IAAA,OAAO,KAAA;AAAA,EACT;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"internal-types.js","sources":["../../../../../../src/integrations/tracing/hapi/vendored/internal-types.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-hapi\n * - Upstream version: @opentelemetry/instrumentation-hapi@0.64.0\n * - Types vendored from @hapi/hapi as simplified interfaces\n */\n/* eslint-disable */\n\nimport type * as Hapi from './hapi-types';\n\nexport const HapiComponentName = '@hapi/hapi';\n\n/**\n * This symbol is used to mark a Hapi route handler or server extension handler as\n * already patched, since its possible to use these handlers multiple times\n * i.e. when allowing multiple versions of one plugin, or when registering a plugin\n * multiple times on different servers.\n */\nexport const handlerPatched: unique symbol = Symbol('hapi-handler-patched');\n\nexport type HapiServerRouteInputMethod = (route: HapiServerRouteInput) => void;\n\nexport type HapiServerRouteInput = PatchableServerRoute | PatchableServerRoute[];\n\nexport type PatchableServerRoute = Hapi.ServerRoute<any> & {\n [handlerPatched]?: boolean;\n};\n\nexport type HapiPluginObject<T> = Hapi.ServerRegisterPluginObject<T>;\n\nexport type HapiPluginInput<T> = HapiPluginObject<T> | Array<HapiPluginObject<T>>;\n\nexport type RegisterFunction<T> = (plugin: HapiPluginInput<T>, options?: Hapi.ServerRegisterOptions) => Promise<void>;\n\nexport type PatchableExtMethod = Hapi.Lifecycle.Method & {\n [handlerPatched]?: boolean;\n};\n\nexport type ServerExtDirectInput = [\n Hapi.ServerRequestExtType,\n Hapi.Lifecycle.Method,\n (Hapi.ServerExtOptions | undefined)?,\n];\n\nexport const HapiLayerType = {\n ROUTER: 'router',\n PLUGIN: 'plugin',\n EXT: 'server.ext',\n};\n\nexport const HapiLifecycleMethodNames = new Set([\n 'onPreAuth',\n 'onCredentials',\n 'onPostAuth',\n 'onPreHandler',\n 'onPostHandler',\n 'onPreResponse',\n 'onRequest',\n]);\n"],"names":[],"mappings":";;AAwBO,MAAM,iBAAA,GAAoB;AAQ1B,MAAM,cAAA,0BAAuC,sBAAsB;AA0BnE,MAAM,aAAA,GAAgB;AAAA,EAC3B,MAAA,EAAQ,QAAA;AAAA,EACR,MAAA,EAAQ,QAAA;AAAA,EACR,GAAA,EAAK;AACP;AAEO,MAAM,wBAAA,uBAA+B,GAAA,CAAI;AAAA,EAC9C,WAAA;AAAA,EACA,eAAA;AAAA,EACA,YAAA;AAAA,EACA,cAAA;AAAA,EACA,eAAA;AAAA,EACA,eAAA;AAAA,EACA;AACF,CAAC;;;;;;;"}
1
+ {"version":3,"file":"internal-types.js","sources":["../../../../../../src/integrations/tracing/hapi/vendored/internal-types.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-hapi\n * - Upstream version: @opentelemetry/instrumentation-hapi@0.64.0\n * - Types vendored from @hapi/hapi as simplified interfaces\n */\n/* eslint-disable */\n\nimport type * as Hapi from './hapi-types';\n\nexport const HapiComponentName = '@hapi/hapi';\n\n/**\n * This symbol is used to mark a Hapi route handler or server extension handler as\n * already patched, since its possible to use these handlers multiple times\n * i.e. when allowing multiple versions of one plugin, or when registering a plugin\n * multiple times on different servers.\n */\nexport const handlerPatched: unique symbol = Symbol('hapi-handler-patched');\n\nexport type HapiServerRouteInputMethod = (route: HapiServerRouteInput) => void;\n\nexport type HapiServerRouteInput = PatchableServerRoute | PatchableServerRoute[];\n\nexport type PatchableServerRoute = Hapi.ServerRoute<any> & {\n [handlerPatched]?: boolean;\n};\n\nexport type HapiPluginObject<T> = Hapi.ServerRegisterPluginObject<T>;\n\nexport type HapiPluginInput<T> = HapiPluginObject<T> | Array<HapiPluginObject<T>>;\n\nexport type RegisterFunction<T> = (plugin: HapiPluginInput<T>, options?: Hapi.ServerRegisterOptions) => Promise<void>;\n\nexport type PatchableExtMethod = Hapi.Lifecycle.Method & {\n [handlerPatched]?: boolean;\n};\n\nexport type ServerExtDirectInput = [\n Hapi.ServerRequestExtType,\n Hapi.Lifecycle.Method,\n (Hapi.ServerExtOptions | undefined)?,\n];\n\nexport const HapiLayerType = {\n ROUTER: 'router',\n PLUGIN: 'plugin',\n EXT: 'server.ext',\n};\n\nexport const HapiLifecycleMethodNames = new Set([\n 'onPreAuth',\n 'onCredentials',\n 'onPostAuth',\n 'onPreHandler',\n 'onPostHandler',\n 'onPreResponse',\n 'onRequest',\n]);\n"],"names":[],"mappings":";;AAaO,MAAM,iBAAA,GAAoB;AAQ1B,MAAM,cAAA,0BAAuC,sBAAsB;AA0BnE,MAAM,aAAA,GAAgB;AAAA,EAC3B,MAAA,EAAQ,QAAA;AAAA,EACR,MAAA,EAAQ,QAAA;AAAA,EACR,GAAA,EAAK;AACP;AAEO,MAAM,wBAAA,uBAA+B,GAAA,CAAI;AAAA,EAC9C,WAAA;AAAA,EACA,eAAA;AAAA,EACA,YAAA;AAAA,EACA,cAAA;AAAA,EACA,eAAA;AAAA,EACA,eAAA;AAAA,EACA;AACF,CAAC;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"semconv.js","sources":["../../../../../../src/integrations/tracing/hapi/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-hapi\n * - Upstream version: @opentelemetry/instrumentation-hapi@0.64.0\n */\n/* eslint-disable */\n\n/**\n * Deprecated, use `http.request.method` instead.\n *\n * @example GET\n * @example POST\n * @example HEAD\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 `http.request.method`.\n */\nexport const ATTR_HTTP_METHOD = 'http.method' as const;\n"],"names":[],"mappings":";;AAgCO,MAAM,gBAAA,GAAmB;;;;"}
1
+ {"version":3,"file":"semconv.js","sources":["../../../../../../src/integrations/tracing/hapi/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-hapi\n * - Upstream version: @opentelemetry/instrumentation-hapi@0.64.0\n */\n/* eslint-disable */\n\n/**\n * Deprecated, use `http.request.method` instead.\n *\n * @example GET\n * @example POST\n * @example HEAD\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 `http.request.method`.\n */\nexport const ATTR_HTTP_METHOD = 'http.method' as const;\n"],"names":[],"mappings":";;AAqBO,MAAM,gBAAA,GAAmB;;;;"}
@@ -4,7 +4,6 @@ const semanticConventions = require('@opentelemetry/semantic-conventions');
4
4
  const semconv = require('./semconv.js');
5
5
  const internalTypes = require('./internal-types.js');
6
6
  const AttributeNames = require('./enums/AttributeNames.js');
7
- const instrumentation = require('@opentelemetry/instrumentation');
8
7
 
9
8
  function getPluginName(plugin) {
10
9
  if (plugin.name) {
@@ -26,16 +25,12 @@ const isDirectExtInput = (variableToCheck) => {
26
25
  const isPatchableExtMethod = (variableToCheck) => {
27
26
  return !Array.isArray(variableToCheck);
28
27
  };
29
- const getRouteMetadata = (route, semconvStability, pluginName) => {
28
+ const getRouteMetadata = (route, pluginName) => {
30
29
  const attributes = {
31
- [semanticConventions.ATTR_HTTP_ROUTE]: route.path
30
+ [semanticConventions.ATTR_HTTP_ROUTE]: route.path,
31
+ // eslint-disable-next-line typescript/no-deprecated
32
+ [semconv.ATTR_HTTP_METHOD]: route.method
32
33
  };
33
- if (semconvStability & instrumentation.SemconvStability.OLD) {
34
- attributes[semconv.ATTR_HTTP_METHOD] = route.method;
35
- }
36
- if (semconvStability & instrumentation.SemconvStability.STABLE) {
37
- attributes[semanticConventions.ATTR_HTTP_REQUEST_METHOD] = route.method;
38
- }
39
34
  let name;
40
35
  if (pluginName) {
41
36
  attributes[AttributeNames.AttributeNames.HAPI_TYPE] = internalTypes.HapiLayerType.PLUGIN;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["../../../../../../src/integrations/tracing/hapi/vendored/utils.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-hapi\n * - Upstream version: @opentelemetry/instrumentation-hapi@0.64.0\n * - Types vendored from @hapi/hapi as simplified interfaces\n */\n/* eslint-disable */\n\nimport { Attributes } from '@opentelemetry/api';\nimport { ATTR_HTTP_ROUTE, ATTR_HTTP_REQUEST_METHOD } from '@opentelemetry/semantic-conventions';\nimport { ATTR_HTTP_METHOD } from './semconv';\nimport type * as Hapi from './hapi-types';\nimport {\n HapiLayerType,\n HapiLifecycleMethodNames,\n HapiPluginObject,\n PatchableExtMethod,\n ServerExtDirectInput,\n} from './internal-types';\nimport { AttributeNames } from './enums/AttributeNames';\nimport { SemconvStability } from '@opentelemetry/instrumentation';\n\nexport function getPluginName<T>(plugin: Hapi.Plugin<T>): string {\n if ((plugin as Hapi.PluginNameVersion).name) {\n return (plugin as Hapi.PluginNameVersion).name;\n } else {\n return (plugin as Hapi.PluginPackage).pkg.name;\n }\n}\n\nexport const isLifecycleExtType = (variableToCheck: unknown): variableToCheck is Hapi.ServerRequestExtType => {\n return typeof variableToCheck === 'string' && HapiLifecycleMethodNames.has(variableToCheck);\n};\n\nexport const isLifecycleExtEventObj = (\n variableToCheck: unknown,\n): variableToCheck is Hapi.ServerExtEventsRequestObject => {\n const event = (variableToCheck as Hapi.ServerExtEventsRequestObject)?.type;\n return event !== undefined && isLifecycleExtType(event);\n};\n\nexport const isDirectExtInput = (variableToCheck: unknown): variableToCheck is ServerExtDirectInput => {\n return (\n Array.isArray(variableToCheck) &&\n variableToCheck.length <= 3 &&\n isLifecycleExtType(variableToCheck[0]) &&\n typeof variableToCheck[1] === 'function'\n );\n};\n\nexport const isPatchableExtMethod = (\n variableToCheck: PatchableExtMethod | PatchableExtMethod[],\n): variableToCheck is PatchableExtMethod => {\n return !Array.isArray(variableToCheck);\n};\n\nexport const getRouteMetadata = (\n route: Hapi.ServerRoute,\n semconvStability: SemconvStability,\n pluginName?: string,\n): {\n attributes: Attributes;\n name: string;\n} => {\n const attributes: Attributes = {\n [ATTR_HTTP_ROUTE]: route.path,\n };\n if (semconvStability & SemconvStability.OLD) {\n attributes[ATTR_HTTP_METHOD] = route.method;\n }\n if (semconvStability & SemconvStability.STABLE) {\n // Note: This currently does *not* normalize the method name to uppercase\n // and conditionally include `http.request.method.original` as described\n // at https://opentelemetry.io/docs/specs/semconv/http/http-spans/\n // These attributes are for a *hapi* span, and not the parent HTTP span,\n // so the HTTP span guidance doesn't strictly apply.\n attributes[ATTR_HTTP_REQUEST_METHOD] = route.method;\n }\n\n let name;\n if (pluginName) {\n attributes[AttributeNames.HAPI_TYPE] = HapiLayerType.PLUGIN;\n attributes[AttributeNames.PLUGIN_NAME] = pluginName;\n name = `${pluginName}: route - ${route.path}`;\n } else {\n attributes[AttributeNames.HAPI_TYPE] = HapiLayerType.ROUTER;\n name = `route - ${route.path}`;\n }\n\n return { attributes, name };\n};\n\nexport const getExtMetadata = (\n extPoint: Hapi.ServerRequestExtType,\n pluginName?: string,\n methodName?: string,\n): {\n attributes: Attributes;\n name: string;\n} => {\n let baseName = `ext - ${extPoint}`;\n if (methodName && methodName !== 'method') {\n // method is the default name for the extension in the ServerExtEventsObject format.\n baseName = `ext - ${extPoint} - ${methodName}`;\n }\n if (pluginName) {\n return {\n attributes: {\n [AttributeNames.EXT_TYPE]: extPoint,\n [AttributeNames.HAPI_TYPE]: HapiLayerType.EXT,\n [AttributeNames.PLUGIN_NAME]: pluginName,\n },\n name: `${pluginName}: ${baseName}`,\n };\n }\n return {\n attributes: {\n [AttributeNames.EXT_TYPE]: extPoint,\n [AttributeNames.HAPI_TYPE]: HapiLayerType.EXT,\n },\n name: baseName,\n };\n};\n\nexport const getPluginFromInput = <T>(pluginObj: HapiPluginObject<T>): Hapi.Plugin<T, void> => {\n if ('plugin' in pluginObj) {\n if ('plugin' in pluginObj.plugin) {\n return pluginObj.plugin.plugin;\n }\n return pluginObj.plugin;\n }\n return pluginObj;\n};\n"],"names":["HapiLifecycleMethodNames","ATTR_HTTP_ROUTE","SemconvStability","ATTR_HTTP_METHOD","ATTR_HTTP_REQUEST_METHOD","AttributeNames","HapiLayerType"],"mappings":";;;;;;;;AAoCO,SAAS,cAAiB,MAAA,EAAgC;AAC/D,EAAA,IAAK,OAAkC,IAAA,EAAM;AAC3C,IAAA,OAAQ,MAAA,CAAkC,IAAA;AAAA,EAC5C,CAAA,MAAO;AACL,IAAA,OAAQ,OAA8B,GAAA,CAAI,IAAA;AAAA,EAC5C;AACF;AAEO,MAAM,kBAAA,GAAqB,CAAC,eAAA,KAA2E;AAC5G,EAAA,OAAO,OAAO,eAAA,KAAoB,QAAA,IAAYA,sCAAA,CAAyB,IAAI,eAAe,CAAA;AAC5F;AAEO,MAAM,sBAAA,GAAyB,CACpC,eAAA,KACyD;AACzD,EAAA,MAAM,QAAS,eAAA,EAAuD,IAAA;AACtE,EAAA,OAAO,KAAA,KAAU,MAAA,IAAa,kBAAA,CAAmB,KAAK,CAAA;AACxD;AAEO,MAAM,gBAAA,GAAmB,CAAC,eAAA,KAAsE;AACrG,EAAA,OACE,KAAA,CAAM,OAAA,CAAQ,eAAe,CAAA,IAC7B,gBAAgB,MAAA,IAAU,CAAA,IAC1B,kBAAA,CAAmB,eAAA,CAAgB,CAAC,CAAC,CAAA,IACrC,OAAO,eA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AAA,EAAU;AAEzC,IAAA,QAAA,GAAW,CAAA,MAAA,EAAS,QAAQ,CAAA,GAAA,EAAM,UAAU,CAAA,CAAA;AAAA,EAC9C;AACA,EAAA,IAAI,UAAA,EAAY;AACd,IAAA,OAAO;AAAA,MACL,UAAA,EAAY;AAAA,QACV,CAACD,6BAAA,CAAe,QAAQ,GAAG,QAAA;AAAA,QAC3B,CAACA,6BAAA,CAAe,SAAS,GAAGC,2BAAA,CAAc,GAAA;AAAA,QAC1C,CAACD,6BAAA,CAAe,WAAW,GAAG;AAAA,OAChC;AAAA,MACA,IAAA,EAAM,CAAA,EAAG,UAAU,CAAA,EAAA,EAAK,QAAQ,CAAA;AAAA,KAClC;AAAA,EACF;AACA,EAAA,OAAO;AAAA,IACL,UAAA,EAAY;AAAA,MACV,CAACA,6BAAA,CAAe,QAAQ,GAAG,QAAA;AAAA,MAC3B,CAACA,6BAAA,CAAe,SAAS,GAAGC,2BAAA,CAAc;AAAA,KAC5C;AAAA,IACA,IAAA,EAAM;AAAA,GACR;AACF;AAEO,MAAM,kBAAA,GAAqB,CAAI,SAAA,KAAyD;AAC7F,EAAA,IAAI,YAAY,SAAA,EAAW;AACzB,IAAA,IAAI,QAAA,IAAY,UAAU,MAAA,EAAQ;AAChC,MAAA,OAAO,UAAU,MAAA,CAAO,MAAA;AAAA,IAC1B;AACA,IAAA,OAAO,SAAA,CAAU,MAAA;AAAA,EACnB;AACA,EAAA,OAAO,SAAA;AACT;;;;;;;;;;;"}
1
+ {"version":3,"file":"utils.js","sources":["../../../../../../src/integrations/tracing/hapi/vendored/utils.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-hapi\n * - Upstream version: @opentelemetry/instrumentation-hapi@0.64.0\n * - Types vendored from @hapi/hapi as simplified interfaces\n */\n\nimport type { Attributes } from '@opentelemetry/api';\nimport { ATTR_HTTP_ROUTE } from '@opentelemetry/semantic-conventions';\nimport { ATTR_HTTP_METHOD } from './semconv';\nimport type * as Hapi from './hapi-types';\nimport {\n HapiLayerType,\n HapiLifecycleMethodNames,\n type HapiPluginObject,\n type PatchableExtMethod,\n type ServerExtDirectInput,\n} from './internal-types';\nimport { AttributeNames } from './enums/AttributeNames';\n\nexport function getPluginName<T>(plugin: Hapi.Plugin<T>): string {\n if ((plugin as Hapi.PluginNameVersion).name) {\n return (plugin as Hapi.PluginNameVersion).name;\n } else {\n return (plugin as Hapi.PluginPackage).pkg.name;\n }\n}\n\nexport const isLifecycleExtType = (variableToCheck: unknown): variableToCheck is Hapi.ServerRequestExtType => {\n return typeof variableToCheck === 'string' && HapiLifecycleMethodNames.has(variableToCheck);\n};\n\nexport const isLifecycleExtEventObj = (\n variableToCheck: unknown,\n): variableToCheck is Hapi.ServerExtEventsRequestObject => {\n const event = (variableToCheck as Hapi.ServerExtEventsRequestObject)?.type;\n return event !== undefined && isLifecycleExtType(event);\n};\n\nexport const isDirectExtInput = (variableToCheck: unknown): variableToCheck is ServerExtDirectInput => {\n return (\n Array.isArray(variableToCheck) &&\n variableToCheck.length <= 3 &&\n isLifecycleExtType(variableToCheck[0]) &&\n typeof variableToCheck[1] === 'function'\n );\n};\n\nexport const isPatchableExtMethod = (\n variableToCheck: PatchableExtMethod | PatchableExtMethod[],\n): variableToCheck is PatchableExtMethod => {\n return !Array.isArray(variableToCheck);\n};\n\nexport const getRouteMetadata = (\n route: Hapi.ServerRoute,\n pluginName?: string,\n): {\n attributes: Attributes;\n name: string;\n} => {\n const attributes: Attributes = {\n [ATTR_HTTP_ROUTE]: route.path,\n // eslint-disable-next-line typescript/no-deprecated\n [ATTR_HTTP_METHOD]: route.method,\n };\n\n let name;\n if (pluginName) {\n attributes[AttributeNames.HAPI_TYPE] = HapiLayerType.PLUGIN;\n attributes[AttributeNames.PLUGIN_NAME] = pluginName;\n name = `${pluginName}: route - ${route.path}`;\n } else {\n attributes[AttributeNames.HAPI_TYPE] = HapiLayerType.ROUTER;\n name = `route - ${route.path}`;\n }\n\n return { attributes, name };\n};\n\nexport const getExtMetadata = (\n extPoint: Hapi.ServerRequestExtType,\n pluginName?: string,\n methodName?: string,\n): {\n attributes: Attributes;\n name: string;\n} => {\n let baseName = `ext - ${extPoint}`;\n if (methodName && methodName !== 'method') {\n // method is the default name for the extension in the ServerExtEventsObject format.\n baseName = `ext - ${extPoint} - ${methodName}`;\n }\n if (pluginName) {\n return {\n attributes: {\n [AttributeNames.EXT_TYPE]: extPoint,\n [AttributeNames.HAPI_TYPE]: HapiLayerType.EXT,\n [AttributeNames.PLUGIN_NAME]: pluginName,\n },\n name: `${pluginName}: ${baseName}`,\n };\n }\n return {\n attributes: {\n [AttributeNames.EXT_TYPE]: extPoint,\n [AttributeNames.HAPI_TYPE]: HapiLayerType.EXT,\n },\n name: baseName,\n };\n};\n\nexport const getPluginFromInput = <T>(pluginObj: HapiPluginObject<T>): Hapi.Plugin<T, void> => {\n if ('plugin' in pluginObj) {\n if ('plugin' in pluginObj.plugin) {\n return pluginObj.plugin.plugin;\n }\n return pluginObj.plugin;\n }\n return pluginObj;\n};\n"],"names":["HapiLifecycleMethodNames","ATTR_HTTP_ROUTE","ATTR_HTTP_METHOD","AttributeNames","HapiLayerType"],"mappings":";;;;;;;AAuBO,SAAS,cAAiB,MAAA,EAAgC;AAC/D,EAAA,IAAK,OAAkC,IAAA,EAAM;AAC3C,IAAA,OAAQ,MAAA,CAAkC,IAAA;AAAA,EAC5C,CAAA,MAAO;AACL,IAAA,OAAQ,OAA8B,GAAA,CAAI,IAAA;AAAA,EAC5C;AACF;AAEO,MAAM,kBAAA,GAAqB,CAAC,eAAA,KAA2E;AAC5G,EAAA,OAAO,OAAO,eAAA,KAAoB,QAAA,IAAYA,sCAAA,CAAyB,IAAI,eAAe,CAAA;AAC5F;AAEO,MAAM,sBAAA,GAAyB,C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AC5B,QAAA,EACA,UAAA,EACA,UAAA,KAIG;AACH,EAAA,IAAI,QAAA,GAAW,SAAS,QAAQ,CAAA,CAAA;AAChC,EAAA,IAAI,UAAA,IAAc,eAAe,QAAA,EAAU;AAEzC,IAAA,QAAA,GAAW,CAAA,MAAA,EAAS,QAAQ,CAAA,GAAA,EAAM,UAAU,CAAA,CAAA;AAAA,EAC9C;AACA,EAAA,IAAI,UAAA,EAAY;AACd,IAAA,OAAO;AAAA,MACL,UAAA,EAAY;AAAA,QACV,CAACD,6BAAA,CAAe,QAAQ,GAAG,QAAA;AAAA,QAC3B,CAACA,6BAAA,CAAe,SAAS,GAAGC,2BAAA,CAAc,GAAA;AAAA,QAC1C,CAACD,6BAAA,CAAe,WAAW,GAAG;AAAA,OAChC;AAAA,MACA,IAAA,EAAM,CAAA,EAAG,UAAU,CAAA,EAAA,EAAK,QAAQ,CAAA;AAAA,KAClC;AAAA,EACF;AACA,EAAA,OAAO;AAAA,IACL,UAAA,EAAY;AAAA,MACV,CAACA,6BAAA,CAAe,QAAQ,GAAG,QAAA;AAAA,MAC3B,CAACA,6BAAA,CAAe,SAAS,GAAGC,2BAAA,CAAc;AAAA,KAC5C;AAAA,IACA,IAAA,EAAM;AAAA,GACR;AACF;AAEO,MAAM,kBAAA,GAAqB,CAAI,SAAA,KAAyD;AAC7F,EAAA,IAAI,YAAY,SAAA,EAAW;AACzB,IAAA,IAAI,QAAA,IAAY,UAAU,MAAA,EAAQ;AAChC,MAAA,OAAO,UAAU,MAAA,CAAO,MAAA;AAAA,IAC1B;AACA,IAAA,OAAO,SAAA,CAAU,MAAA;AAAA,EACnB;AACA,EAAA,OAAO,SAAA;AACT;;;;;;;;;;;"}
@@ -34,6 +34,7 @@ function getAutoPerformanceIntegrations() {
34
34
  express.expressIntegration(),
35
35
  index$1.fastifyIntegration(),
36
36
  index$c.graphqlIntegration(),
37
+ // eslint-disable-next-line typescript/no-deprecated
37
38
  index$3.honoIntegration(),
38
39
  index$7.mongoIntegration(),
39
40
  index$8.mongooseIntegration(),
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/integrations/tracing/index.ts"],"sourcesContent":["import type { Integration } from '@sentry/core';\nimport { instrumentSentryHttp } from '../http';\nimport { amqplibIntegration, instrumentAmqplib } from './amqplib';\nimport { anthropicAIIntegration, instrumentAnthropicAi } from './anthropic-ai';\nimport { connectIntegration, instrumentConnect } from './connect';\nimport { expressIntegration, instrumentExpress } from './express';\nimport { fastifyIntegration, instrumentFastify, instrumentFastifyV3 } from './fastify';\nimport { firebaseIntegration, instrumentFirebase } from './firebase';\nimport { genericPoolIntegration, instrumentGenericPool } from './genericPool';\nimport { googleGenAIIntegration, instrumentGoogleGenAI } from './google-genai';\nimport { graphqlIntegration, instrumentGraphql } from './graphql';\nimport { hapiIntegration, instrumentHapi } from './hapi';\nimport { honoIntegration, instrumentHono } from './hono';\nimport { instrumentKafka, kafkaIntegration } from './kafka';\nimport { instrumentKoa, koaIntegration } from './koa';\nimport { instrumentLangChain, langChainIntegration } from './langchain';\nimport { instrumentLangGraph, langGraphIntegration } from './langgraph';\nimport { instrumentLruMemoizer, lruMemoizerIntegration } from './lrumemoizer';\nimport { instrumentMongo, mongoIntegration } from './mongo';\nimport { instrumentMongoose, mongooseIntegration } from './mongoose';\nimport { instrumentMysql, mysqlIntegration } from './mysql';\nimport { instrumentMysql2, mysql2Integration } from './mysql2';\nimport { instrumentOpenAi, openAIIntegration } from './openai';\nimport { instrumentPostgres, postgresIntegration } from './postgres';\nimport { instrumentPostgresJs, postgresJsIntegration } from './postgresjs';\nimport { prismaIntegration } from './prisma';\nimport { instrumentRedis, redisIntegration } from './redis';\nimport { instrumentTedious, tediousIntegration } from './tedious';\nimport { instrumentVercelAi, vercelAIIntegration } from './vercelai';\n\n/**\n * With OTEL, all performance integrations will be added, as OTEL only initializes them when the patched package is actually required.\n */\nexport function getAutoPerformanceIntegrations(): Integration[] {\n return [\n expressIntegration(),\n fastifyIntegration(),\n graphqlIntegration(),\n honoIntegration(),\n mongoIntegration(),\n mongooseIntegration(),\n mysqlIntegration(),\n mysql2Integration(),\n redisIntegration(),\n postgresIntegration(),\n prismaIntegration(),\n hapiIntegration(),\n koaIntegration(),\n connectIntegration(),\n tediousIntegration(),\n genericPoolIntegration(),\n kafkaIntegration(),\n amqplibIntegration(),\n lruMemoizerIntegration(),\n // AI providers\n // LangChain must come first to disable AI provider integrations before they instrument\n langChainIntegration(),\n langGraphIntegration(),\n vercelAIIntegration(),\n openAIIntegration(),\n anthropicAIIntegration(),\n googleGenAIIntegration(),\n postgresJsIntegration(),\n firebaseIntegration(),\n ];\n}\n\n/**\n * Get a list of methods to instrument OTEL, when preload instrumentation.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function getOpenTelemetryInstrumentationToPreload(): (((options?: any) => void) & { id: string })[] {\n return [\n instrumentSentryHttp,\n instrumentExpress,\n instrumentConnect,\n instrumentFastify,\n instrumentFastifyV3,\n instrumentHapi,\n instrumentHono,\n instrumentKafka,\n instrumentKoa,\n instrumentLruMemoizer,\n instrumentMongo,\n instrumentMongoose,\n instrumentMysql,\n instrumentMysql2,\n instrumentPostgres,\n instrumentHapi,\n instrumentGraphql,\n instrumentRedis,\n instrumentTedious,\n instrumentGenericPool,\n instrumentAmqplib,\n instrumentLangChain,\n instrumentVercelAi,\n instrumentOpenAi,\n instrumentPostgresJs,\n instrumentFirebase,\n instrumentAnthropicAi,\n instrumentGoogleGenAI,\n instrumentLangGraph,\n ];\n}\n"],"names":["expressIntegration","fastifyIntegration","graphqlIntegration","honoIntegration","mongoIntegration","mongooseIntegration","mysqlIntegration","mysql2Integration","redisIntegration","postgresIntegration","prismaIntegration","hapiIntegration","koaIntegration","connectIntegration","tediousIntegration","genericPoolIntegration","kafkaIntegration","amqplibIntegration","lruMemoizerIntegration","langChainIntegration","langGraphIntegration","vercelAIIntegration","openAIIntegration","anthropicAIIntegration","googleGenAIIntegration","postgresJsIntegration","firebaseIntegration","instrumentSentryHttp","instrumentExpress","instrumentConnect","instrumentFastify","instrumentFastifyV3","instrumentHapi","instrumentHono","instrumentKafka","instrumentKoa","instrumentLruMemoizer","instrumentMongo","instrumentMongoose","instrumentMysql","instrumentMysql2","instrumentPostgres","instrumentGraphql","instrumentRedis","instrumentTedious","instrumentGenericPool","instrumentAmqplib","instrumentLangChain","instrumentVercelAi","instrumentOpenAi","instrumentPostgresJs","instrumentFirebase","instrumentAnthropicAi","instrumentGoogleGenAI","instrumentLangGraph"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCO,SAAS,8BAAA,GAAgD;AAC9D,EAAA,OAAO;AAAA,IACLA,0BAAA,EAAmB;AAAA,IACnBC,0BAAA,EAAmB;AAAA,IACnBC,0BAAA,EAAmB;AAAA,IACnBC,uBAAA,EAAgB;AAAA,IAChBC,wBAAA,EAAiB;AAAA,IACjBC,2BAAA,EAAoB;AAAA,IACpBC,wBAAA,EAAiB;AAAA,IACjBC,yBAAA,EAAkB;AAAA,IAClBC,wBAAA,EAAiB;AAAA,IACjBC,2BAAA,EAAoB;AAAA,IACpBC,yBAAA,EAAkB;AAAA,IAClBC,uBAAA,EAAgB;AAAA,IAChBC,sBAAA,EAAe;AAAA,IACfC,wBAAA,EAAmB;AAAA,IACnBC,0BAAA,EAAmB;AAAA,IACnBC,8BAAA,EAAuB;AAAA,IACvBC,wBAAA,EAAiB;AAAA,IACjBC,0BAAA,EAAmB;AAAA,IACnBC,8BAAA,EAAuB;AAAA;AAAA;AAAA,IAGvBC,4BAAA,EAAqB;AAAA,IACrBC,4BAAA,EAAqB;AAAA,IACrBC,2BAAA,EAAoB;AAAA,IACpBC,yBAAA,EAAkB;AAAA,IAClBC,8BAAA,EAAuB;AAAA,IACvBC,8BAAA,EAAuB;AAAA,IACvBC,gCAAA,EAAsB;AAAA,IACtBC,4BAAA;AAAoB,GACtB;AACF;AAMO,SAAS,wCAAA,GAA2F;AACzG,EAAA,OAAO;AAAA,IACLC,yBAAA;AAAA,IACAC,yBAAA;AAAA,IACAC,uBAAA;AAAA,IACAC,yBAAA;AAAA,IACAC,2BAAA;AAAA,IACAC,sBAAA;AAAA,IACAC,sBAAA;AAAA,IACAC,uBAAA;AAAA,IACAC,qBAAA;AAAA,IACAC,6BAAA;AAAA,IACAC,uBAAA;AAAA,IACAC,0BAAA;AAAA,IACAC,uBAAA;AAAA,IACAC,wBAAA;AAAA,IACAC,0BAAA;AAAA,IACAT,sBAAA;AAAA,IACAU,yBAAA;AAAA,IACAC,uBAAA;AAAA,IACAC,yBAAA;AAAA,IACAC,6BAAA;AAAA,IACAC,yBAAA;AAAA,IACAC,2BAAA;AAAA,IACAC,0BAAA;AAAA,IACAC,wBAAA;AAAA,IACAC,+BAAA;AAAA,IACAC,2BAAA;AAAA,IACAC,6BAAA;AAAA,IACAC,6BAAA;AAAA,IACAC;AAAA,GACF;AACF;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/integrations/tracing/index.ts"],"sourcesContent":["import type { Integration } from '@sentry/core';\nimport { instrumentSentryHttp } from '../http';\nimport { amqplibIntegration, instrumentAmqplib } from './amqplib';\nimport { anthropicAIIntegration, instrumentAnthropicAi } from './anthropic-ai';\nimport { connectIntegration, instrumentConnect } from './connect';\nimport { expressIntegration, instrumentExpress } from './express';\nimport { fastifyIntegration, instrumentFastify, instrumentFastifyV3 } from './fastify';\nimport { firebaseIntegration, instrumentFirebase } from './firebase';\nimport { genericPoolIntegration, instrumentGenericPool } from './genericPool';\nimport { googleGenAIIntegration, instrumentGoogleGenAI } from './google-genai';\nimport { graphqlIntegration, instrumentGraphql } from './graphql';\nimport { hapiIntegration, instrumentHapi } from './hapi';\nimport { honoIntegration, instrumentHono } from './hono';\nimport { instrumentKafka, kafkaIntegration } from './kafka';\nimport { instrumentKoa, koaIntegration } from './koa';\nimport { instrumentLangChain, langChainIntegration } from './langchain';\nimport { instrumentLangGraph, langGraphIntegration } from './langgraph';\nimport { instrumentLruMemoizer, lruMemoizerIntegration } from './lrumemoizer';\nimport { instrumentMongo, mongoIntegration } from './mongo';\nimport { instrumentMongoose, mongooseIntegration } from './mongoose';\nimport { instrumentMysql, mysqlIntegration } from './mysql';\nimport { instrumentMysql2, mysql2Integration } from './mysql2';\nimport { instrumentOpenAi, openAIIntegration } from './openai';\nimport { instrumentPostgres, postgresIntegration } from './postgres';\nimport { instrumentPostgresJs, postgresJsIntegration } from './postgresjs';\nimport { prismaIntegration } from './prisma';\nimport { instrumentRedis, redisIntegration } from './redis';\nimport { instrumentTedious, tediousIntegration } from './tedious';\nimport { instrumentVercelAi, vercelAIIntegration } from './vercelai';\n\n/**\n * With OTEL, all performance integrations will be added, as OTEL only initializes them when the patched package is actually required.\n */\nexport function getAutoPerformanceIntegrations(): Integration[] {\n return [\n expressIntegration(),\n fastifyIntegration(),\n graphqlIntegration(),\n // eslint-disable-next-line typescript/no-deprecated\n honoIntegration(),\n mongoIntegration(),\n mongooseIntegration(),\n mysqlIntegration(),\n mysql2Integration(),\n redisIntegration(),\n postgresIntegration(),\n prismaIntegration(),\n hapiIntegration(),\n koaIntegration(),\n connectIntegration(),\n tediousIntegration(),\n genericPoolIntegration(),\n kafkaIntegration(),\n amqplibIntegration(),\n lruMemoizerIntegration(),\n // AI providers\n // LangChain must come first to disable AI provider integrations before they instrument\n langChainIntegration(),\n langGraphIntegration(),\n vercelAIIntegration(),\n openAIIntegration(),\n anthropicAIIntegration(),\n googleGenAIIntegration(),\n postgresJsIntegration(),\n firebaseIntegration(),\n ];\n}\n\n/**\n * Get a list of methods to instrument OTEL, when preload instrumentation.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function getOpenTelemetryInstrumentationToPreload(): (((options?: any) => void) & { id: string })[] {\n return [\n instrumentSentryHttp,\n instrumentExpress,\n instrumentConnect,\n instrumentFastify,\n instrumentFastifyV3,\n instrumentHapi,\n instrumentHono,\n instrumentKafka,\n instrumentKoa,\n instrumentLruMemoizer,\n instrumentMongo,\n instrumentMongoose,\n instrumentMysql,\n instrumentMysql2,\n instrumentPostgres,\n instrumentHapi,\n instrumentGraphql,\n instrumentRedis,\n instrumentTedious,\n instrumentGenericPool,\n instrumentAmqplib,\n instrumentLangChain,\n instrumentVercelAi,\n instrumentOpenAi,\n instrumentPostgresJs,\n instrumentFirebase,\n instrumentAnthropicAi,\n instrumentGoogleGenAI,\n instrumentLangGraph,\n ];\n}\n"],"names":["expressIntegration","fastifyIntegration","graphqlIntegration","honoIntegration","mongoIntegration","mongooseIntegration","mysqlIntegration","mysql2Integration","redisIntegration","postgresIntegration","prismaIntegration","hapiIntegration","koaIntegration","connectIntegration","tediousIntegration","genericPoolIntegration","kafkaIntegration","amqplibIntegration","lruMemoizerIntegration","langChainIntegration","langGraphIntegration","vercelAIIntegration","openAIIntegration","anthropicAIIntegration","googleGenAIIntegration","postgresJsIntegration","firebaseIntegration","instrumentSentryHttp","instrumentExpress","instrumentConnect","instrumentFastify","instrumentFastifyV3","instrumentHapi","instrumentHono","instrumentKafka","instrumentKoa","instrumentLruMemoizer","instrumentMongo","instrumentMongoose","instrumentMysql","instrumentMysql2","instrumentPostgres","instrumentGraphql","instrumentRedis","instrumentTedious","instrumentGenericPool","instrumentAmqplib","instrumentLangChain","instrumentVercelAi","instrumentOpenAi","instrumentPostgresJs","instrumentFirebase","instrumentAnthropicAi","instrumentGoogleGenAI","instrumentLangGraph"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCO,SAAS,8BAAA,GAAgD;AAC9D,EAAA,OAAO;AAAA,IACLA,0BAAA,EAAmB;AAAA,IACnBC,0BAAA,EAAmB;AAAA,IACnBC,0BAAA,EAAmB;AAAA;AAAA,IAEnBC,uBAAA,EAAgB;AAAA,IAChBC,wBAAA,EAAiB;AAAA,IACjBC,2BAAA,EAAoB;AAAA,IACpBC,wBAAA,EAAiB;AAAA,IACjBC,yBAAA,EAAkB;AAAA,IAClBC,wBAAA,EAAiB;AAAA,IACjBC,2BAAA,EAAoB;AAAA,IACpB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