@sentry/node 10.53.1 → 10.54.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 (955) hide show
  1. package/build/cjs/debug-build.js +0 -5
  2. package/build/cjs/debug-build.js.map +1 -1
  3. package/build/cjs/index.js +68 -68
  4. package/build/cjs/init.js +0 -6
  5. package/build/cjs/init.js.map +1 -1
  6. package/build/cjs/integrations/featureFlagShims/growthbook.js +0 -4
  7. package/build/cjs/integrations/featureFlagShims/growthbook.js.map +1 -1
  8. package/build/cjs/integrations/featureFlagShims/launchDarkly.js +6 -18
  9. package/build/cjs/integrations/featureFlagShims/launchDarkly.js.map +1 -1
  10. package/build/cjs/integrations/featureFlagShims/openFeature.js +6 -21
  11. package/build/cjs/integrations/featureFlagShims/openFeature.js.map +1 -1
  12. package/build/cjs/integrations/featureFlagShims/statsig.js +2 -8
  13. package/build/cjs/integrations/featureFlagShims/statsig.js.map +1 -1
  14. package/build/cjs/integrations/featureFlagShims/unleash.js +2 -8
  15. package/build/cjs/integrations/featureFlagShims/unleash.js.map +1 -1
  16. package/build/cjs/integrations/fs/index.js +107 -0
  17. package/build/cjs/integrations/fs/index.js.map +1 -0
  18. package/build/cjs/integrations/fs/vendored/constants.js +138 -0
  19. package/build/cjs/integrations/fs/vendored/constants.js.map +1 -0
  20. package/build/cjs/integrations/fs/vendored/instrumentation.js +311 -0
  21. package/build/cjs/integrations/fs/vendored/instrumentation.js.map +1 -0
  22. package/build/cjs/integrations/fs/vendored/utils.js +31 -0
  23. package/build/cjs/integrations/fs/vendored/utils.js.map +1 -0
  24. package/build/cjs/integrations/http.js +11 -37
  25. package/build/cjs/integrations/http.js.map +1 -1
  26. package/build/cjs/integrations/node-fetch/index.js +19 -46
  27. package/build/cjs/integrations/node-fetch/index.js.map +1 -1
  28. package/build/cjs/integrations/node-fetch/vendored/undici.js +71 -215
  29. package/build/cjs/integrations/node-fetch/vendored/undici.js.map +1 -1
  30. package/build/cjs/integrations/tracing/amqplib/index.js +29 -0
  31. package/build/cjs/integrations/tracing/amqplib/index.js.map +1 -0
  32. package/build/cjs/integrations/tracing/amqplib/vendored/amqplib.js +452 -0
  33. package/build/cjs/integrations/tracing/amqplib/vendored/amqplib.js.map +1 -0
  34. package/build/cjs/integrations/tracing/amqplib/vendored/semconv-obsolete.js +24 -0
  35. package/build/cjs/integrations/tracing/amqplib/vendored/semconv-obsolete.js.map +1 -0
  36. package/build/cjs/integrations/tracing/amqplib/vendored/semconv.js +12 -0
  37. package/build/cjs/integrations/tracing/amqplib/vendored/semconv.js.map +1 -0
  38. package/build/cjs/integrations/tracing/amqplib/vendored/types.js +23 -0
  39. package/build/cjs/integrations/tracing/amqplib/vendored/types.js.map +1 -0
  40. package/build/cjs/integrations/tracing/amqplib/vendored/utils.js +137 -0
  41. package/build/cjs/integrations/tracing/amqplib/vendored/utils.js.map +1 -0
  42. package/build/cjs/integrations/tracing/anthropic-ai/index.js +3 -58
  43. package/build/cjs/integrations/tracing/anthropic-ai/index.js.map +1 -1
  44. package/build/cjs/integrations/tracing/anthropic-ai/instrumentation.js +16 -39
  45. package/build/cjs/integrations/tracing/anthropic-ai/instrumentation.js.map +1 -1
  46. package/build/cjs/integrations/tracing/connect/index.js +56 -0
  47. package/build/cjs/integrations/tracing/connect/index.js.map +1 -0
  48. package/build/cjs/integrations/tracing/connect/vendored/enums/AttributeNames.js +22 -0
  49. package/build/cjs/integrations/tracing/connect/vendored/enums/AttributeNames.js.map +1 -0
  50. package/build/cjs/integrations/tracing/connect/vendored/instrumentation.js +148 -0
  51. package/build/cjs/integrations/tracing/connect/vendored/instrumentation.js.map +1 -0
  52. package/build/cjs/integrations/tracing/connect/vendored/internal-types.js +8 -0
  53. package/build/cjs/integrations/tracing/connect/vendored/internal-types.js.map +1 -0
  54. package/build/cjs/integrations/tracing/connect/vendored/utils.js +35 -0
  55. package/build/cjs/integrations/tracing/connect/vendored/utils.js.map +1 -0
  56. package/build/cjs/integrations/tracing/dataloader/index.js +41 -0
  57. package/build/cjs/integrations/tracing/dataloader/index.js.map +1 -0
  58. package/build/cjs/integrations/tracing/dataloader/vendored/instrumentation.js +245 -0
  59. package/build/cjs/integrations/tracing/dataloader/vendored/instrumentation.js.map +1 -0
  60. package/build/cjs/integrations/tracing/express.js +15 -23
  61. package/build/cjs/integrations/tracing/express.js.map +1 -1
  62. package/build/cjs/integrations/tracing/fastify/index.js +46 -165
  63. package/build/cjs/integrations/tracing/fastify/index.js.map +1 -1
  64. package/build/cjs/integrations/tracing/fastify/v3/constants.js +1 -18
  65. package/build/cjs/integrations/tracing/fastify/v3/constants.js.map +1 -1
  66. package/build/cjs/integrations/tracing/fastify/v3/enums/AttributeNames.js +20 -33
  67. package/build/cjs/integrations/tracing/fastify/v3/enums/AttributeNames.js.map +1 -1
  68. package/build/cjs/integrations/tracing/fastify/v3/instrumentation.js +68 -150
  69. package/build/cjs/integrations/tracing/fastify/v3/instrumentation.js.map +1 -1
  70. package/build/cjs/integrations/tracing/fastify/v3/utils.js +8 -79
  71. package/build/cjs/integrations/tracing/fastify/v3/utils.js.map +1 -1
  72. package/build/cjs/integrations/tracing/fastify/vendored/instrumentation.js +388 -0
  73. package/build/cjs/integrations/tracing/fastify/vendored/instrumentation.js.map +1 -0
  74. package/build/cjs/integrations/tracing/firebase/firebase.js +15 -21
  75. package/build/cjs/integrations/tracing/firebase/firebase.js.map +1 -1
  76. package/build/cjs/integrations/tracing/firebase/otel/firebaseInstrumentation.js +6 -14
  77. package/build/cjs/integrations/tracing/firebase/otel/firebaseInstrumentation.js.map +1 -1
  78. package/build/cjs/integrations/tracing/firebase/otel/patches/firestore.js +57 -161
  79. package/build/cjs/integrations/tracing/firebase/otel/patches/firestore.js.map +1 -1
  80. package/build/cjs/integrations/tracing/firebase/otel/patches/functions.js +81 -147
  81. package/build/cjs/integrations/tracing/firebase/otel/patches/functions.js.map +1 -1
  82. package/build/cjs/integrations/tracing/genericPool/index.js +35 -0
  83. package/build/cjs/integrations/tracing/genericPool/index.js.map +1 -0
  84. package/build/cjs/integrations/tracing/genericPool/vendored/instrumentation.js +122 -0
  85. package/build/cjs/integrations/tracing/genericPool/vendored/instrumentation.js.map +1 -0
  86. package/build/cjs/integrations/tracing/google-genai/index.js +3 -58
  87. package/build/cjs/integrations/tracing/google-genai/index.js.map +1 -1
  88. package/build/cjs/integrations/tracing/google-genai/instrumentation.js +18 -39
  89. package/build/cjs/integrations/tracing/google-genai/instrumentation.js.map +1 -1
  90. package/build/cjs/integrations/tracing/graphql/index.js +83 -0
  91. package/build/cjs/integrations/tracing/graphql/index.js.map +1 -0
  92. package/build/cjs/integrations/tracing/graphql/vendored/enum.js +47 -0
  93. package/build/cjs/integrations/tracing/graphql/vendored/enum.js.map +1 -0
  94. package/build/cjs/integrations/tracing/graphql/vendored/enums/AttributeNames.js +17 -0
  95. package/build/cjs/integrations/tracing/graphql/vendored/enums/AttributeNames.js.map +1 -0
  96. package/build/cjs/integrations/tracing/graphql/vendored/instrumentation.js +318 -0
  97. package/build/cjs/integrations/tracing/graphql/vendored/instrumentation.js.map +1 -0
  98. package/build/cjs/integrations/tracing/graphql/vendored/internal-types.js +6 -0
  99. package/build/cjs/integrations/tracing/graphql/vendored/internal-types.js.map +1 -0
  100. package/build/cjs/integrations/tracing/graphql/vendored/symbols.js +8 -0
  101. package/build/cjs/integrations/tracing/graphql/vendored/symbols.js.map +1 -0
  102. package/build/cjs/integrations/tracing/graphql/vendored/utils.js +300 -0
  103. package/build/cjs/integrations/tracing/graphql/vendored/utils.js.map +1 -0
  104. package/build/cjs/integrations/tracing/hapi/index.js +20 -78
  105. package/build/cjs/integrations/tracing/hapi/index.js.map +1 -1
  106. package/build/cjs/integrations/tracing/hapi/vendored/enums/AttributeNames.js +11 -0
  107. package/build/cjs/integrations/tracing/hapi/vendored/enums/AttributeNames.js.map +1 -0
  108. package/build/cjs/integrations/tracing/hapi/vendored/instrumentation.js +275 -0
  109. package/build/cjs/integrations/tracing/hapi/vendored/instrumentation.js.map +1 -0
  110. package/build/cjs/integrations/tracing/hapi/vendored/internal-types.js +24 -0
  111. package/build/cjs/integrations/tracing/hapi/vendored/internal-types.js.map +1 -0
  112. package/build/cjs/integrations/tracing/hapi/vendored/semconv.js +6 -0
  113. package/build/cjs/integrations/tracing/hapi/vendored/semconv.js.map +1 -0
  114. package/build/cjs/integrations/tracing/hapi/vendored/utils.js +91 -0
  115. package/build/cjs/integrations/tracing/hapi/vendored/utils.js.map +1 -0
  116. package/build/cjs/integrations/tracing/hono/constants.js +6 -7
  117. package/build/cjs/integrations/tracing/hono/constants.js.map +1 -1
  118. package/build/cjs/integrations/tracing/hono/index.js +19 -70
  119. package/build/cjs/integrations/tracing/hono/index.js.map +1 -1
  120. package/build/cjs/integrations/tracing/hono/instrumentation.js +47 -82
  121. package/build/cjs/integrations/tracing/hono/instrumentation.js.map +1 -1
  122. package/build/cjs/integrations/tracing/index.js +74 -82
  123. package/build/cjs/integrations/tracing/index.js.map +1 -1
  124. package/build/cjs/integrations/tracing/kafka/index.js +31 -0
  125. package/build/cjs/integrations/tracing/kafka/index.js.map +1 -0
  126. package/build/cjs/integrations/tracing/kafka/vendored/instrumentation.js +438 -0
  127. package/build/cjs/integrations/tracing/kafka/vendored/instrumentation.js.map +1 -0
  128. package/build/cjs/integrations/tracing/kafka/vendored/internal-types.js +6 -0
  129. package/build/cjs/integrations/tracing/kafka/vendored/internal-types.js.map +1 -0
  130. package/build/cjs/integrations/tracing/kafka/vendored/propagator.js +22 -0
  131. package/build/cjs/integrations/tracing/kafka/vendored/propagator.js.map +1 -0
  132. package/build/cjs/integrations/tracing/kafka/vendored/semconv.js +38 -0
  133. package/build/cjs/integrations/tracing/kafka/vendored/semconv.js.map +1 -0
  134. package/build/cjs/integrations/tracing/knex/index.js +36 -0
  135. package/build/cjs/integrations/tracing/knex/index.js.map +1 -0
  136. package/build/cjs/integrations/tracing/knex/vendored/constants.js +16 -0
  137. package/build/cjs/integrations/tracing/knex/vendored/constants.js.map +1 -0
  138. package/build/cjs/integrations/tracing/knex/vendored/instrumentation.js +162 -0
  139. package/build/cjs/integrations/tracing/knex/vendored/instrumentation.js.map +1 -0
  140. package/build/cjs/integrations/tracing/knex/vendored/semconv.js +24 -0
  141. package/build/cjs/integrations/tracing/knex/vendored/semconv.js.map +1 -0
  142. package/build/cjs/integrations/tracing/knex/vendored/utils.js +97 -0
  143. package/build/cjs/integrations/tracing/knex/vendored/utils.js.map +1 -0
  144. package/build/cjs/integrations/tracing/koa/index.js +69 -0
  145. package/build/cjs/integrations/tracing/koa/index.js.map +1 -0
  146. package/build/cjs/integrations/tracing/koa/vendored/enums/AttributeNames.js +10 -0
  147. package/build/cjs/integrations/tracing/koa/vendored/enums/AttributeNames.js.map +1 -0
  148. package/build/cjs/integrations/tracing/koa/vendored/instrumentation.js +140 -0
  149. package/build/cjs/integrations/tracing/koa/vendored/instrumentation.js.map +1 -0
  150. package/build/cjs/integrations/tracing/koa/vendored/internal-types.js +6 -0
  151. package/build/cjs/integrations/tracing/koa/vendored/internal-types.js.map +1 -0
  152. package/build/cjs/integrations/tracing/koa/vendored/types.js +10 -0
  153. package/build/cjs/integrations/tracing/koa/vendored/types.js.map +1 -0
  154. package/build/cjs/integrations/tracing/koa/vendored/utils.js +33 -0
  155. package/build/cjs/integrations/tracing/koa/vendored/utils.js.map +1 -0
  156. package/build/cjs/integrations/tracing/langchain/index.js +3 -97
  157. package/build/cjs/integrations/tracing/langchain/index.js.map +1 -1
  158. package/build/cjs/integrations/tracing/langchain/instrumentation.js +51 -146
  159. package/build/cjs/integrations/tracing/langchain/instrumentation.js.map +1 -1
  160. package/build/cjs/integrations/tracing/langgraph/index.js +3 -73
  161. package/build/cjs/integrations/tracing/langgraph/index.js.map +1 -1
  162. package/build/cjs/integrations/tracing/langgraph/instrumentation.js +27 -38
  163. package/build/cjs/integrations/tracing/langgraph/instrumentation.js.map +1 -1
  164. package/build/cjs/integrations/tracing/lrumemoizer/index.js +21 -0
  165. package/build/cjs/integrations/tracing/lrumemoizer/index.js.map +1 -0
  166. package/build/cjs/integrations/tracing/lrumemoizer/vendored/instrumentation.js +39 -0
  167. package/build/cjs/integrations/tracing/lrumemoizer/vendored/instrumentation.js.map +1 -0
  168. package/build/cjs/integrations/tracing/mongo/index.js +62 -0
  169. package/build/cjs/integrations/tracing/mongo/index.js.map +1 -0
  170. package/build/cjs/integrations/tracing/mongo/vendored/instrumentation.js +678 -0
  171. package/build/cjs/integrations/tracing/mongo/vendored/instrumentation.js.map +1 -0
  172. package/build/cjs/integrations/tracing/mongo/vendored/internal-types.js +14 -0
  173. package/build/cjs/integrations/tracing/mongo/vendored/internal-types.js.map +1 -0
  174. package/build/cjs/integrations/tracing/mongo/vendored/semconv.js +26 -0
  175. package/build/cjs/integrations/tracing/mongo/vendored/semconv.js.map +1 -0
  176. package/build/cjs/integrations/tracing/mongoose/index.js +28 -0
  177. package/build/cjs/integrations/tracing/mongoose/index.js.map +1 -0
  178. package/build/cjs/integrations/tracing/mongoose/vendored/mongoose.js +375 -0
  179. package/build/cjs/integrations/tracing/mongoose/vendored/mongoose.js.map +1 -0
  180. package/build/cjs/integrations/tracing/mongoose/vendored/semconv.js +22 -0
  181. package/build/cjs/integrations/tracing/mongoose/vendored/semconv.js.map +1 -0
  182. package/build/cjs/integrations/tracing/mongoose/vendored/utils.js +87 -0
  183. package/build/cjs/integrations/tracing/mongoose/vendored/utils.js.map +1 -0
  184. package/build/cjs/integrations/tracing/mysql/index.js +21 -0
  185. package/build/cjs/integrations/tracing/mysql/index.js.map +1 -0
  186. package/build/cjs/integrations/tracing/mysql/vendored/AttributeNames.js +9 -0
  187. package/build/cjs/integrations/tracing/mysql/vendored/AttributeNames.js.map +1 -0
  188. package/build/cjs/integrations/tracing/mysql/vendored/instrumentation.js +278 -0
  189. package/build/cjs/integrations/tracing/mysql/vendored/instrumentation.js.map +1 -0
  190. package/build/cjs/integrations/tracing/mysql/vendored/semconv.js +22 -0
  191. package/build/cjs/integrations/tracing/mysql/vendored/semconv.js.map +1 -0
  192. package/build/cjs/integrations/tracing/mysql/vendored/utils.js +63 -0
  193. package/build/cjs/integrations/tracing/mysql/vendored/utils.js.map +1 -0
  194. package/build/cjs/integrations/tracing/mysql2/index.js +28 -0
  195. package/build/cjs/integrations/tracing/mysql2/index.js.map +1 -0
  196. package/build/cjs/integrations/tracing/mysql2/vendored/instrumentation.js +173 -0
  197. package/build/cjs/integrations/tracing/mysql2/vendored/instrumentation.js.map +1 -0
  198. package/build/cjs/integrations/tracing/mysql2/vendored/semconv.js +20 -0
  199. package/build/cjs/integrations/tracing/mysql2/vendored/semconv.js.map +1 -0
  200. package/build/cjs/integrations/tracing/mysql2/vendored/utils.js +97 -0
  201. package/build/cjs/integrations/tracing/mysql2/vendored/utils.js.map +1 -0
  202. package/build/cjs/integrations/tracing/openai/index.js +3 -58
  203. package/build/cjs/integrations/tracing/openai/index.js.map +1 -1
  204. package/build/cjs/integrations/tracing/openai/instrumentation.js +17 -41
  205. package/build/cjs/integrations/tracing/openai/instrumentation.js.map +1 -1
  206. package/build/cjs/integrations/tracing/postgres/index.js +31 -0
  207. package/build/cjs/integrations/tracing/postgres/index.js.map +1 -0
  208. package/build/cjs/integrations/tracing/postgres/vendored/enums/AttributeNames.js +12 -0
  209. package/build/cjs/integrations/tracing/postgres/vendored/enums/AttributeNames.js.map +1 -0
  210. package/build/cjs/integrations/tracing/postgres/vendored/enums/SpanNames.js +11 -0
  211. package/build/cjs/integrations/tracing/postgres/vendored/enums/SpanNames.js.map +1 -0
  212. package/build/cjs/integrations/tracing/postgres/vendored/instrumentation.js +436 -0
  213. package/build/cjs/integrations/tracing/postgres/vendored/instrumentation.js.map +1 -0
  214. package/build/cjs/integrations/tracing/postgres/vendored/internal-types.js +6 -0
  215. package/build/cjs/integrations/tracing/postgres/vendored/internal-types.js.map +1 -0
  216. package/build/cjs/integrations/tracing/postgres/vendored/semconv.js +32 -0
  217. package/build/cjs/integrations/tracing/postgres/vendored/semconv.js.map +1 -0
  218. package/build/cjs/integrations/tracing/postgres/vendored/utils.js +275 -0
  219. package/build/cjs/integrations/tracing/postgres/vendored/utils.js.map +1 -0
  220. package/build/cjs/integrations/tracing/postgresjs.js +66 -181
  221. package/build/cjs/integrations/tracing/postgresjs.js.map +1 -1
  222. package/build/cjs/integrations/tracing/prisma/index.js +123 -0
  223. package/build/cjs/integrations/tracing/prisma/index.js.map +1 -0
  224. package/build/cjs/integrations/tracing/prisma/vendored/active-tracing-helper.js +119 -0
  225. package/build/cjs/integrations/tracing/prisma/vendored/active-tracing-helper.js.map +1 -0
  226. package/build/cjs/integrations/tracing/prisma/vendored/constants.js +14 -0
  227. package/build/cjs/integrations/tracing/prisma/vendored/constants.js.map +1 -0
  228. package/build/cjs/integrations/tracing/prisma/vendored/global.js +28 -0
  229. package/build/cjs/integrations/tracing/prisma/vendored/global.js.map +1 -0
  230. package/build/cjs/integrations/tracing/prisma/vendored/instrumentation.js +38 -0
  231. package/build/cjs/integrations/tracing/prisma/vendored/instrumentation.js.map +1 -0
  232. package/build/cjs/integrations/tracing/redis/index.js +15 -72
  233. package/build/cjs/integrations/tracing/redis/index.js.map +1 -1
  234. package/build/cjs/integrations/tracing/redis/redis-dc-subscriber.js +42 -77
  235. package/build/cjs/integrations/tracing/redis/redis-dc-subscriber.js.map +1 -1
  236. package/build/cjs/integrations/tracing/redis/vendored/ioredis-instrumentation.js +53 -98
  237. package/build/cjs/integrations/tracing/redis/vendored/ioredis-instrumentation.js.map +1 -1
  238. package/build/cjs/integrations/tracing/redis/vendored/redis-common.js +9 -49
  239. package/build/cjs/integrations/tracing/redis/vendored/redis-common.js.map +1 -1
  240. package/build/cjs/integrations/tracing/redis/vendored/redis-instrumentation.js +175 -282
  241. package/build/cjs/integrations/tracing/redis/vendored/redis-instrumentation.js.map +1 -1
  242. package/build/cjs/integrations/tracing/redis/vendored/semconv.js +7 -36
  243. package/build/cjs/integrations/tracing/redis/vendored/semconv.js.map +1 -1
  244. package/build/cjs/integrations/tracing/tedious/index.js +45 -0
  245. package/build/cjs/integrations/tracing/tedious/index.js.map +1 -0
  246. package/build/cjs/integrations/tracing/tedious/vendored/instrumentation.js +205 -0
  247. package/build/cjs/integrations/tracing/tedious/vendored/instrumentation.js.map +1 -0
  248. package/build/cjs/integrations/tracing/tedious/vendored/semconv.js +20 -0
  249. package/build/cjs/integrations/tracing/tedious/vendored/semconv.js.map +1 -0
  250. package/build/cjs/integrations/tracing/tedious/vendored/utils.js +29 -0
  251. package/build/cjs/integrations/tracing/tedious/vendored/utils.js.map +1 -0
  252. package/build/cjs/integrations/tracing/utils/sql-common.js +43 -0
  253. package/build/cjs/integrations/tracing/utils/sql-common.js.map +1 -0
  254. package/build/cjs/integrations/tracing/vercelai/constants.js +1 -1
  255. package/build/cjs/integrations/tracing/vercelai/index.js +3 -50
  256. package/build/cjs/integrations/tracing/vercelai/index.js.map +1 -1
  257. package/build/cjs/integrations/tracing/vercelai/instrumentation.js +58 -157
  258. package/build/cjs/integrations/tracing/vercelai/instrumentation.js.map +1 -1
  259. package/build/cjs/preload.js +1 -14
  260. package/build/cjs/preload.js.map +1 -1
  261. package/build/cjs/sdk/index.js +6 -34
  262. package/build/cjs/sdk/index.js.map +1 -1
  263. package/build/cjs/sdk/initOtel.js +13 -51
  264. package/build/cjs/sdk/initOtel.js.map +1 -1
  265. package/build/cjs/utils/redisCache.js +24 -52
  266. package/build/cjs/utils/redisCache.js.map +1 -1
  267. package/build/esm/debug-build.js +0 -5
  268. package/build/esm/debug-build.js.map +1 -1
  269. package/build/esm/index.js +17 -17
  270. package/build/esm/init.js +0 -6
  271. package/build/esm/init.js.map +1 -1
  272. package/build/esm/integrations/featureFlagShims/growthbook.js +0 -4
  273. package/build/esm/integrations/featureFlagShims/growthbook.js.map +1 -1
  274. package/build/esm/integrations/featureFlagShims/launchDarkly.js +6 -18
  275. package/build/esm/integrations/featureFlagShims/launchDarkly.js.map +1 -1
  276. package/build/esm/integrations/featureFlagShims/openFeature.js +6 -21
  277. package/build/esm/integrations/featureFlagShims/openFeature.js.map +1 -1
  278. package/build/esm/integrations/featureFlagShims/statsig.js +2 -8
  279. package/build/esm/integrations/featureFlagShims/statsig.js.map +1 -1
  280. package/build/esm/integrations/featureFlagShims/unleash.js +2 -8
  281. package/build/esm/integrations/featureFlagShims/unleash.js.map +1 -1
  282. package/build/esm/integrations/fs/index.js +105 -0
  283. package/build/esm/integrations/fs/index.js.map +1 -0
  284. package/build/esm/integrations/fs/vendored/constants.js +134 -0
  285. package/build/esm/integrations/fs/vendored/constants.js.map +1 -0
  286. package/build/esm/integrations/fs/vendored/instrumentation.js +309 -0
  287. package/build/esm/integrations/fs/vendored/instrumentation.js.map +1 -0
  288. package/build/esm/integrations/fs/vendored/utils.js +28 -0
  289. package/build/esm/integrations/fs/vendored/utils.js.map +1 -0
  290. package/build/esm/integrations/http.js +11 -37
  291. package/build/esm/integrations/http.js.map +1 -1
  292. package/build/esm/integrations/node-fetch/index.js +19 -46
  293. package/build/esm/integrations/node-fetch/index.js.map +1 -1
  294. package/build/esm/integrations/node-fetch/vendored/undici.js +71 -215
  295. package/build/esm/integrations/node-fetch/vendored/undici.js.map +1 -1
  296. package/build/esm/integrations/tracing/amqplib/index.js +26 -0
  297. package/build/esm/integrations/tracing/amqplib/index.js.map +1 -0
  298. package/build/esm/integrations/tracing/amqplib/vendored/amqplib.js +450 -0
  299. package/build/esm/integrations/tracing/amqplib/vendored/amqplib.js.map +1 -0
  300. package/build/esm/integrations/tracing/amqplib/vendored/semconv-obsolete.js +13 -0
  301. package/build/esm/integrations/tracing/amqplib/vendored/semconv-obsolete.js.map +1 -0
  302. package/build/esm/integrations/tracing/amqplib/vendored/semconv.js +7 -0
  303. package/build/esm/integrations/tracing/amqplib/vendored/semconv.js.map +1 -0
  304. package/build/esm/integrations/tracing/amqplib/vendored/types.js +20 -0
  305. package/build/esm/integrations/tracing/amqplib/vendored/types.js.map +1 -0
  306. package/build/esm/integrations/tracing/amqplib/vendored/utils.js +126 -0
  307. package/build/esm/integrations/tracing/amqplib/vendored/utils.js.map +1 -0
  308. package/build/esm/integrations/tracing/anthropic-ai/index.js +3 -58
  309. package/build/esm/integrations/tracing/anthropic-ai/index.js.map +1 -1
  310. package/build/esm/integrations/tracing/anthropic-ai/instrumentation.js +16 -39
  311. package/build/esm/integrations/tracing/anthropic-ai/instrumentation.js.map +1 -1
  312. package/build/esm/integrations/tracing/connect/index.js +52 -0
  313. package/build/esm/integrations/tracing/connect/index.js.map +1 -0
  314. package/build/esm/integrations/tracing/connect/vendored/enums/AttributeNames.js +18 -0
  315. package/build/esm/integrations/tracing/connect/vendored/enums/AttributeNames.js.map +1 -0
  316. package/build/esm/integrations/tracing/connect/vendored/instrumentation.js +145 -0
  317. package/build/esm/integrations/tracing/connect/vendored/instrumentation.js.map +1 -0
  318. package/build/esm/integrations/tracing/connect/vendored/internal-types.js +6 -0
  319. package/build/esm/integrations/tracing/connect/vendored/internal-types.js.map +1 -0
  320. package/build/esm/integrations/tracing/connect/vendored/utils.js +31 -0
  321. package/build/esm/integrations/tracing/connect/vendored/utils.js.map +1 -0
  322. package/build/esm/integrations/tracing/dataloader/index.js +38 -0
  323. package/build/esm/integrations/tracing/dataloader/index.js.map +1 -0
  324. package/build/esm/integrations/tracing/dataloader/vendored/instrumentation.js +243 -0
  325. package/build/esm/integrations/tracing/dataloader/vendored/instrumentation.js.map +1 -0
  326. package/build/esm/integrations/tracing/express.js +15 -23
  327. package/build/esm/integrations/tracing/express.js.map +1 -1
  328. package/build/esm/integrations/tracing/fastify/index.js +45 -164
  329. package/build/esm/integrations/tracing/fastify/index.js.map +1 -1
  330. package/build/esm/integrations/tracing/fastify/v3/constants.js +1 -18
  331. package/build/esm/integrations/tracing/fastify/v3/constants.js.map +1 -1
  332. package/build/esm/integrations/tracing/fastify/v3/enums/AttributeNames.js +17 -34
  333. package/build/esm/integrations/tracing/fastify/v3/enums/AttributeNames.js.map +1 -1
  334. package/build/esm/integrations/tracing/fastify/v3/instrumentation.js +68 -150
  335. package/build/esm/integrations/tracing/fastify/v3/instrumentation.js.map +1 -1
  336. package/build/esm/integrations/tracing/fastify/v3/utils.js +8 -79
  337. package/build/esm/integrations/tracing/fastify/v3/utils.js.map +1 -1
  338. package/build/esm/integrations/tracing/fastify/vendored/instrumentation.js +386 -0
  339. package/build/esm/integrations/tracing/fastify/vendored/instrumentation.js.map +1 -0
  340. package/build/esm/integrations/tracing/firebase/firebase.js +15 -21
  341. package/build/esm/integrations/tracing/firebase/firebase.js.map +1 -1
  342. package/build/esm/integrations/tracing/firebase/otel/firebaseInstrumentation.js +6 -14
  343. package/build/esm/integrations/tracing/firebase/otel/firebaseInstrumentation.js.map +1 -1
  344. package/build/esm/integrations/tracing/firebase/otel/patches/firestore.js +57 -161
  345. package/build/esm/integrations/tracing/firebase/otel/patches/firestore.js.map +1 -1
  346. package/build/esm/integrations/tracing/firebase/otel/patches/functions.js +81 -147
  347. package/build/esm/integrations/tracing/firebase/otel/patches/functions.js.map +1 -1
  348. package/build/esm/integrations/tracing/genericPool/index.js +32 -0
  349. package/build/esm/integrations/tracing/genericPool/index.js.map +1 -0
  350. package/build/esm/integrations/tracing/genericPool/vendored/instrumentation.js +120 -0
  351. package/build/esm/integrations/tracing/genericPool/vendored/instrumentation.js.map +1 -0
  352. package/build/esm/integrations/tracing/google-genai/index.js +3 -58
  353. package/build/esm/integrations/tracing/google-genai/index.js.map +1 -1
  354. package/build/esm/integrations/tracing/google-genai/instrumentation.js +18 -39
  355. package/build/esm/integrations/tracing/google-genai/instrumentation.js.map +1 -1
  356. package/build/esm/integrations/tracing/graphql/index.js +80 -0
  357. package/build/esm/integrations/tracing/graphql/index.js.map +1 -0
  358. package/build/esm/integrations/tracing/graphql/vendored/enum.js +43 -0
  359. package/build/esm/integrations/tracing/graphql/vendored/enum.js.map +1 -0
  360. package/build/esm/integrations/tracing/graphql/vendored/enums/AttributeNames.js +15 -0
  361. package/build/esm/integrations/tracing/graphql/vendored/enums/AttributeNames.js.map +1 -0
  362. package/build/esm/integrations/tracing/graphql/vendored/instrumentation.js +316 -0
  363. package/build/esm/integrations/tracing/graphql/vendored/instrumentation.js.map +1 -0
  364. package/build/esm/integrations/tracing/graphql/vendored/internal-types.js +4 -0
  365. package/build/esm/integrations/tracing/graphql/vendored/internal-types.js.map +1 -0
  366. package/build/esm/integrations/tracing/graphql/vendored/symbols.js +5 -0
  367. package/build/esm/integrations/tracing/graphql/vendored/symbols.js.map +1 -0
  368. package/build/esm/integrations/tracing/graphql/vendored/utils.js +291 -0
  369. package/build/esm/integrations/tracing/graphql/vendored/utils.js.map +1 -0
  370. package/build/esm/integrations/tracing/hapi/index.js +19 -77
  371. package/build/esm/integrations/tracing/hapi/index.js.map +1 -1
  372. package/build/esm/integrations/tracing/hapi/vendored/enums/AttributeNames.js +9 -0
  373. package/build/esm/integrations/tracing/hapi/vendored/enums/AttributeNames.js.map +1 -0
  374. package/build/esm/integrations/tracing/hapi/vendored/instrumentation.js +273 -0
  375. package/build/esm/integrations/tracing/hapi/vendored/instrumentation.js.map +1 -0
  376. package/build/esm/integrations/tracing/hapi/vendored/internal-types.js +19 -0
  377. package/build/esm/integrations/tracing/hapi/vendored/internal-types.js.map +1 -0
  378. package/build/esm/integrations/tracing/hapi/vendored/semconv.js +4 -0
  379. package/build/esm/integrations/tracing/hapi/vendored/semconv.js.map +1 -0
  380. package/build/esm/integrations/tracing/hapi/vendored/utils.js +82 -0
  381. package/build/esm/integrations/tracing/hapi/vendored/utils.js.map +1 -0
  382. package/build/esm/integrations/tracing/hono/constants.js +6 -7
  383. package/build/esm/integrations/tracing/hono/constants.js.map +1 -1
  384. package/build/esm/integrations/tracing/hono/index.js +19 -70
  385. package/build/esm/integrations/tracing/hono/index.js.map +1 -1
  386. package/build/esm/integrations/tracing/hono/instrumentation.js +47 -82
  387. package/build/esm/integrations/tracing/hono/instrumentation.js.map +1 -1
  388. package/build/esm/integrations/tracing/index.js +16 -24
  389. package/build/esm/integrations/tracing/index.js.map +1 -1
  390. package/build/esm/integrations/tracing/kafka/index.js +28 -0
  391. package/build/esm/integrations/tracing/kafka/index.js.map +1 -0
  392. package/build/esm/integrations/tracing/kafka/vendored/instrumentation.js +436 -0
  393. package/build/esm/integrations/tracing/kafka/vendored/instrumentation.js.map +1 -0
  394. package/build/esm/integrations/tracing/kafka/vendored/internal-types.js +4 -0
  395. package/build/esm/integrations/tracing/kafka/vendored/internal-types.js.map +1 -0
  396. package/build/esm/integrations/tracing/kafka/vendored/propagator.js +20 -0
  397. package/build/esm/integrations/tracing/kafka/vendored/propagator.js.map +1 -0
  398. package/build/esm/integrations/tracing/kafka/vendored/semconv.js +20 -0
  399. package/build/esm/integrations/tracing/kafka/vendored/semconv.js.map +1 -0
  400. package/build/esm/integrations/tracing/knex/index.js +33 -0
  401. package/build/esm/integrations/tracing/knex/index.js.map +1 -0
  402. package/build/esm/integrations/tracing/knex/vendored/constants.js +13 -0
  403. package/build/esm/integrations/tracing/knex/vendored/constants.js.map +1 -0
  404. package/build/esm/integrations/tracing/knex/vendored/instrumentation.js +160 -0
  405. package/build/esm/integrations/tracing/knex/vendored/instrumentation.js.map +1 -0
  406. package/build/esm/integrations/tracing/knex/vendored/semconv.js +13 -0
  407. package/build/esm/integrations/tracing/knex/vendored/semconv.js.map +1 -0
  408. package/build/esm/integrations/tracing/knex/vendored/utils.js +87 -0
  409. package/build/esm/integrations/tracing/knex/vendored/utils.js.map +1 -0
  410. package/build/esm/integrations/tracing/koa/index.js +65 -0
  411. package/build/esm/integrations/tracing/koa/index.js.map +1 -0
  412. package/build/esm/integrations/tracing/koa/vendored/enums/AttributeNames.js +8 -0
  413. package/build/esm/integrations/tracing/koa/vendored/enums/AttributeNames.js.map +1 -0
  414. package/build/esm/integrations/tracing/koa/vendored/instrumentation.js +138 -0
  415. package/build/esm/integrations/tracing/koa/vendored/instrumentation.js.map +1 -0
  416. package/build/esm/integrations/tracing/koa/vendored/internal-types.js +4 -0
  417. package/build/esm/integrations/tracing/koa/vendored/internal-types.js.map +1 -0
  418. package/build/esm/integrations/tracing/koa/vendored/types.js +8 -0
  419. package/build/esm/integrations/tracing/koa/vendored/types.js.map +1 -0
  420. package/build/esm/integrations/tracing/koa/vendored/utils.js +30 -0
  421. package/build/esm/integrations/tracing/koa/vendored/utils.js.map +1 -0
  422. package/build/esm/integrations/tracing/langchain/index.js +3 -97
  423. package/build/esm/integrations/tracing/langchain/index.js.map +1 -1
  424. package/build/esm/integrations/tracing/langchain/instrumentation.js +52 -147
  425. package/build/esm/integrations/tracing/langchain/instrumentation.js.map +1 -1
  426. package/build/esm/integrations/tracing/langgraph/index.js +3 -73
  427. package/build/esm/integrations/tracing/langgraph/index.js.map +1 -1
  428. package/build/esm/integrations/tracing/langgraph/instrumentation.js +27 -38
  429. package/build/esm/integrations/tracing/langgraph/instrumentation.js.map +1 -1
  430. package/build/esm/integrations/tracing/lrumemoizer/index.js +18 -0
  431. package/build/esm/integrations/tracing/lrumemoizer/index.js.map +1 -0
  432. package/build/esm/integrations/tracing/lrumemoizer/vendored/instrumentation.js +37 -0
  433. package/build/esm/integrations/tracing/lrumemoizer/vendored/instrumentation.js.map +1 -0
  434. package/build/esm/integrations/tracing/mongo/index.js +58 -0
  435. package/build/esm/integrations/tracing/mongo/index.js.map +1 -0
  436. package/build/esm/integrations/tracing/mongo/vendored/instrumentation.js +676 -0
  437. package/build/esm/integrations/tracing/mongo/vendored/instrumentation.js.map +1 -0
  438. package/build/esm/integrations/tracing/mongo/vendored/internal-types.js +12 -0
  439. package/build/esm/integrations/tracing/mongo/vendored/internal-types.js.map +1 -0
  440. package/build/esm/integrations/tracing/mongo/vendored/semconv.js +14 -0
  441. package/build/esm/integrations/tracing/mongo/vendored/semconv.js.map +1 -0
  442. package/build/esm/integrations/tracing/mongoose/index.js +25 -0
  443. package/build/esm/integrations/tracing/mongoose/index.js.map +1 -0
  444. package/build/esm/integrations/tracing/mongoose/vendored/mongoose.js +371 -0
  445. package/build/esm/integrations/tracing/mongoose/vendored/mongoose.js.map +1 -0
  446. package/build/esm/integrations/tracing/mongoose/vendored/semconv.js +12 -0
  447. package/build/esm/integrations/tracing/mongoose/vendored/semconv.js.map +1 -0
  448. package/build/esm/integrations/tracing/mongoose/vendored/utils.js +83 -0
  449. package/build/esm/integrations/tracing/mongoose/vendored/utils.js.map +1 -0
  450. package/build/esm/integrations/tracing/mysql/index.js +18 -0
  451. package/build/esm/integrations/tracing/mysql/index.js.map +1 -0
  452. package/build/esm/integrations/tracing/mysql/vendored/AttributeNames.js +7 -0
  453. package/build/esm/integrations/tracing/mysql/vendored/AttributeNames.js.map +1 -0
  454. package/build/esm/integrations/tracing/mysql/vendored/instrumentation.js +276 -0
  455. package/build/esm/integrations/tracing/mysql/vendored/instrumentation.js.map +1 -0
  456. package/build/esm/integrations/tracing/mysql/vendored/semconv.js +12 -0
  457. package/build/esm/integrations/tracing/mysql/vendored/semconv.js.map +1 -0
  458. package/build/esm/integrations/tracing/mysql/vendored/utils.js +55 -0
  459. package/build/esm/integrations/tracing/mysql/vendored/utils.js.map +1 -0
  460. package/build/esm/integrations/tracing/mysql2/index.js +25 -0
  461. package/build/esm/integrations/tracing/mysql2/index.js.map +1 -0
  462. package/build/esm/integrations/tracing/mysql2/vendored/instrumentation.js +171 -0
  463. package/build/esm/integrations/tracing/mysql2/vendored/instrumentation.js.map +1 -0
  464. package/build/esm/integrations/tracing/mysql2/vendored/semconv.js +11 -0
  465. package/build/esm/integrations/tracing/mysql2/vendored/semconv.js.map +1 -0
  466. package/build/esm/integrations/tracing/mysql2/vendored/utils.js +91 -0
  467. package/build/esm/integrations/tracing/mysql2/vendored/utils.js.map +1 -0
  468. package/build/esm/integrations/tracing/openai/index.js +3 -58
  469. package/build/esm/integrations/tracing/openai/index.js.map +1 -1
  470. package/build/esm/integrations/tracing/openai/instrumentation.js +17 -41
  471. package/build/esm/integrations/tracing/openai/instrumentation.js.map +1 -1
  472. package/build/esm/integrations/tracing/postgres/index.js +28 -0
  473. package/build/esm/integrations/tracing/postgres/index.js.map +1 -0
  474. package/build/esm/integrations/tracing/postgres/vendored/enums/AttributeNames.js +10 -0
  475. package/build/esm/integrations/tracing/postgres/vendored/enums/AttributeNames.js.map +1 -0
  476. package/build/esm/integrations/tracing/postgres/vendored/enums/SpanNames.js +9 -0
  477. package/build/esm/integrations/tracing/postgres/vendored/enums/SpanNames.js.map +1 -0
  478. package/build/esm/integrations/tracing/postgres/vendored/instrumentation.js +434 -0
  479. package/build/esm/integrations/tracing/postgres/vendored/instrumentation.js.map +1 -0
  480. package/build/esm/integrations/tracing/postgres/vendored/internal-types.js +4 -0
  481. package/build/esm/integrations/tracing/postgres/vendored/internal-types.js.map +1 -0
  482. package/build/esm/integrations/tracing/postgres/vendored/semconv.js +17 -0
  483. package/build/esm/integrations/tracing/postgres/vendored/semconv.js.map +1 -0
  484. package/build/esm/integrations/tracing/postgres/vendored/utils.js +257 -0
  485. package/build/esm/integrations/tracing/postgres/vendored/utils.js.map +1 -0
  486. package/build/esm/integrations/tracing/postgresjs.js +66 -181
  487. package/build/esm/integrations/tracing/postgresjs.js.map +1 -1
  488. package/build/esm/integrations/tracing/prisma/index.js +120 -0
  489. package/build/esm/integrations/tracing/prisma/index.js.map +1 -0
  490. package/build/esm/integrations/tracing/prisma/vendored/active-tracing-helper.js +117 -0
  491. package/build/esm/integrations/tracing/prisma/vendored/active-tracing-helper.js.map +1 -0
  492. package/build/esm/integrations/tracing/prisma/vendored/constants.js +9 -0
  493. package/build/esm/integrations/tracing/prisma/vendored/constants.js.map +1 -0
  494. package/build/esm/integrations/tracing/prisma/vendored/global.js +24 -0
  495. package/build/esm/integrations/tracing/prisma/vendored/global.js.map +1 -0
  496. package/build/esm/integrations/tracing/prisma/vendored/instrumentation.js +36 -0
  497. package/build/esm/integrations/tracing/prisma/vendored/instrumentation.js.map +1 -0
  498. package/build/esm/integrations/tracing/redis/index.js +15 -72
  499. package/build/esm/integrations/tracing/redis/index.js.map +1 -1
  500. package/build/esm/integrations/tracing/redis/redis-dc-subscriber.js +42 -77
  501. package/build/esm/integrations/tracing/redis/redis-dc-subscriber.js.map +1 -1
  502. package/build/esm/integrations/tracing/redis/vendored/ioredis-instrumentation.js +53 -98
  503. package/build/esm/integrations/tracing/redis/vendored/ioredis-instrumentation.js.map +1 -1
  504. package/build/esm/integrations/tracing/redis/vendored/redis-common.js +9 -49
  505. package/build/esm/integrations/tracing/redis/vendored/redis-common.js.map +1 -1
  506. package/build/esm/integrations/tracing/redis/vendored/redis-instrumentation.js +175 -282
  507. package/build/esm/integrations/tracing/redis/vendored/redis-instrumentation.js.map +1 -1
  508. package/build/esm/integrations/tracing/redis/vendored/semconv.js +7 -36
  509. package/build/esm/integrations/tracing/redis/vendored/semconv.js.map +1 -1
  510. package/build/esm/integrations/tracing/tedious/index.js +42 -0
  511. package/build/esm/integrations/tracing/tedious/index.js.map +1 -0
  512. package/build/esm/integrations/tracing/tedious/vendored/instrumentation.js +202 -0
  513. package/build/esm/integrations/tracing/tedious/vendored/instrumentation.js.map +1 -0
  514. package/build/esm/integrations/tracing/tedious/vendored/semconv.js +11 -0
  515. package/build/esm/integrations/tracing/tedious/vendored/semconv.js.map +1 -0
  516. package/build/esm/integrations/tracing/tedious/vendored/utils.js +26 -0
  517. package/build/esm/integrations/tracing/tedious/vendored/utils.js.map +1 -0
  518. package/build/esm/integrations/tracing/utils/sql-common.js +41 -0
  519. package/build/esm/integrations/tracing/utils/sql-common.js.map +1 -0
  520. package/build/esm/integrations/tracing/vercelai/constants.js +1 -1
  521. package/build/esm/integrations/tracing/vercelai/index.js +3 -50
  522. package/build/esm/integrations/tracing/vercelai/index.js.map +1 -1
  523. package/build/esm/integrations/tracing/vercelai/instrumentation.js +58 -157
  524. package/build/esm/integrations/tracing/vercelai/instrumentation.js.map +1 -1
  525. package/build/esm/package.json +1 -1
  526. package/build/esm/preload.js +1 -14
  527. package/build/esm/preload.js.map +1 -1
  528. package/build/esm/sdk/index.js +6 -34
  529. package/build/esm/sdk/index.js.map +1 -1
  530. package/build/esm/sdk/initOtel.js +13 -51
  531. package/build/esm/sdk/initOtel.js.map +1 -1
  532. package/build/esm/utils/redisCache.js +24 -52
  533. package/build/esm/utils/redisCache.js.map +1 -1
  534. package/build/types/integrations/{fs.d.ts → fs/index.d.ts} +1 -1
  535. package/build/types/integrations/fs/index.d.ts.map +1 -0
  536. package/build/types/integrations/fs/vendored/constants.d.ts +5 -0
  537. package/build/types/integrations/fs/vendored/constants.d.ts.map +1 -0
  538. package/build/types/integrations/fs/vendored/instrumentation.d.ts +15 -0
  539. package/build/types/integrations/fs/vendored/instrumentation.d.ts.map +1 -0
  540. package/build/types/integrations/fs/vendored/types.d.ts +29 -0
  541. package/build/types/integrations/fs/vendored/types.d.ts.map +1 -0
  542. package/build/types/integrations/fs/vendored/utils.d.ts +10 -0
  543. package/build/types/integrations/fs/vendored/utils.d.ts.map +1 -0
  544. package/build/{types-ts3.8/integrations/tracing/amqplib.d.ts → types/integrations/tracing/amqplib/index.d.ts} +20 -20
  545. package/build/types/integrations/tracing/amqplib/index.d.ts.map +1 -0
  546. package/build/types/integrations/tracing/amqplib/vendored/amqplib-types.d.ts +44 -0
  547. package/build/types/integrations/tracing/amqplib/vendored/amqplib-types.d.ts.map +1 -0
  548. package/build/types/integrations/tracing/amqplib/vendored/amqplib.d.ts +26 -0
  549. package/build/types/integrations/tracing/amqplib/vendored/amqplib.d.ts.map +1 -0
  550. package/build/types/integrations/tracing/amqplib/vendored/semconv-obsolete.d.ts +63 -0
  551. package/build/types/integrations/tracing/amqplib/vendored/semconv-obsolete.d.ts.map +1 -0
  552. package/build/types/integrations/tracing/amqplib/vendored/semconv.d.ts +41 -0
  553. package/build/types/integrations/tracing/amqplib/vendored/semconv.d.ts.map +1 -0
  554. package/build/types/integrations/tracing/amqplib/vendored/types.d.ts +130 -0
  555. package/build/types/integrations/tracing/amqplib/vendored/types.d.ts.map +1 -0
  556. package/build/types/integrations/tracing/amqplib/vendored/utils.d.ts +35 -0
  557. package/build/types/integrations/tracing/amqplib/vendored/utils.d.ts.map +1 -0
  558. package/build/types/integrations/tracing/{connect.d.ts → connect/index.d.ts} +2 -2
  559. package/build/types/integrations/tracing/connect/index.d.ts.map +1 -0
  560. package/build/types/integrations/tracing/connect/vendored/enums/AttributeNames.d.ts +13 -0
  561. package/build/types/integrations/tracing/connect/vendored/enums/AttributeNames.d.ts.map +1 -0
  562. package/build/types/integrations/tracing/connect/vendored/instrumentation.d.ts +18 -0
  563. package/build/types/integrations/tracing/connect/vendored/instrumentation.d.ts.map +1 -0
  564. package/build/types/integrations/tracing/connect/vendored/internal-types.d.ts +31 -0
  565. package/build/types/integrations/tracing/connect/vendored/internal-types.d.ts.map +1 -0
  566. package/build/types/integrations/tracing/connect/vendored/utils.d.ts +5 -0
  567. package/build/types/integrations/tracing/connect/vendored/utils.d.ts.map +1 -0
  568. package/build/types/integrations/tracing/{dataloader.d.ts → dataloader/index.d.ts} +2 -2
  569. package/build/types/integrations/tracing/dataloader/index.d.ts.map +1 -0
  570. package/build/types/integrations/tracing/dataloader/vendored/dataloader-types.d.ts +14 -0
  571. package/build/types/integrations/tracing/dataloader/vendored/dataloader-types.d.ts.map +1 -0
  572. package/build/types/integrations/tracing/dataloader/vendored/instrumentation.d.ts +21 -0
  573. package/build/types/integrations/tracing/dataloader/vendored/instrumentation.d.ts.map +1 -0
  574. package/build/types/integrations/tracing/dataloader/vendored/types.d.ts +10 -0
  575. package/build/types/integrations/tracing/dataloader/vendored/types.d.ts.map +1 -0
  576. package/build/types/integrations/tracing/fastify/vendored/instrumentation.d.ts +27 -0
  577. package/build/types/integrations/tracing/fastify/vendored/instrumentation.d.ts.map +1 -0
  578. package/build/{types-ts3.8/integrations/tracing/genericPool.d.ts → types/integrations/tracing/genericPool/index.d.ts} +20 -20
  579. package/build/types/integrations/tracing/genericPool/index.d.ts.map +1 -0
  580. package/build/types/integrations/tracing/genericPool/vendored/generic-pool-types.d.ts +5 -0
  581. package/build/types/integrations/tracing/genericPool/vendored/generic-pool-types.d.ts.map +1 -0
  582. package/build/types/integrations/tracing/genericPool/vendored/instrumentation.d.ts +10 -0
  583. package/build/types/integrations/tracing/genericPool/vendored/instrumentation.d.ts.map +1 -0
  584. package/build/types/integrations/tracing/{graphql.d.ts → graphql/index.d.ts} +2 -2
  585. package/build/types/integrations/tracing/graphql/index.d.ts.map +1 -0
  586. package/build/types/integrations/tracing/graphql/vendored/enum.d.ts +38 -0
  587. package/build/types/integrations/tracing/graphql/vendored/enum.d.ts.map +1 -0
  588. package/build/types/integrations/tracing/graphql/vendored/enums/AttributeNames.d.ts +12 -0
  589. package/build/types/integrations/tracing/graphql/vendored/enums/AttributeNames.d.ts.map +1 -0
  590. package/build/types/integrations/tracing/graphql/vendored/graphql-types.d.ts +136 -0
  591. package/build/types/integrations/tracing/graphql/vendored/graphql-types.d.ts.map +1 -0
  592. package/build/types/integrations/tracing/graphql/vendored/instrumentation.d.ts +20 -0
  593. package/build/types/integrations/tracing/graphql/vendored/instrumentation.d.ts.map +1 -0
  594. package/build/types/integrations/tracing/graphql/vendored/internal-types.d.ts +63 -0
  595. package/build/types/integrations/tracing/graphql/vendored/internal-types.d.ts.map +1 -0
  596. package/build/types/integrations/tracing/graphql/vendored/symbols.d.ts +3 -0
  597. package/build/types/integrations/tracing/graphql/vendored/symbols.d.ts.map +1 -0
  598. package/build/types/integrations/tracing/graphql/vendored/types.d.ts +71 -0
  599. package/build/types/integrations/tracing/graphql/vendored/types.d.ts.map +1 -0
  600. package/build/types/integrations/tracing/graphql/vendored/utils.d.ts +17 -0
  601. package/build/types/integrations/tracing/graphql/vendored/utils.d.ts.map +1 -0
  602. package/build/types/integrations/tracing/hapi/index.d.ts +1 -1
  603. package/build/types/integrations/tracing/hapi/index.d.ts.map +1 -1
  604. package/build/types/integrations/tracing/hapi/vendored/enums/AttributeNames.d.ts +6 -0
  605. package/build/types/integrations/tracing/hapi/vendored/enums/AttributeNames.d.ts.map +1 -0
  606. package/build/types/integrations/tracing/hapi/vendored/hapi-types.d.ts +70 -0
  607. package/build/types/integrations/tracing/hapi/vendored/hapi-types.d.ts.map +1 -0
  608. package/build/types/integrations/tracing/hapi/vendored/instrumentation.d.ts +72 -0
  609. package/build/types/integrations/tracing/hapi/vendored/instrumentation.d.ts.map +1 -0
  610. package/build/types/integrations/tracing/hapi/vendored/internal-types.d.ts +32 -0
  611. package/build/types/integrations/tracing/hapi/vendored/internal-types.d.ts.map +1 -0
  612. package/build/types/integrations/tracing/hapi/vendored/semconv.d.ts +13 -0
  613. package/build/types/integrations/tracing/hapi/vendored/semconv.d.ts.map +1 -0
  614. package/build/types/integrations/tracing/hapi/vendored/utils.d.ts +19 -0
  615. package/build/types/integrations/tracing/hapi/vendored/utils.d.ts.map +1 -0
  616. package/build/types/integrations/tracing/{kafka.d.ts → kafka/index.d.ts} +2 -2
  617. package/build/types/integrations/tracing/kafka/index.d.ts.map +1 -0
  618. package/build/types/integrations/tracing/kafka/vendored/instrumentation.d.ts +25 -0
  619. package/build/types/integrations/tracing/kafka/vendored/instrumentation.d.ts.map +1 -0
  620. package/build/types/integrations/tracing/kafka/vendored/internal-types.d.ts +9 -0
  621. package/build/types/integrations/tracing/kafka/vendored/internal-types.d.ts.map +1 -0
  622. package/build/types/integrations/tracing/kafka/vendored/kafkajs-types.d.ts +111 -0
  623. package/build/types/integrations/tracing/kafka/vendored/kafkajs-types.d.ts.map +1 -0
  624. package/build/types/integrations/tracing/kafka/vendored/propagator.d.ts +3 -0
  625. package/build/types/integrations/tracing/kafka/vendored/propagator.d.ts.map +1 -0
  626. package/build/types/integrations/tracing/kafka/vendored/semconv.d.ts +131 -0
  627. package/build/types/integrations/tracing/kafka/vendored/semconv.d.ts.map +1 -0
  628. package/build/types/integrations/tracing/kafka/vendored/types.d.ts +26 -0
  629. package/build/types/integrations/tracing/kafka/vendored/types.d.ts.map +1 -0
  630. package/build/types/integrations/tracing/{knex.d.ts → knex/index.d.ts} +2 -2
  631. package/build/types/integrations/tracing/knex/index.d.ts.map +1 -0
  632. package/build/types/integrations/tracing/knex/vendored/constants.d.ts +3 -0
  633. package/build/types/integrations/tracing/knex/vendored/constants.d.ts.map +1 -0
  634. package/build/types/integrations/tracing/knex/vendored/instrumentation.d.ts +14 -0
  635. package/build/types/integrations/tracing/knex/vendored/instrumentation.d.ts.map +1 -0
  636. package/build/types/integrations/tracing/knex/vendored/semconv.d.ts +38 -0
  637. package/build/types/integrations/tracing/knex/vendored/semconv.d.ts.map +1 -0
  638. package/build/types/integrations/tracing/knex/vendored/types.d.ts +8 -0
  639. package/build/types/integrations/tracing/knex/vendored/types.d.ts.map +1 -0
  640. package/build/types/integrations/tracing/knex/vendored/utils.d.ts +15 -0
  641. package/build/types/integrations/tracing/knex/vendored/utils.d.ts.map +1 -0
  642. package/build/types/integrations/tracing/{koa.d.ts → koa/index.d.ts} +2 -2
  643. package/build/types/integrations/tracing/koa/index.d.ts.map +1 -0
  644. package/build/types/integrations/tracing/koa/vendored/enums/AttributeNames.d.ts +5 -0
  645. package/build/types/integrations/tracing/koa/vendored/enums/AttributeNames.d.ts.map +1 -0
  646. package/build/types/integrations/tracing/koa/vendored/instrumentation.d.ts +32 -0
  647. package/build/types/integrations/tracing/koa/vendored/instrumentation.d.ts.map +1 -0
  648. package/build/types/integrations/tracing/koa/vendored/internal-types.d.ts +34 -0
  649. package/build/types/integrations/tracing/koa/vendored/internal-types.d.ts.map +1 -0
  650. package/build/types/integrations/tracing/koa/vendored/types.d.ts +50 -0
  651. package/build/types/integrations/tracing/koa/vendored/types.d.ts.map +1 -0
  652. package/build/types/integrations/tracing/koa/vendored/utils.d.ts +15 -0
  653. package/build/types/integrations/tracing/koa/vendored/utils.d.ts.map +1 -0
  654. package/build/types/integrations/tracing/langchain/instrumentation.d.ts.map +1 -1
  655. package/build/{types-ts3.8/integrations/tracing/lrumemoizer.d.ts → types/integrations/tracing/lrumemoizer/index.d.ts} +19 -19
  656. package/build/types/integrations/tracing/lrumemoizer/index.d.ts.map +1 -0
  657. package/build/types/integrations/tracing/lrumemoizer/vendored/instrumentation.d.ts +6 -0
  658. package/build/types/integrations/tracing/lrumemoizer/vendored/instrumentation.d.ts.map +1 -0
  659. package/build/types/integrations/tracing/{mongo.d.ts → mongo/index.d.ts} +2 -2
  660. package/build/types/integrations/tracing/mongo/index.d.ts.map +1 -0
  661. package/build/types/integrations/tracing/mongo/vendored/instrumentation.d.ts +79 -0
  662. package/build/types/integrations/tracing/mongo/vendored/instrumentation.d.ts.map +1 -0
  663. package/build/types/integrations/tracing/mongo/vendored/internal-types.d.ts +121 -0
  664. package/build/types/integrations/tracing/mongo/vendored/internal-types.d.ts.map +1 -0
  665. package/build/types/integrations/tracing/mongo/vendored/semconv.d.ts +107 -0
  666. package/build/types/integrations/tracing/mongo/vendored/semconv.d.ts.map +1 -0
  667. package/build/types/integrations/tracing/mongo/vendored/types.d.ts +51 -0
  668. package/build/types/integrations/tracing/mongo/vendored/types.d.ts.map +1 -0
  669. package/build/{types-ts3.8/integrations/tracing/mongoose.d.ts → types/integrations/tracing/mongoose/index.d.ts} +20 -20
  670. package/build/types/integrations/tracing/mongoose/index.d.ts.map +1 -0
  671. package/build/types/integrations/tracing/mongoose/vendored/mongoose-types.d.ts +30 -0
  672. package/build/types/integrations/tracing/mongoose/vendored/mongoose-types.d.ts.map +1 -0
  673. package/build/types/integrations/tracing/mongoose/vendored/mongoose.d.ts +24 -0
  674. package/build/types/integrations/tracing/mongoose/vendored/mongoose.d.ts.map +1 -0
  675. package/build/types/integrations/tracing/mongoose/vendored/semconv.d.ts +71 -0
  676. package/build/types/integrations/tracing/mongoose/vendored/semconv.d.ts.map +1 -0
  677. package/build/types/integrations/tracing/mongoose/vendored/types.d.ts +36 -0
  678. package/build/types/integrations/tracing/mongoose/vendored/types.d.ts.map +1 -0
  679. package/build/types/integrations/tracing/mongoose/vendored/utils.d.ts +8 -0
  680. package/build/types/integrations/tracing/mongoose/vendored/utils.d.ts.map +1 -0
  681. package/build/types/integrations/tracing/{mysql.d.ts → mysql/index.d.ts} +2 -2
  682. package/build/types/integrations/tracing/mysql/index.d.ts.map +1 -0
  683. package/build/types/integrations/tracing/mysql/vendored/AttributeNames.d.ts +4 -0
  684. package/build/types/integrations/tracing/mysql/vendored/AttributeNames.d.ts.map +1 -0
  685. package/build/types/integrations/tracing/mysql/vendored/instrumentation.d.ts +28 -0
  686. package/build/types/integrations/tracing/mysql/vendored/instrumentation.d.ts.map +1 -0
  687. package/build/types/integrations/tracing/mysql/vendored/mysql-types.d.ts +78 -0
  688. package/build/types/integrations/tracing/mysql/vendored/mysql-types.d.ts.map +1 -0
  689. package/build/types/integrations/tracing/mysql/vendored/semconv.d.ts +88 -0
  690. package/build/types/integrations/tracing/mysql/vendored/semconv.d.ts.map +1 -0
  691. package/build/types/integrations/tracing/mysql/vendored/types.d.ts +9 -0
  692. package/build/types/integrations/tracing/mysql/vendored/types.d.ts.map +1 -0
  693. package/build/types/integrations/tracing/mysql/vendored/utils.d.ts +25 -0
  694. package/build/types/integrations/tracing/mysql/vendored/utils.d.ts.map +1 -0
  695. package/build/types/integrations/tracing/{mysql2.d.ts → mysql2/index.d.ts} +2 -2
  696. package/build/types/integrations/tracing/mysql2/index.d.ts.map +1 -0
  697. package/build/types/integrations/tracing/mysql2/vendored/instrumentation.d.ts +12 -0
  698. package/build/types/integrations/tracing/mysql2/vendored/instrumentation.d.ts.map +1 -0
  699. package/build/types/integrations/tracing/mysql2/vendored/mysql2-types.d.ts +39 -0
  700. package/build/types/integrations/tracing/mysql2/vendored/mysql2-types.d.ts.map +1 -0
  701. package/build/types/integrations/tracing/mysql2/vendored/semconv.d.ts +9 -0
  702. package/build/types/integrations/tracing/mysql2/vendored/semconv.d.ts.map +1 -0
  703. package/build/types/integrations/tracing/mysql2/vendored/types.d.ts +18 -0
  704. package/build/types/integrations/tracing/mysql2/vendored/types.d.ts.map +1 -0
  705. package/build/types/integrations/tracing/mysql2/vendored/utils.d.ts +27 -0
  706. package/build/types/integrations/tracing/mysql2/vendored/utils.d.ts.map +1 -0
  707. package/build/types/integrations/tracing/{postgres.d.ts → postgres/index.d.ts} +2 -2
  708. package/build/types/integrations/tracing/postgres/index.d.ts.map +1 -0
  709. package/build/types/integrations/tracing/postgres/vendored/enums/AttributeNames.d.ts +7 -0
  710. package/build/types/integrations/tracing/postgres/vendored/enums/AttributeNames.d.ts.map +1 -0
  711. package/build/types/integrations/tracing/postgres/vendored/enums/SpanNames.d.ts +6 -0
  712. package/build/types/integrations/tracing/postgres/vendored/enums/SpanNames.d.ts.map +1 -0
  713. package/build/types/integrations/tracing/postgres/vendored/instrumentation.d.ts +20 -0
  714. package/build/types/integrations/tracing/postgres/vendored/instrumentation.d.ts.map +1 -0
  715. package/build/types/integrations/tracing/postgres/vendored/internal-types.d.ts +35 -0
  716. package/build/types/integrations/tracing/postgres/vendored/internal-types.d.ts.map +1 -0
  717. package/build/types/integrations/tracing/postgres/vendored/pg-pool-types.d.ts +20 -0
  718. package/build/types/integrations/tracing/postgres/vendored/pg-pool-types.d.ts.map +1 -0
  719. package/build/types/integrations/tracing/postgres/vendored/pg-types.d.ts +54 -0
  720. package/build/types/integrations/tracing/postgres/vendored/pg-types.d.ts.map +1 -0
  721. package/build/types/integrations/tracing/postgres/vendored/semconv.d.ts +112 -0
  722. package/build/types/integrations/tracing/postgres/vendored/semconv.d.ts.map +1 -0
  723. package/build/types/integrations/tracing/postgres/vendored/types.d.ts +65 -0
  724. package/build/types/integrations/tracing/postgres/vendored/types.d.ts.map +1 -0
  725. package/build/types/integrations/tracing/postgres/vendored/utils.d.ts +69 -0
  726. package/build/types/integrations/tracing/postgres/vendored/utils.d.ts.map +1 -0
  727. package/build/types/integrations/tracing/{prisma.d.ts → prisma/index.d.ts} +2 -2
  728. package/build/types/integrations/tracing/prisma/index.d.ts.map +1 -0
  729. package/build/types/integrations/tracing/prisma/vendored/active-tracing-helper.d.ts +18 -0
  730. package/build/types/integrations/tracing/prisma/vendored/active-tracing-helper.d.ts.map +1 -0
  731. package/build/types/integrations/tracing/prisma/vendored/constants.d.ts +5 -0
  732. package/build/types/integrations/tracing/prisma/vendored/constants.d.ts.map +1 -0
  733. package/build/types/integrations/tracing/prisma/vendored/global.d.ts +5 -0
  734. package/build/types/integrations/tracing/prisma/vendored/global.d.ts.map +1 -0
  735. package/build/types/integrations/tracing/prisma/vendored/instrumentation.d.ts +17 -0
  736. package/build/types/integrations/tracing/prisma/vendored/instrumentation.d.ts.map +1 -0
  737. package/build/types/integrations/tracing/prisma/vendored/types.d.ts +52 -0
  738. package/build/types/integrations/tracing/prisma/vendored/types.d.ts.map +1 -0
  739. package/build/types/integrations/tracing/prisma/vendored/v5-tracing-helper.d.ts.map +1 -0
  740. package/build/types/integrations/tracing/prisma/vendored/v6-tracing-helper.d.ts.map +1 -0
  741. package/build/types/integrations/tracing/{tedious.d.ts → tedious/index.d.ts} +2 -2
  742. package/build/types/integrations/tracing/tedious/index.d.ts.map +1 -0
  743. package/build/types/integrations/tracing/tedious/vendored/instrumentation.d.ts +22 -0
  744. package/build/types/integrations/tracing/tedious/vendored/instrumentation.d.ts.map +1 -0
  745. package/build/types/integrations/tracing/tedious/vendored/semconv.d.ts +80 -0
  746. package/build/types/integrations/tracing/tedious/vendored/semconv.d.ts.map +1 -0
  747. package/build/types/integrations/tracing/tedious/vendored/tedious-types.d.ts +21 -0
  748. package/build/types/integrations/tracing/tedious/vendored/tedious-types.d.ts.map +1 -0
  749. package/build/types/integrations/tracing/tedious/vendored/types.d.ts +10 -0
  750. package/build/types/integrations/tracing/tedious/vendored/types.d.ts.map +1 -0
  751. package/build/types/integrations/tracing/tedious/vendored/utils.d.ts +9 -0
  752. package/build/types/integrations/tracing/tedious/vendored/utils.d.ts.map +1 -0
  753. package/build/types/integrations/tracing/utils/sql-common.d.ts +3 -0
  754. package/build/types/integrations/tracing/utils/sql-common.d.ts.map +1 -0
  755. package/build/types-ts3.8/integrations/{fs.d.ts → fs/index.d.ts} +1 -1
  756. package/build/types-ts3.8/integrations/fs/vendored/constants.d.ts +5 -0
  757. package/build/types-ts3.8/integrations/fs/vendored/instrumentation.d.ts +15 -0
  758. package/build/types-ts3.8/integrations/fs/vendored/types.d.ts +29 -0
  759. package/build/types-ts3.8/integrations/fs/vendored/utils.d.ts +15 -0
  760. package/build/{types/integrations/tracing/amqplib.d.ts → types-ts3.8/integrations/tracing/amqplib/index.d.ts} +20 -20
  761. package/build/types-ts3.8/integrations/tracing/amqplib/vendored/amqplib-types.d.ts +44 -0
  762. package/build/types-ts3.8/integrations/tracing/amqplib/vendored/amqplib.d.ts +26 -0
  763. package/build/types-ts3.8/integrations/tracing/amqplib/vendored/semconv-obsolete.d.ts +63 -0
  764. package/build/types-ts3.8/integrations/tracing/amqplib/vendored/semconv.d.ts +41 -0
  765. package/build/types-ts3.8/integrations/tracing/amqplib/vendored/types.d.ts +130 -0
  766. package/build/types-ts3.8/integrations/tracing/amqplib/vendored/utils.d.ts +35 -0
  767. package/build/types-ts3.8/integrations/tracing/{connect.d.ts → connect/index.d.ts} +2 -2
  768. package/build/types-ts3.8/integrations/tracing/connect/vendored/enums/AttributeNames.d.ts +13 -0
  769. package/build/types-ts3.8/integrations/tracing/connect/vendored/instrumentation.d.ts +18 -0
  770. package/build/types-ts3.8/integrations/tracing/connect/vendored/internal-types.d.ts +36 -0
  771. package/build/types-ts3.8/integrations/tracing/connect/vendored/utils.d.ts +5 -0
  772. package/build/types-ts3.8/integrations/tracing/{dataloader.d.ts → dataloader/index.d.ts} +2 -2
  773. package/build/types-ts3.8/integrations/tracing/dataloader/vendored/dataloader-types.d.ts +14 -0
  774. package/build/types-ts3.8/integrations/tracing/dataloader/vendored/instrumentation.d.ts +21 -0
  775. package/build/types-ts3.8/integrations/tracing/dataloader/vendored/types.d.ts +10 -0
  776. package/build/types-ts3.8/integrations/tracing/fastify/vendored/instrumentation.d.ts +27 -0
  777. package/build/{types/integrations/tracing/genericPool.d.ts → types-ts3.8/integrations/tracing/genericPool/index.d.ts} +20 -20
  778. package/build/types-ts3.8/integrations/tracing/genericPool/vendored/generic-pool-types.d.ts +5 -0
  779. package/build/types-ts3.8/integrations/tracing/genericPool/vendored/instrumentation.d.ts +10 -0
  780. package/build/types-ts3.8/integrations/tracing/{graphql.d.ts → graphql/index.d.ts} +2 -2
  781. package/build/types-ts3.8/integrations/tracing/graphql/vendored/enum.d.ts +38 -0
  782. package/build/types-ts3.8/integrations/tracing/graphql/vendored/enums/AttributeNames.d.ts +12 -0
  783. package/build/types-ts3.8/integrations/tracing/graphql/vendored/graphql-types.d.ts +136 -0
  784. package/build/types-ts3.8/integrations/tracing/graphql/vendored/instrumentation.d.ts +20 -0
  785. package/build/types-ts3.8/integrations/tracing/graphql/vendored/internal-types.d.ts +63 -0
  786. package/build/types-ts3.8/integrations/tracing/graphql/vendored/symbols.d.ts +3 -0
  787. package/build/types-ts3.8/integrations/tracing/graphql/vendored/types.d.ts +71 -0
  788. package/build/types-ts3.8/integrations/tracing/graphql/vendored/utils.d.ts +17 -0
  789. package/build/types-ts3.8/integrations/tracing/hapi/index.d.ts +1 -1
  790. package/build/types-ts3.8/integrations/tracing/hapi/vendored/enums/AttributeNames.d.ts +6 -0
  791. package/build/types-ts3.8/integrations/tracing/hapi/vendored/hapi-types.d.ts +70 -0
  792. package/build/types-ts3.8/integrations/tracing/hapi/vendored/instrumentation.d.ts +72 -0
  793. package/build/types-ts3.8/integrations/tracing/hapi/vendored/internal-types.d.ts +32 -0
  794. package/build/types-ts3.8/integrations/tracing/hapi/vendored/semconv.d.ts +13 -0
  795. package/build/types-ts3.8/integrations/tracing/hapi/vendored/utils.d.ts +19 -0
  796. package/build/types-ts3.8/integrations/tracing/{kafka.d.ts → kafka/index.d.ts} +2 -2
  797. package/build/types-ts3.8/integrations/tracing/kafka/vendored/instrumentation.d.ts +25 -0
  798. package/build/types-ts3.8/integrations/tracing/kafka/vendored/internal-types.d.ts +9 -0
  799. package/build/types-ts3.8/integrations/tracing/kafka/vendored/kafkajs-types.d.ts +111 -0
  800. package/build/types-ts3.8/integrations/tracing/kafka/vendored/propagator.d.ts +3 -0
  801. package/build/types-ts3.8/integrations/tracing/kafka/vendored/semconv.d.ts +131 -0
  802. package/build/types-ts3.8/integrations/tracing/kafka/vendored/types.d.ts +26 -0
  803. package/build/types-ts3.8/integrations/tracing/{knex.d.ts → knex/index.d.ts} +2 -2
  804. package/build/types-ts3.8/integrations/tracing/knex/vendored/constants.d.ts +3 -0
  805. package/build/types-ts3.8/integrations/tracing/knex/vendored/instrumentation.d.ts +14 -0
  806. package/build/types-ts3.8/integrations/tracing/knex/vendored/semconv.d.ts +38 -0
  807. package/build/types-ts3.8/integrations/tracing/knex/vendored/types.d.ts +8 -0
  808. package/build/types-ts3.8/integrations/tracing/knex/vendored/utils.d.ts +15 -0
  809. package/build/types-ts3.8/integrations/tracing/{koa.d.ts → koa/index.d.ts} +2 -2
  810. package/build/types-ts3.8/integrations/tracing/koa/vendored/enums/AttributeNames.d.ts +5 -0
  811. package/build/types-ts3.8/integrations/tracing/koa/vendored/instrumentation.d.ts +32 -0
  812. package/build/types-ts3.8/integrations/tracing/koa/vendored/internal-types.d.ts +34 -0
  813. package/build/types-ts3.8/integrations/tracing/koa/vendored/types.d.ts +50 -0
  814. package/build/types-ts3.8/integrations/tracing/koa/vendored/utils.d.ts +15 -0
  815. package/build/{types/integrations/tracing/lrumemoizer.d.ts → types-ts3.8/integrations/tracing/lrumemoizer/index.d.ts} +19 -19
  816. package/build/types-ts3.8/integrations/tracing/lrumemoizer/vendored/instrumentation.d.ts +6 -0
  817. package/build/types-ts3.8/integrations/tracing/{mongo.d.ts → mongo/index.d.ts} +2 -2
  818. package/build/types-ts3.8/integrations/tracing/mongo/vendored/instrumentation.d.ts +79 -0
  819. package/build/types-ts3.8/integrations/tracing/mongo/vendored/internal-types.d.ts +121 -0
  820. package/build/types-ts3.8/integrations/tracing/mongo/vendored/semconv.d.ts +107 -0
  821. package/build/types-ts3.8/integrations/tracing/mongo/vendored/types.d.ts +51 -0
  822. package/build/{types/integrations/tracing/mongoose.d.ts → types-ts3.8/integrations/tracing/mongoose/index.d.ts} +20 -20
  823. package/build/types-ts3.8/integrations/tracing/mongoose/vendored/mongoose-types.d.ts +30 -0
  824. package/build/types-ts3.8/integrations/tracing/mongoose/vendored/mongoose.d.ts +24 -0
  825. package/build/types-ts3.8/integrations/tracing/mongoose/vendored/semconv.d.ts +71 -0
  826. package/build/types-ts3.8/integrations/tracing/mongoose/vendored/types.d.ts +36 -0
  827. package/build/types-ts3.8/integrations/tracing/mongoose/vendored/utils.d.ts +8 -0
  828. package/build/types-ts3.8/integrations/tracing/{mysql.d.ts → mysql/index.d.ts} +2 -2
  829. package/build/types-ts3.8/integrations/tracing/mysql/vendored/AttributeNames.d.ts +4 -0
  830. package/build/types-ts3.8/integrations/tracing/mysql/vendored/instrumentation.d.ts +28 -0
  831. package/build/types-ts3.8/integrations/tracing/mysql/vendored/mysql-types.d.ts +78 -0
  832. package/build/types-ts3.8/integrations/tracing/mysql/vendored/semconv.d.ts +88 -0
  833. package/build/types-ts3.8/integrations/tracing/mysql/vendored/types.d.ts +9 -0
  834. package/build/types-ts3.8/integrations/tracing/mysql/vendored/utils.d.ts +25 -0
  835. package/build/types-ts3.8/integrations/tracing/{mysql2.d.ts → mysql2/index.d.ts} +2 -2
  836. package/build/types-ts3.8/integrations/tracing/mysql2/vendored/instrumentation.d.ts +12 -0
  837. package/build/types-ts3.8/integrations/tracing/mysql2/vendored/mysql2-types.d.ts +39 -0
  838. package/build/types-ts3.8/integrations/tracing/mysql2/vendored/semconv.d.ts +9 -0
  839. package/build/types-ts3.8/integrations/tracing/mysql2/vendored/types.d.ts +18 -0
  840. package/build/types-ts3.8/integrations/tracing/mysql2/vendored/utils.d.ts +27 -0
  841. package/build/types-ts3.8/integrations/tracing/{postgres.d.ts → postgres/index.d.ts} +2 -2
  842. package/build/types-ts3.8/integrations/tracing/postgres/vendored/enums/AttributeNames.d.ts +7 -0
  843. package/build/types-ts3.8/integrations/tracing/postgres/vendored/enums/SpanNames.d.ts +6 -0
  844. package/build/types-ts3.8/integrations/tracing/postgres/vendored/instrumentation.d.ts +20 -0
  845. package/build/types-ts3.8/integrations/tracing/postgres/vendored/internal-types.d.ts +35 -0
  846. package/build/types-ts3.8/integrations/tracing/postgres/vendored/pg-pool-types.d.ts +20 -0
  847. package/build/types-ts3.8/integrations/tracing/postgres/vendored/pg-types.d.ts +54 -0
  848. package/build/types-ts3.8/integrations/tracing/postgres/vendored/semconv.d.ts +112 -0
  849. package/build/types-ts3.8/integrations/tracing/postgres/vendored/types.d.ts +65 -0
  850. package/build/types-ts3.8/integrations/tracing/postgres/vendored/utils.d.ts +69 -0
  851. package/build/types-ts3.8/integrations/tracing/{prisma.d.ts → prisma/index.d.ts} +2 -2
  852. package/build/types-ts3.8/integrations/tracing/prisma/vendored/active-tracing-helper.d.ts +18 -0
  853. package/build/types-ts3.8/integrations/tracing/prisma/vendored/constants.d.ts +5 -0
  854. package/build/types-ts3.8/integrations/tracing/prisma/vendored/global.d.ts +5 -0
  855. package/build/types-ts3.8/integrations/tracing/prisma/vendored/instrumentation.d.ts +17 -0
  856. package/build/types-ts3.8/integrations/tracing/prisma/vendored/types.d.ts +55 -0
  857. package/build/types-ts3.8/integrations/tracing/{tedious.d.ts → tedious/index.d.ts} +2 -2
  858. package/build/types-ts3.8/integrations/tracing/tedious/vendored/instrumentation.d.ts +22 -0
  859. package/build/types-ts3.8/integrations/tracing/tedious/vendored/semconv.d.ts +80 -0
  860. package/build/types-ts3.8/integrations/tracing/tedious/vendored/tedious-types.d.ts +21 -0
  861. package/build/types-ts3.8/integrations/tracing/tedious/vendored/types.d.ts +10 -0
  862. package/build/types-ts3.8/integrations/tracing/tedious/vendored/utils.d.ts +9 -0
  863. package/build/types-ts3.8/integrations/tracing/utils/sql-common.d.ts +3 -0
  864. package/package.json +4 -24
  865. package/build/cjs/integrations/fs.js +0 -142
  866. package/build/cjs/integrations/fs.js.map +0 -1
  867. package/build/cjs/integrations/tracing/amqplib.js +0 -47
  868. package/build/cjs/integrations/tracing/amqplib.js.map +0 -1
  869. package/build/cjs/integrations/tracing/connect.js +0 -110
  870. package/build/cjs/integrations/tracing/connect.js.map +0 -1
  871. package/build/cjs/integrations/tracing/dataloader.js +0 -72
  872. package/build/cjs/integrations/tracing/dataloader.js.map +0 -1
  873. package/build/cjs/integrations/tracing/genericPool.js +0 -59
  874. package/build/cjs/integrations/tracing/genericPool.js.map +0 -1
  875. package/build/cjs/integrations/tracing/graphql.js +0 -127
  876. package/build/cjs/integrations/tracing/graphql.js.map +0 -1
  877. package/build/cjs/integrations/tracing/kafka.js +0 -48
  878. package/build/cjs/integrations/tracing/kafka.js.map +0 -1
  879. package/build/cjs/integrations/tracing/knex.js +0 -57
  880. package/build/cjs/integrations/tracing/knex.js.map +0 -1
  881. package/build/cjs/integrations/tracing/koa.js +0 -138
  882. package/build/cjs/integrations/tracing/koa.js.map +0 -1
  883. package/build/cjs/integrations/tracing/lrumemoizer.js +0 -37
  884. package/build/cjs/integrations/tracing/lrumemoizer.js.map +0 -1
  885. package/build/cjs/integrations/tracing/mongo.js +0 -93
  886. package/build/cjs/integrations/tracing/mongo.js.map +0 -1
  887. package/build/cjs/integrations/tracing/mongoose.js +0 -46
  888. package/build/cjs/integrations/tracing/mongoose.js.map +0 -1
  889. package/build/cjs/integrations/tracing/mysql.js +0 -38
  890. package/build/cjs/integrations/tracing/mysql.js.map +0 -1
  891. package/build/cjs/integrations/tracing/mysql2.js +0 -46
  892. package/build/cjs/integrations/tracing/mysql2.js.map +0 -1
  893. package/build/cjs/integrations/tracing/postgres.js +0 -48
  894. package/build/cjs/integrations/tracing/postgres.js.map +0 -1
  895. package/build/cjs/integrations/tracing/prisma.js +0 -207
  896. package/build/cjs/integrations/tracing/prisma.js.map +0 -1
  897. package/build/cjs/integrations/tracing/tedious.js +0 -67
  898. package/build/cjs/integrations/tracing/tedious.js.map +0 -1
  899. package/build/esm/integrations/fs.js +0 -140
  900. package/build/esm/integrations/fs.js.map +0 -1
  901. package/build/esm/integrations/tracing/amqplib.js +0 -44
  902. package/build/esm/integrations/tracing/amqplib.js.map +0 -1
  903. package/build/esm/integrations/tracing/connect.js +0 -106
  904. package/build/esm/integrations/tracing/connect.js.map +0 -1
  905. package/build/esm/integrations/tracing/dataloader.js +0 -69
  906. package/build/esm/integrations/tracing/dataloader.js.map +0 -1
  907. package/build/esm/integrations/tracing/genericPool.js +0 -56
  908. package/build/esm/integrations/tracing/genericPool.js.map +0 -1
  909. package/build/esm/integrations/tracing/graphql.js +0 -124
  910. package/build/esm/integrations/tracing/graphql.js.map +0 -1
  911. package/build/esm/integrations/tracing/kafka.js +0 -45
  912. package/build/esm/integrations/tracing/kafka.js.map +0 -1
  913. package/build/esm/integrations/tracing/knex.js +0 -54
  914. package/build/esm/integrations/tracing/knex.js.map +0 -1
  915. package/build/esm/integrations/tracing/koa.js +0 -134
  916. package/build/esm/integrations/tracing/koa.js.map +0 -1
  917. package/build/esm/integrations/tracing/lrumemoizer.js +0 -34
  918. package/build/esm/integrations/tracing/lrumemoizer.js.map +0 -1
  919. package/build/esm/integrations/tracing/mongo.js +0 -89
  920. package/build/esm/integrations/tracing/mongo.js.map +0 -1
  921. package/build/esm/integrations/tracing/mongoose.js +0 -43
  922. package/build/esm/integrations/tracing/mongoose.js.map +0 -1
  923. package/build/esm/integrations/tracing/mysql.js +0 -35
  924. package/build/esm/integrations/tracing/mysql.js.map +0 -1
  925. package/build/esm/integrations/tracing/mysql2.js +0 -43
  926. package/build/esm/integrations/tracing/mysql2.js.map +0 -1
  927. package/build/esm/integrations/tracing/postgres.js +0 -45
  928. package/build/esm/integrations/tracing/postgres.js.map +0 -1
  929. package/build/esm/integrations/tracing/prisma.js +0 -204
  930. package/build/esm/integrations/tracing/prisma.js.map +0 -1
  931. package/build/esm/integrations/tracing/tedious.js +0 -64
  932. package/build/esm/integrations/tracing/tedious.js.map +0 -1
  933. package/build/types/integrations/fs.d.ts.map +0 -1
  934. package/build/types/integrations/tracing/amqplib.d.ts.map +0 -1
  935. package/build/types/integrations/tracing/connect.d.ts.map +0 -1
  936. package/build/types/integrations/tracing/dataloader.d.ts.map +0 -1
  937. package/build/types/integrations/tracing/genericPool.d.ts.map +0 -1
  938. package/build/types/integrations/tracing/graphql.d.ts.map +0 -1
  939. package/build/types/integrations/tracing/kafka.d.ts.map +0 -1
  940. package/build/types/integrations/tracing/knex.d.ts.map +0 -1
  941. package/build/types/integrations/tracing/koa.d.ts.map +0 -1
  942. package/build/types/integrations/tracing/lrumemoizer.d.ts.map +0 -1
  943. package/build/types/integrations/tracing/mongo.d.ts.map +0 -1
  944. package/build/types/integrations/tracing/mongoose.d.ts.map +0 -1
  945. package/build/types/integrations/tracing/mysql.d.ts.map +0 -1
  946. package/build/types/integrations/tracing/mysql2.d.ts.map +0 -1
  947. package/build/types/integrations/tracing/postgres.d.ts.map +0 -1
  948. package/build/types/integrations/tracing/prisma/vendor/v5-tracing-helper.d.ts.map +0 -1
  949. package/build/types/integrations/tracing/prisma/vendor/v6-tracing-helper.d.ts.map +0 -1
  950. package/build/types/integrations/tracing/prisma.d.ts.map +0 -1
  951. package/build/types/integrations/tracing/tedious.d.ts.map +0 -1
  952. /package/build/types/integrations/tracing/prisma/{vendor → vendored}/v5-tracing-helper.d.ts +0 -0
  953. /package/build/types/integrations/tracing/prisma/{vendor → vendored}/v6-tracing-helper.d.ts +0 -0
  954. /package/build/types-ts3.8/integrations/tracing/prisma/{vendor → vendored}/v5-tracing-helper.d.ts +0 -0
  955. /package/build/types-ts3.8/integrations/tracing/prisma/{vendor → vendored}/v6-tracing-helper.d.ts +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instrumentation.js","sources":["../../../../../../src/integrations/tracing/dataloader/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-dataloader\n * - Upstream version: @opentelemetry/instrumentation-dataloader@0.35.0\n * - Minor TypeScript strictness adjustments for this repository's compiler settings\n */\n/* eslint-disable */\n\nimport { InstrumentationBase, InstrumentationNodeModuleDefinition, isWrapped } from '@opentelemetry/instrumentation';\nimport { trace, context, Link, SpanStatusCode, SpanKind } from '@opentelemetry/api';\nimport { DataloaderInstrumentationConfig } from './types';\nimport { SDK_VERSION } from '@sentry/core';\nimport type * as Dataloader from './dataloader-types';\n\nconst MODULE_NAME = 'dataloader';\nconst PACKAGE_NAME = '@sentry/instrumentation-dataloader';\n\ntype DataloaderInternal = typeof Dataloader.prototype & {\n _batchLoadFn: Dataloader.BatchLoadFn<unknown, unknown>;\n _batch: { spanLinks?: Link[] } | null;\n};\n\ntype LoadFn = (typeof Dataloader.prototype)['load'];\ntype LoadManyFn = (typeof Dataloader.prototype)['loadMany'];\ntype PrimeFn = (typeof Dataloader.prototype)['prime'];\ntype ClearFn = (typeof Dataloader.prototype)['clear'];\ntype ClearAllFn = (typeof Dataloader.prototype)['clearAll'];\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction extractModuleExports(module: any) {\n return module[Symbol.toStringTag] === 'Module'\n ? module.default // ESM\n : module; // CommonJS\n}\n\nexport class DataloaderInstrumentation extends InstrumentationBase<DataloaderInstrumentationConfig> {\n constructor(config: DataloaderInstrumentationConfig = {}) {\n super(PACKAGE_NAME, SDK_VERSION, config);\n }\n\n protected init() {\n return [\n new InstrumentationNodeModuleDefinition(\n MODULE_NAME,\n ['>=2.0.0 <3'],\n module => {\n const dataloader = extractModuleExports(module);\n this._patchLoad(dataloader.prototype);\n this._patchLoadMany(dataloader.prototype);\n this._patchPrime(dataloader.prototype);\n this._patchClear(dataloader.prototype);\n this._patchClearAll(dataloader.prototype);\n\n return this._getPatchedConstructor(dataloader);\n },\n module => {\n const dataloader = extractModuleExports(module);\n ['load', 'loadMany', 'prime', 'clear', 'clearAll'].forEach(method => {\n if (isWrapped(dataloader.prototype[method])) {\n this._unwrap(dataloader.prototype, method);\n }\n });\n },\n ),\n ];\n }\n\n private shouldCreateSpans(): boolean {\n const config = this.getConfig();\n const hasParentSpan = trace.getSpan(context.active()) !== undefined;\n return hasParentSpan || !config.requireParentSpan;\n }\n\n private getSpanName(\n dataloader: DataloaderInternal,\n operation: 'load' | 'loadMany' | 'batch' | 'prime' | 'clear' | 'clearAll',\n ): string {\n const dataloaderName = dataloader.name;\n if (dataloaderName === undefined || dataloaderName === null) {\n return `${MODULE_NAME}.${operation}`;\n }\n\n return `${MODULE_NAME}.${operation} ${dataloaderName}`;\n }\n\n private _wrapBatchLoadFn(\n batchLoadFn: Dataloader.BatchLoadFn<unknown, unknown>,\n ): Dataloader.BatchLoadFn<unknown, unknown> {\n const instrumentation = this;\n\n return function patchedBatchLoadFn(\n this: DataloaderInternal,\n ...args: Parameters<Dataloader.BatchLoadFn<unknown, unknown>>\n ) {\n if (!instrumentation.isEnabled() || !instrumentation.shouldCreateSpans()) {\n return batchLoadFn.call(this, ...args);\n }\n\n const parent = context.active();\n const span = instrumentation.tracer.startSpan(\n instrumentation.getSpanName(this, 'batch'),\n { links: this._batch?.spanLinks as Link[] | undefined },\n parent,\n );\n\n return context.with(trace.setSpan(parent, span), () => {\n return (batchLoadFn.apply(this, args) as Promise<unknown[]>)\n .then(value => {\n span.end();\n return value;\n })\n .catch((err: Error) => {\n span.recordException(err);\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: err.message,\n });\n span.end();\n throw err;\n });\n });\n };\n }\n\n private _getPatchedConstructor(constructor: typeof Dataloader): typeof Dataloader {\n const instrumentation = this;\n const prototype = constructor.prototype;\n\n if (!instrumentation.isEnabled()) {\n return constructor;\n }\n\n function PatchedDataloader(this: DataloaderInternal, ...args: any[]) {\n // BatchLoadFn is the first constructor argument\n // https://github.com/graphql/dataloader/blob/77c2cd7ca97e8795242018ebc212ce2487e729d2/src/index.js#L47\n if (typeof args[0] === 'function') {\n if (isWrapped(args[0])) {\n instrumentation._unwrap(args, 0);\n }\n\n args[0] = instrumentation._wrapBatchLoadFn(args[0]) as Dataloader.BatchLoadFn<unknown, unknown>;\n }\n\n return (constructor as any).apply(this, args);\n }\n\n PatchedDataloader.prototype = prototype;\n return PatchedDataloader as unknown as typeof Dataloader;\n }\n\n private _patchLoad(proto: typeof Dataloader.prototype) {\n if (isWrapped(proto.load)) {\n this._unwrap(proto, 'load');\n }\n\n this._wrap(proto, 'load', this._getPatchedLoad.bind(this));\n }\n\n private _getPatchedLoad(original: LoadFn): LoadFn {\n const instrumentation = this;\n\n return function patchedLoad(this: DataloaderInternal, ...args: Parameters<typeof original>) {\n if (!instrumentation.shouldCreateSpans()) {\n return original.call(this, ...args);\n }\n\n const parent = context.active();\n const span = instrumentation.tracer.startSpan(\n instrumentation.getSpanName(this, 'load'),\n { kind: SpanKind.CLIENT },\n parent,\n );\n\n return context.with(trace.setSpan(parent, span), () => {\n const result = original\n .call(this, ...args)\n .then((value: unknown) => {\n span.end();\n return value;\n })\n .catch((err: Error) => {\n span.recordException(err);\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: err.message,\n });\n span.end();\n throw err;\n });\n\n const loader = this as DataloaderInternal;\n\n if (loader._batch) {\n if (!loader._batch.spanLinks) {\n loader._batch.spanLinks = [];\n }\n\n loader._batch.spanLinks.push({ context: span.spanContext() } as Link);\n }\n\n return result;\n });\n };\n }\n\n private _patchLoadMany(proto: typeof Dataloader.prototype) {\n if (isWrapped(proto.loadMany)) {\n this._unwrap(proto, 'loadMany');\n }\n\n this._wrap(proto, 'loadMany', this._getPatchedLoadMany.bind(this));\n }\n\n private _getPatchedLoadMany(original: LoadManyFn): LoadManyFn {\n const instrumentation = this;\n\n return function patchedLoadMany(this: DataloaderInternal, ...args: Parameters<typeof original>) {\n if (!instrumentation.shouldCreateSpans()) {\n return original.call(this, ...args);\n }\n\n const parent = context.active();\n const span = instrumentation.tracer.startSpan(\n instrumentation.getSpanName(this, 'loadMany'),\n { kind: SpanKind.CLIENT },\n parent,\n );\n\n return context.with(trace.setSpan(parent, span), () => {\n // .loadMany never rejects, as errors from internal .load\n // calls are caught by dataloader lib\n return original.call(this, ...args).then((value: unknown) => {\n span.end();\n return value;\n });\n });\n };\n }\n\n private _patchPrime(proto: typeof Dataloader.prototype) {\n if (isWrapped(proto.prime)) {\n this._unwrap(proto, 'prime');\n }\n\n this._wrap(proto, 'prime', this._getPatchedPrime.bind(this));\n }\n\n private _getPatchedPrime(original: PrimeFn): PrimeFn {\n const instrumentation = this;\n\n return function patchedPrime(this: DataloaderInternal, ...args: Parameters<typeof original>) {\n if (!instrumentation.shouldCreateSpans()) {\n return original.call(this, ...args);\n }\n\n const parent = context.active();\n const span = instrumentation.tracer.startSpan(\n instrumentation.getSpanName(this, 'prime'),\n { kind: SpanKind.CLIENT },\n parent,\n );\n\n const ret = context.with(trace.setSpan(parent, span), () => {\n return original.call(this, ...args);\n });\n\n span.end();\n\n return ret;\n };\n }\n\n private _patchClear(proto: typeof Dataloader.prototype) {\n if (isWrapped(proto.clear)) {\n this._unwrap(proto, 'clear');\n }\n\n this._wrap(proto, 'clear', this._getPatchedClear.bind(this));\n }\n\n private _getPatchedClear(original: ClearFn): ClearFn {\n const instrumentation = this;\n\n return function patchedClear(this: DataloaderInternal, ...args: Parameters<typeof original>) {\n if (!instrumentation.shouldCreateSpans()) {\n return original.call(this, ...args);\n }\n\n const parent = context.active();\n const span = instrumentation.tracer.startSpan(\n instrumentation.getSpanName(this, 'clear'),\n { kind: SpanKind.CLIENT },\n parent,\n );\n\n const ret = context.with(trace.setSpan(parent, span), () => {\n return original.call(this, ...args);\n });\n\n span.end();\n\n return ret;\n };\n }\n\n private _patchClearAll(proto: typeof Dataloader.prototype) {\n if (isWrapped(proto.clearAll)) {\n this._unwrap(proto, 'clearAll');\n }\n\n this._wrap(proto, 'clearAll', this._getPatchedClearAll.bind(this));\n }\n\n private _getPatchedClearAll(original: ClearAllFn): ClearAllFn {\n const instrumentation = this;\n\n return function patchedClearAll(this: DataloaderInternal, ...args: Parameters<typeof original>) {\n if (!instrumentation.shouldCreateSpans()) {\n return original.call(this, ...args);\n }\n\n const parent = context.active();\n const span = instrumentation.tracer.startSpan(\n instrumentation.getSpanName(this, 'clearAll'),\n { kind: SpanKind.CLIENT },\n parent,\n );\n\n const ret = context.with(trace.setSpan(parent, span), () => {\n return original.call(this, ...args);\n });\n\n span.end();\n\n return ret;\n };\n }\n}\n"],"names":["InstrumentationBase","SDK_VERSION","InstrumentationNodeModuleDefinition","isWrapped","trace","context","SpanStatusCode","instrumentation","SpanKind"],"mappings":";;;;;;AA4BA,MAAM,WAAA,GAAc,YAAA;AACpB,MAAM,YAAA,GAAe,oCAAA;AAcrB,SAAS,qBAAqB,MAAA,EAAa;AACzC,EAAA,OAAO,OAAO,MAAA,CAAO,WAAW,CAAA,KAAM,QAAA,GAClC,OAAO,OAAA,GACP,MAAA;AACN;AAEO,MAAM,kCAAkCA,mCAAA,CAAqD;AAAA,EAClG,WAAA,CAAY,MAAA,GAA0C,EAAC,EAAG;AACxD,IAAA,KAAA,CAAM,YAAA,EAAcC,kBAAa,MAAM,CAAA;AAAA,EACzC;AAAA,EAEU,IAAA,GAAO;AACf,IAAA,OAAO;AAAA,MACL,IAAIC,mDAAA;AAAA,QACF,WAAA;AAAA,QACA,CAAC,YAAY,CAAA;AAAA,QACb,CAAA,MAAA,KAAU;AACR,UAAA,MAAM,UAAA,GAAa,qBAAqB,MAAM,CAAA;AAC9C,UAAA,IAAA,CAAK,UAAA,CAAW,WAAW,SAAS,CAAA;AACpC,UAAA,IAAA,CAAK,cAAA,CAAe,WAAW,SAAS,CAAA;AACxC,UAAA,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MAAA,MAAM,MAAA,GAASE,YAAQ,MAAA,EAAO;AAC9B,MAAA,MAAM,IAAA,GAAO,gBAAgB,MAAA,CAAO,SAAA;AAAA,QAClC,eAAA,CAAgB,WAAA,CAAY,IAAA,EAAM,UAAU,CAAA;AAAA,QAC5C,EAAE,IAAA,EAAMG,YAAA,CAAS,MAAA,EAAO;AAAA,QACxB;AAAA,OACF;AAEA,MAAA,MAAM,GAAA,GAAMH,YAAQ,IAAA,CAAKD,SAAA,CAAM,QAAQ,MAAA,EAAQ,IAAI,GAAG,MAAM;AAC1D,QAAA,OAAO,QAAA,CAAS,IAAA,CAAK,IAAA,EAAM,GAAG,IAAI,CAAA;AAAA,MACpC,CAAC,CAAA;AAED,MAAA,IAAA,CAAK,GAAA,EAAI;AAET,MAAA,OAAO,GAAA;AAAA,IACT,CAAA;AAAA,EACF;AACF;;;;"}
@@ -7,32 +7,25 @@ const nodeCore = require('@sentry/node-core');
7
7
  const core = require('@sentry/core');
8
8
  const debugBuild = require('../../debug-build.js');
9
9
 
10
- const INTEGRATION_NAME = 'Express';
11
- const SUPPORTED_VERSIONS = ['>=4.0.0 <6'];
12
-
13
- function setupExpressErrorHandler(
14
- //oxlint-disable-next-line no-explicit-any
15
- app,
16
- options,
17
- ) {
10
+ const INTEGRATION_NAME = "Express";
11
+ const SUPPORTED_VERSIONS = [">=4.0.0 <6"];
12
+ function setupExpressErrorHandler(app, options) {
18
13
  core.setupExpressErrorHandler(app, options);
19
- nodeCore.ensureIsWrapped(app.use, 'express');
14
+ nodeCore.ensureIsWrapped(app.use, "express");
20
15
  }
21
-
22
16
  const instrumentExpress = nodeCore.generateInstrumentOnce(
23
17
  INTEGRATION_NAME,
24
- (options) => new ExpressInstrumentation(options),
18
+ (options) => new ExpressInstrumentation(options)
25
19
  );
26
-
27
20
  class ExpressInstrumentation extends instrumentation.InstrumentationBase {
28
- constructor(config = {}) {
29
- super('sentry-express', core.SDK_VERSION, config);
21
+ constructor(config = {}) {
22
+ super("sentry-express", core.SDK_VERSION, config);
30
23
  }
31
- init() {
24
+ init() {
32
25
  const module = new instrumentation.InstrumentationNodeModuleDefinition(
33
- 'express',
26
+ "express",
34
27
  SUPPORTED_VERSIONS,
35
- express => {
28
+ (express) => {
36
29
  try {
37
30
  core.patchExpressModule(express, () => ({
38
31
  ...this.getConfig(),
@@ -41,15 +34,15 @@ class ExpressInstrumentation extends instrumentation.InstrumentationBase {
41
34
  if (route && rpcMetadata?.type === core$1.RPCType.HTTP) {
42
35
  rpcMetadata.route = route;
43
36
  }
44
- },
37
+ }
45
38
  }));
46
39
  } catch (e) {
47
- debugBuild.DEBUG_BUILD && core.debug.error('Failed to patch express module:', e);
40
+ debugBuild.DEBUG_BUILD && core.debug.error("Failed to patch express module:", e);
48
41
  }
49
42
  return express;
50
43
  },
51
44
  // we do not ever actually unpatch in our SDKs
52
- express => express,
45
+ (express) => express
53
46
  );
54
47
  return module;
55
48
  }
@@ -59,10 +52,9 @@ const _expressIntegration = ((options) => {
59
52
  name: INTEGRATION_NAME,
60
53
  setupOnce() {
61
54
  instrumentExpress(options);
62
- },
55
+ }
63
56
  };
64
- }) ;
65
-
57
+ });
66
58
  const expressIntegration = core.defineIntegration(_expressIntegration);
67
59
 
68
60
  exports.expressErrorHandler = core.expressErrorHandler;
@@ -1 +1 @@
1
- {"version":3,"file":"express.js","sources":["../../../../src/integrations/tracing/express.ts"],"sourcesContent":["// Automatic istrumentation for Express using OTel\nimport type { InstrumentationConfig } from '@opentelemetry/instrumentation';\nimport { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';\nimport { context } from '@opentelemetry/api';\nimport { getRPCMetadata, RPCType } from '@opentelemetry/core';\n\nimport { ensureIsWrapped, generateInstrumentOnce } from '@sentry/node-core';\nimport {\n type ExpressIntegrationOptions,\n type IntegrationFn,\n debug,\n patchExpressModule,\n SDK_VERSION,\n defineIntegration,\n setupExpressErrorHandler as coreSetupExpressErrorHandler,\n type ExpressHandlerOptions,\n} from '@sentry/core';\nexport { expressErrorHandler } from '@sentry/core';\nimport { DEBUG_BUILD } from '../../debug-build';\n\nconst INTEGRATION_NAME = 'Express';\nconst SUPPORTED_VERSIONS = ['>=4.0.0 <6'];\n\nexport function setupExpressErrorHandler(\n //oxlint-disable-next-line no-explicit-any\n app: { use: (middleware: any) => unknown },\n options?: ExpressHandlerOptions,\n): void {\n coreSetupExpressErrorHandler(app, options);\n ensureIsWrapped(app.use, 'express');\n}\n\nexport type ExpressInstrumentationConfig = InstrumentationConfig &\n Omit<ExpressIntegrationOptions, 'express' | 'onRouteResolved'>;\n\nexport const instrumentExpress = generateInstrumentOnce(\n INTEGRATION_NAME,\n (options?: ExpressInstrumentationConfig) => new ExpressInstrumentation(options),\n);\n\nexport class ExpressInstrumentation extends InstrumentationBase<ExpressInstrumentationConfig> {\n public constructor(config: ExpressInstrumentationConfig = {}) {\n super('sentry-express', SDK_VERSION, config);\n }\n public init(): InstrumentationNodeModuleDefinition {\n const module = new InstrumentationNodeModuleDefinition(\n 'express',\n SUPPORTED_VERSIONS,\n express => {\n try {\n patchExpressModule(express, () => ({\n ...this.getConfig(),\n onRouteResolved(route) {\n const rpcMetadata = getRPCMetadata(context.active());\n if (route && rpcMetadata?.type === RPCType.HTTP) {\n rpcMetadata.route = route;\n }\n },\n }));\n } catch (e) {\n DEBUG_BUILD && debug.error('Failed to patch express module:', e);\n }\n return express;\n },\n // we do not ever actually unpatch in our SDKs\n express => express,\n );\n return module;\n }\n}\nconst _expressIntegration = ((options?: ExpressInstrumentationConfig) => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentExpress(options);\n },\n };\n}) satisfies IntegrationFn;\n\nexport const expressIntegration = defineIntegration(_expressIntegration);\n"],"names":["coreSetupExpressErrorHandler","ensureIsWrapped","generateInstrumentOnce","InstrumentationBase","SDK_VERSION","InstrumentationNodeModuleDefinition","patchExpressModule","getRPCMetadata","context","RPCType","DEBUG_BUILD","debug","defineIntegration"],"mappings":";;;;;;;;;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R,QAAQ,OAAO,OAAO;AACtB,MAAM,CAAC;AACP;AACA,MAAM,OAAA,IAAW,OAAO;AACxB,KAAK;AACL,IAAI,OAAO,MAAM;AACjB,EAAE;AACF;AACA,MAAM,uBAAuB,CAAC,OAAO,KAAoC;AACzE,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,GAAG;AAChB,MAAM,iBAAiB,CAAC,OAAO,CAAC;AAChC,IAAI,CAAC;AACL,GAAG;AACH,CAAC,CAAA;;MAEY,kBAAA,GAAqBC,sBAAiB,CAAC,mBAAmB;;;;;;;;"}
1
+ {"version":3,"file":"express.js","sources":["../../../../src/integrations/tracing/express.ts"],"sourcesContent":["// Automatic istrumentation for Express using OTel\nimport type { InstrumentationConfig } from '@opentelemetry/instrumentation';\nimport { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';\nimport { context } from '@opentelemetry/api';\nimport { getRPCMetadata, RPCType } from '@opentelemetry/core';\n\nimport { ensureIsWrapped, generateInstrumentOnce } from '@sentry/node-core';\nimport {\n type ExpressIntegrationOptions,\n type IntegrationFn,\n debug,\n patchExpressModule,\n SDK_VERSION,\n defineIntegration,\n setupExpressErrorHandler as coreSetupExpressErrorHandler,\n type ExpressHandlerOptions,\n} from '@sentry/core';\nexport { expressErrorHandler } from '@sentry/core';\nimport { DEBUG_BUILD } from '../../debug-build';\n\nconst INTEGRATION_NAME = 'Express';\nconst SUPPORTED_VERSIONS = ['>=4.0.0 <6'];\n\nexport function setupExpressErrorHandler(\n //oxlint-disable-next-line no-explicit-any\n app: { use: (middleware: any) => unknown },\n options?: ExpressHandlerOptions,\n): void {\n coreSetupExpressErrorHandler(app, options);\n ensureIsWrapped(app.use, 'express');\n}\n\nexport type ExpressInstrumentationConfig = InstrumentationConfig &\n Omit<ExpressIntegrationOptions, 'express' | 'onRouteResolved'>;\n\nexport const instrumentExpress = generateInstrumentOnce(\n INTEGRATION_NAME,\n (options?: ExpressInstrumentationConfig) => new ExpressInstrumentation(options),\n);\n\nexport class ExpressInstrumentation extends InstrumentationBase<ExpressInstrumentationConfig> {\n public constructor(config: ExpressInstrumentationConfig = {}) {\n super('sentry-express', SDK_VERSION, config);\n }\n public init(): InstrumentationNodeModuleDefinition {\n const module = new InstrumentationNodeModuleDefinition(\n 'express',\n SUPPORTED_VERSIONS,\n express => {\n try {\n patchExpressModule(express, () => ({\n ...this.getConfig(),\n onRouteResolved(route) {\n const rpcMetadata = getRPCMetadata(context.active());\n if (route && rpcMetadata?.type === RPCType.HTTP) {\n rpcMetadata.route = route;\n }\n },\n }));\n } catch (e) {\n DEBUG_BUILD && debug.error('Failed to patch express module:', e);\n }\n return express;\n },\n // we do not ever actually unpatch in our SDKs\n express => express,\n );\n return module;\n }\n}\nconst _expressIntegration = ((options?: ExpressInstrumentationConfig) => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentExpress(options);\n },\n };\n}) satisfies IntegrationFn;\n\nexport const expressIntegration = defineIntegration(_expressIntegration);\n"],"names":["coreSetupExpressErrorHandler","ensureIsWrapped","generateInstrumentOnce","InstrumentationBase","SDK_VERSION","InstrumentationNodeModuleDefinition","patchExpressModule","getRPCMetadata","context","RPCType","DEBUG_BUILD","debug","defineIntegration"],"mappings":";;;;;;;;;AAoBA,MAAM,gBAAA,GAAmB,SAAA;AACzB,MAAM,kBAAA,GAAqB,CAAC,YAAY,CAAA;AAEjC,SAAS,wBAAA,CAEd,KACA,OAAA,EACM;AACN,EAAAA,6BAAA,CAA6B,KAAK,OAAO,CAAA;AACzC,EAAAC,wBAAA,CAAgB,GAAA,CAAI,KAAK,SAAS,CAAA;AACpC;AAKO,MAAM,iBAAA,GAAoBC,+BAAA;AAAA,EAC/B,gBAAA;AAAA,EACA,CAAC,OAAA,KAA2C,IAAI,sBAAA,CAAuB,OAAO;AAChF;AAEO,MAAM,+BAA+BC,mCAAA,CAAkD;AAAA,EACrF,WAAA,CAAY,MAAA,GAAuC,EAAC,EAAG;AAC5D,IAAA,KAAA,CAAM,gBAAA,EAAkBC,kBAAa,MAAM,CAAA;AAAA,EAC7C;AAAA,EACO,IAAA,GAA4C;AACjD,IAAA,MAAM,SAAS,IAAIC,mDAAA;AAAA,MACjB,SAAA;AAAA,MACA,kBAAA;AAAA,MACA,CAAA,OAAA,KAAW;AACT,QAAA,IAAI;AACF,UAAAC,uBAAA,CAAmB,SAAS,OAAO;AAAA,YACjC,GAAG,KAAK,SAAA,EAAU;AAAA,YAClB,gBAAgB,KAAA,EAAO;AACrB,cAAA,MAAM,WAAA,GAAcC,qBAAA,CAAeC,WAAA,CAAQ,MAAA,EAAQ,CAAA;AACnD,cAAA,IAAI,KAAA,IAAS,WAAA,EAAa,IAAA,KAASC,cAAA,CAAQ,IAAA,EAAM;AAC/C,gBAAA,WAAA,CAAY,KAAA,GAAQ,KAAA;AAAA,cACtB;AAAA,YACF;AAAA,WACF,CAAE,CAAA;AAAA,QACJ,SAAS,CAAA,EAAG;AACV,UAAAC,sBAAA,IAAeC,UAAA,CAAM,KAAA,CAAM,iCAAA,EAAmC,CAAC,CAAA;AAAA,QACjE;AACA,QAAA,OAAO,OAAA;AAAA,MACT,CAAA;AAAA;AAAA,MAEA,CAAA,OAAA,KAAW;AAAA,KACb;AACA,IAAA,OAAO,MAAA;AAAA,EACT;AACF;AACA,MAAM,mBAAA,IAAuB,CAAC,OAAA,KAA2C;AACvE,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AACV,MAAA,iBAAA,CAAkB,OAAO,CAAA;AAAA,IAC3B;AAAA,GACF;AACF,CAAA,CAAA;AAEO,MAAM,kBAAA,GAAqBC,uBAAkB,mBAAmB;;;;;;;;"}
@@ -1,123 +1,69 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
 
3
- const diagnosticsChannel = require('node:diagnostics_channel');
4
- const otel = require('@fastify/otel');
3
+ const dc = require('node:diagnostics_channel');
4
+ const instrumentation$1 = require('./vendored/instrumentation.js');
5
5
  const core = require('@sentry/core');
6
6
  const nodeCore = require('@sentry/node-core');
7
7
  const debugBuild = require('../../../debug-build.js');
8
8
  const instrumentation = require('./v3/instrumentation.js');
9
9
 
10
- /**
11
- * Options for the Fastify integration.
12
- *
13
- * `shouldHandleError` - Callback method deciding whether error should be captured and sent to Sentry
14
- * This is used on Fastify v5 where Sentry handles errors in the diagnostics channel.
15
- * Fastify v3 and v4 use `setupFastifyErrorHandler` instead.
16
- *
17
- * @example
18
- *
19
- * ```javascript
20
- * Sentry.init({
21
- * integrations: [
22
- * Sentry.fastifyIntegration({
23
- * shouldHandleError(_error, _request, reply) {
24
- * return reply.statusCode >= 500;
25
- * },
26
- * });
27
- * },
28
- * });
29
- * ```
30
- *
31
- */
32
-
33
- const INTEGRATION_NAME = 'Fastify';
34
-
10
+ const INTEGRATION_NAME = "Fastify";
35
11
  const instrumentFastifyV3 = nodeCore.generateInstrumentOnce(
36
12
  `${INTEGRATION_NAME}.v3`,
37
- () => new instrumentation.FastifyInstrumentationV3(),
13
+ () => new instrumentation.FastifyInstrumentationV3()
38
14
  );
39
-
40
15
  function getFastifyIntegration() {
41
16
  const client = core.getClient();
42
17
  if (!client) {
43
- return undefined;
18
+ return void 0;
44
19
  } else {
45
20
  return client.getIntegrationByName(INTEGRATION_NAME);
46
21
  }
47
22
  }
48
-
49
- function handleFastifyError(
50
-
51
- error,
52
- request,
53
- reply,
54
- handlerOrigin,
55
- ) {
23
+ function handleFastifyError(error, request, reply, handlerOrigin) {
56
24
  const shouldHandleError = getFastifyIntegration()?.getShouldHandleError() || defaultShouldHandleError;
57
- // Diagnostics channel runs before the onError hook, so we can use it to check if the handler was already registered
58
- if (handlerOrigin === 'diagnostics-channel') {
25
+ if (handlerOrigin === "diagnostics-channel") {
59
26
  this.diagnosticsChannelExists = true;
60
27
  }
61
-
62
- if (this.diagnosticsChannelExists && handlerOrigin === 'onError-hook') {
63
- debugBuild.DEBUG_BUILD &&
64
- core.debug.warn(
65
- 'Fastify error handler was already registered via diagnostics channel.',
66
- 'You can safely remove `setupFastifyErrorHandler` call and set `shouldHandleError` on the integration options.',
67
- );
68
-
69
- // If the diagnostics channel already exists, we don't need to handle the error again
28
+ if (this.diagnosticsChannelExists && handlerOrigin === "onError-hook") {
29
+ debugBuild.DEBUG_BUILD && core.debug.warn(
30
+ "Fastify error handler was already registered via diagnostics channel.",
31
+ "You can safely remove `setupFastifyErrorHandler` call and set `shouldHandleError` on the integration options."
32
+ );
70
33
  return;
71
34
  }
72
-
73
35
  if (shouldHandleError(error, request, reply)) {
74
- core.captureException(error, { mechanism: { handled: false, type: 'auto.function.fastify' } });
36
+ core.captureException(error, { mechanism: { handled: false, type: "auto.function.fastify" } });
75
37
  }
76
38
  }
77
-
78
39
  const instrumentFastify = nodeCore.generateInstrumentOnce(`${INTEGRATION_NAME}.v5`, () => {
79
- const fastifyOtelInstrumentationInstance = new otel.FastifyOtelInstrumentation();
40
+ const fastifyOtelInstrumentationInstance = new instrumentation$1.FastifyOtelInstrumentation();
80
41
  const plugin = fastifyOtelInstrumentationInstance.plugin();
81
-
82
- // This message handler works for Fastify versions 3, 4 and 5
83
- diagnosticsChannel.subscribe('fastify.initialization', message => {
84
- const fastifyInstance = (message ).fastify;
85
-
86
- fastifyInstance?.register(plugin).after(err => {
42
+ dc.subscribe("fastify.initialization", (message) => {
43
+ const fastifyInstance = message.fastify;
44
+ fastifyInstance?.register(plugin).after((err) => {
87
45
  if (err) {
88
- debugBuild.DEBUG_BUILD && core.debug.error('Failed to setup Fastify instrumentation', err);
46
+ debugBuild.DEBUG_BUILD && core.debug.error("Failed to setup Fastify instrumentation", err);
89
47
  } else {
90
48
  instrumentClient();
91
-
92
49
  if (fastifyInstance) {
93
50
  instrumentOnRequest(fastifyInstance);
94
51
  }
95
52
  }
96
53
  });
97
54
  });
98
-
99
- // This diagnostics channel only works on Fastify version 5
100
- // For versions 3 and 4, we use `setupFastifyErrorHandler` instead
101
- diagnosticsChannel.subscribe('tracing:fastify.request.handler:error', message => {
102
- const { error, request, reply } = message
103
-
104
- ;
105
-
106
- handleFastifyError.call(handleFastifyError, error, request, reply, 'diagnostics-channel');
55
+ dc.subscribe("tracing:fastify.request.handler:error", (message) => {
56
+ const { error, request, reply } = message;
57
+ handleFastifyError.call(handleFastifyError, error, request, reply, "diagnostics-channel");
107
58
  });
108
-
109
- // Returning this as Instrumentation to avoid leaking @fastify/otel types into the public API
110
- return fastifyOtelInstrumentationInstance ;
59
+ return fastifyOtelInstrumentationInstance;
111
60
  });
112
-
113
61
  const _fastifyIntegration = (({ shouldHandleError }) => {
114
62
  let _shouldHandleError;
115
-
116
63
  return {
117
64
  name: INTEGRATION_NAME,
118
65
  setupOnce() {
119
66
  _shouldHandleError = shouldHandleError || defaultShouldHandleError;
120
-
121
67
  instrumentFastifyV3();
122
68
  instrumentFastify();
123
69
  },
@@ -126,139 +72,74 @@ const _fastifyIntegration = (({ shouldHandleError }) => {
126
72
  },
127
73
  setShouldHandleError(fn) {
128
74
  _shouldHandleError = fn;
129
- },
75
+ }
130
76
  };
131
- }) ;
132
-
133
- /**
134
- * Adds Sentry tracing instrumentation for [Fastify](https://fastify.dev/).
135
- *
136
- * If you also want to capture errors, you need to call `setupFastifyErrorHandler(app)` after you set up your Fastify server.
137
- *
138
- * For more information, see the [fastify documentation](https://docs.sentry.io/platforms/javascript/guides/fastify/).
139
- *
140
- * @example
141
- * ```javascript
142
- * const Sentry = require('@sentry/node');
143
- *
144
- * Sentry.init({
145
- * integrations: [Sentry.fastifyIntegration()],
146
- * })
147
- * ```
148
- */
149
- const fastifyIntegration = core.defineIntegration((options = {}) =>
150
- _fastifyIntegration(options),
77
+ });
78
+ const fastifyIntegration = core.defineIntegration(
79
+ (options = {}) => _fastifyIntegration(options)
151
80
  );
152
-
153
- /**
154
- * Default function to determine if an error should be sent to Sentry
155
- *
156
- * 3xx and 4xx errors are not sent by default.
157
- */
158
81
  function defaultShouldHandleError(_error, _request, reply) {
159
82
  const statusCode = reply.statusCode;
160
- // 3xx and 4xx errors are not sent by default.
161
83
  return statusCode >= 500 || statusCode <= 299;
162
84
  }
163
-
164
- /**
165
- * Add an Fastify error handler to capture errors to Sentry.
166
- *
167
- * @param fastify The Fastify instance to which to add the error handler
168
- * @param options Configuration options for the handler
169
- *
170
- * @example
171
- * ```javascript
172
- * const Sentry = require('@sentry/node');
173
- * const Fastify = require("fastify");
174
- *
175
- * const app = Fastify();
176
- *
177
- * Sentry.setupFastifyErrorHandler(app);
178
- *
179
- * // Add your routes, etc.
180
- *
181
- * app.listen({ port: 3000 });
182
- * ```
183
- */
184
85
  function setupFastifyErrorHandler(fastify, options) {
185
86
  if (options?.shouldHandleError) {
186
87
  getFastifyIntegration()?.setShouldHandleError(options.shouldHandleError);
187
88
  }
188
-
189
89
  const plugin = Object.assign(
190
- function (fastify, _options, done) {
191
- fastify.addHook('onError', async (request, reply, error) => {
192
- handleFastifyError.call(handleFastifyError, error, request, reply, 'onError-hook');
90
+ function(fastify2, _options, done) {
91
+ fastify2.addHook("onError", async (request, reply, error) => {
92
+ handleFastifyError.call(handleFastifyError, error, request, reply, "onError-hook");
193
93
  });
194
94
  done();
195
95
  },
196
96
  {
197
- [Symbol.for('skip-override')]: true,
198
- [Symbol.for('fastify.display-name')]: 'sentry-fastify-error-handler',
199
- },
97
+ [/* @__PURE__ */ Symbol.for("skip-override")]: true,
98
+ [/* @__PURE__ */ Symbol.for("fastify.display-name")]: "sentry-fastify-error-handler"
99
+ }
200
100
  );
201
-
202
101
  fastify.register(plugin);
203
102
  }
204
-
205
103
  function addFastifySpanAttributes(span) {
206
104
  const spanJSON = core.spanToJSON(span);
207
105
  const spanName = spanJSON.description;
208
106
  const attributes = spanJSON.data;
209
-
210
- const type = attributes['fastify.type'];
211
-
212
- const isHook = type === 'hook';
213
- const isHandler = type === spanName?.startsWith('handler -');
214
- // In @fastify/otel `request-handler` is separated by dash, not underscore
215
- const isRequestHandler = spanName === 'request' || type === 'request-handler';
216
-
217
- // If this is already set, or we have no fastify span, no need to process again...
218
- if (attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_OP] || (!isHandler && !isRequestHandler && !isHook)) {
107
+ const type = attributes["fastify.type"];
108
+ const isHook = type === "hook";
109
+ const isHandler = type === spanName?.startsWith("handler -");
110
+ const isRequestHandler = spanName === "request" || type === "request-handler";
111
+ if (attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_OP] || !isHandler && !isRequestHandler && !isHook) {
219
112
  return;
220
113
  }
221
-
222
- const opPrefix = isHook ? 'hook' : isHandler ? 'middleware' : isRequestHandler ? 'request_handler' : '<unknown>';
223
-
114
+ const opPrefix = isHook ? "hook" : isHandler ? "middleware" : isRequestHandler ? "request_handler" : "<unknown>";
224
115
  span.setAttributes({
225
- [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.otel.fastify',
226
- [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: `${opPrefix}.fastify`,
116
+ [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.http.otel.fastify",
117
+ [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: `${opPrefix}.fastify`
227
118
  });
228
-
229
- const attrName = attributes['fastify.name'] || attributes['plugin.name'] || attributes['hook.name'];
230
- if (typeof attrName === 'string') {
231
- // Try removing `fastify -> ` and `@fastify/otel -> ` prefixes
232
- // This is a bit of a hack, and not always working for all spans
233
- // But it's the best we can do without a proper API
234
- const updatedName = attrName.replace(/^fastify -> /, '').replace(/^@fastify\/otel -> /, '');
235
-
119
+ const attrName = attributes["fastify.name"] || attributes["plugin.name"] || attributes["hook.name"];
120
+ if (typeof attrName === "string") {
121
+ const updatedName = attrName.replace(/^fastify -> /, "").replace(/^@fastify\/otel -> /, "").replace(/^@sentry\/instrumentation-fastify -> /, "");
236
122
  span.updateName(updatedName);
237
123
  }
238
124
  }
239
-
240
125
  function instrumentClient() {
241
126
  const client = core.getClient();
242
127
  if (client) {
243
- client.on('spanStart', (span) => {
128
+ client.on("spanStart", (span) => {
244
129
  addFastifySpanAttributes(span);
245
130
  });
246
131
  }
247
132
  }
248
-
249
133
  function instrumentOnRequest(fastify) {
250
- fastify.addHook('onRequest', async (request, _reply) => {
134
+ fastify.addHook("onRequest", async (request, _reply) => {
251
135
  if (request.opentelemetry) {
252
136
  const { span } = request.opentelemetry();
253
-
254
137
  if (span) {
255
138
  addFastifySpanAttributes(span);
256
139
  }
257
140
  }
258
-
259
141
  const routeName = request.routeOptions?.url;
260
- const method = request.method || 'GET';
261
-
142
+ const method = request.method || "GET";
262
143
  core.getIsolationScope().setTransactionName(`${method} ${routeName}`);
263
144
  });
264
145
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/fastify/index.ts"],"sourcesContent":["import * as diagnosticsChannel from 'node:diagnostics_channel';\nimport { FastifyOtelInstrumentation } from '@fastify/otel';\nimport type { Instrumentation, InstrumentationConfig } from '@opentelemetry/instrumentation';\nimport type { IntegrationFn, Span } from '@sentry/core';\nimport {\n captureException,\n debug,\n defineIntegration,\n getClient,\n getIsolationScope,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n spanToJSON,\n} from '@sentry/core';\nimport { generateInstrumentOnce } from '@sentry/node-core';\nimport { DEBUG_BUILD } from '../../../debug-build';\nimport type { FastifyInstance, FastifyMinimal, FastifyReply, FastifyRequest } from './types';\nimport { FastifyInstrumentationV3 } from './v3/instrumentation';\n\n/**\n * Options for the Fastify integration.\n *\n * `shouldHandleError` - Callback method deciding whether error should be captured and sent to Sentry\n * This is used on Fastify v5 where Sentry handles errors in the diagnostics channel.\n * Fastify v3 and v4 use `setupFastifyErrorHandler` instead.\n *\n * @example\n *\n * ```javascript\n * Sentry.init({\n * integrations: [\n * Sentry.fastifyIntegration({\n * shouldHandleError(_error, _request, reply) {\n * return reply.statusCode >= 500;\n * },\n * });\n * },\n * });\n * ```\n *\n */\ninterface FastifyIntegrationOptions {\n /**\n * Callback method deciding whether error should be captured and sent to Sentry\n * This is used on Fastify v5 where Sentry handles errors in the diagnostics channel.\n * Fastify v3 and v4 use `setupFastifyErrorHandler` instead.\n *\n * @param error Captured Fastify error\n * @param request Fastify request (or any object containing at least method, routeOptions.url, and routerPath)\n * @param reply Fastify reply (or any object containing at least statusCode)\n */\n shouldHandleError: (error: Error, request: FastifyRequest, reply: FastifyReply) => boolean;\n}\n\ninterface FastifyHandlerOptions {\n /**\n * Callback method deciding whether error should be captured and sent to Sentry\n *\n * @param error Captured Fastify error\n * @param request Fastify request (or any object containing at least method, routeOptions.url, and routerPath)\n * @param reply Fastify reply (or any object containing at least statusCode)\n *\n * @example\n *\n *\n * ```javascript\n * setupFastifyErrorHandler(app, {\n * shouldHandleError(_error, _request, reply) {\n * return reply.statusCode >= 400;\n * },\n * });\n * ```\n *\n *\n * If using TypeScript, you can cast the request and reply to get full type safety.\n *\n * ```typescript\n * import type { FastifyRequest, FastifyReply } from 'fastify';\n *\n * setupFastifyErrorHandler(app, {\n * shouldHandleError(error, minimalRequest, minimalReply) {\n * const request = minimalRequest as FastifyRequest;\n * const reply = minimalReply as FastifyReply;\n * return reply.statusCode >= 500;\n * },\n * });\n * ```\n */\n shouldHandleError: (error: Error, request: FastifyRequest, reply: FastifyReply) => boolean;\n}\n\nconst INTEGRATION_NAME = 'Fastify';\n\nexport const instrumentFastifyV3 = generateInstrumentOnce(\n `${INTEGRATION_NAME}.v3`,\n () => new FastifyInstrumentationV3(),\n);\n\nfunction getFastifyIntegration(): ReturnType<typeof _fastifyIntegration> | undefined {\n const client = getClient();\n if (!client) {\n return undefined;\n } else {\n return client.getIntegrationByName(INTEGRATION_NAME);\n }\n}\n\nfunction handleFastifyError(\n this: {\n diagnosticsChannelExists?: boolean;\n },\n error: Error,\n request: FastifyRequest & { opentelemetry?: () => { span?: Span } },\n reply: FastifyReply,\n handlerOrigin: 'diagnostics-channel' | 'onError-hook',\n): void {\n const shouldHandleError = getFastifyIntegration()?.getShouldHandleError() || defaultShouldHandleError;\n // Diagnostics channel runs before the onError hook, so we can use it to check if the handler was already registered\n if (handlerOrigin === 'diagnostics-channel') {\n this.diagnosticsChannelExists = true;\n }\n\n if (this.diagnosticsChannelExists && handlerOrigin === 'onError-hook') {\n DEBUG_BUILD &&\n debug.warn(\n 'Fastify error handler was already registered via diagnostics channel.',\n 'You can safely remove `setupFastifyErrorHandler` call and set `shouldHandleError` on the integration options.',\n );\n\n // If the diagnostics channel already exists, we don't need to handle the error again\n return;\n }\n\n if (shouldHandleError(error, request, reply)) {\n captureException(error, { mechanism: { handled: false, type: 'auto.function.fastify' } });\n }\n}\n\nexport const instrumentFastify = generateInstrumentOnce(`${INTEGRATION_NAME}.v5`, () => {\n const fastifyOtelInstrumentationInstance = new FastifyOtelInstrumentation();\n const plugin = fastifyOtelInstrumentationInstance.plugin();\n\n // This message handler works for Fastify versions 3, 4 and 5\n diagnosticsChannel.subscribe('fastify.initialization', message => {\n const fastifyInstance = (message as { fastify?: FastifyInstance }).fastify;\n\n fastifyInstance?.register(plugin).after(err => {\n if (err) {\n DEBUG_BUILD && debug.error('Failed to setup Fastify instrumentation', err);\n } else {\n instrumentClient();\n\n if (fastifyInstance) {\n instrumentOnRequest(fastifyInstance);\n }\n }\n });\n });\n\n // This diagnostics channel only works on Fastify version 5\n // For versions 3 and 4, we use `setupFastifyErrorHandler` instead\n diagnosticsChannel.subscribe('tracing:fastify.request.handler:error', message => {\n const { error, request, reply } = message as {\n error: Error;\n request: FastifyRequest & { opentelemetry?: () => { span?: Span } };\n reply: FastifyReply;\n };\n\n handleFastifyError.call(handleFastifyError, error, request, reply, 'diagnostics-channel');\n });\n\n // Returning this as Instrumentation to avoid leaking @fastify/otel types into the public API\n return fastifyOtelInstrumentationInstance as unknown as Instrumentation<InstrumentationConfig>;\n});\n\nconst _fastifyIntegration = (({ shouldHandleError }: Partial<FastifyIntegrationOptions>) => {\n let _shouldHandleError: (error: Error, request: FastifyRequest, reply: FastifyReply) => boolean;\n\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n _shouldHandleError = shouldHandleError || defaultShouldHandleError;\n\n instrumentFastifyV3();\n instrumentFastify();\n },\n getShouldHandleError() {\n return _shouldHandleError;\n },\n setShouldHandleError(fn: (error: Error, request: FastifyRequest, reply: FastifyReply) => boolean): void {\n _shouldHandleError = fn;\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for [Fastify](https://fastify.dev/).\n *\n * If you also want to capture errors, you need to call `setupFastifyErrorHandler(app)` after you set up your Fastify server.\n *\n * For more information, see the [fastify documentation](https://docs.sentry.io/platforms/javascript/guides/fastify/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.fastifyIntegration()],\n * })\n * ```\n */\nexport const fastifyIntegration = defineIntegration((options: Partial<FastifyIntegrationOptions> = {}) =>\n _fastifyIntegration(options),\n);\n\n/**\n * Default function to determine if an error should be sent to Sentry\n *\n * 3xx and 4xx errors are not sent by default.\n */\nfunction defaultShouldHandleError(_error: Error, _request: FastifyRequest, reply: FastifyReply): boolean {\n const statusCode = reply.statusCode;\n // 3xx and 4xx errors are not sent by default.\n return statusCode >= 500 || statusCode <= 299;\n}\n\n/**\n * Add an Fastify error handler to capture errors to Sentry.\n *\n * @param fastify The Fastify instance to which to add the error handler\n * @param options Configuration options for the handler\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n * const Fastify = require(\"fastify\");\n *\n * const app = Fastify();\n *\n * Sentry.setupFastifyErrorHandler(app);\n *\n * // Add your routes, etc.\n *\n * app.listen({ port: 3000 });\n * ```\n */\nexport function setupFastifyErrorHandler(fastify: FastifyMinimal, options?: Partial<FastifyHandlerOptions>): void {\n if (options?.shouldHandleError) {\n getFastifyIntegration()?.setShouldHandleError(options.shouldHandleError);\n }\n\n const plugin = Object.assign(\n function (fastify: FastifyInstance, _options: unknown, done: () => void): void {\n fastify.addHook('onError', async (request, reply, error) => {\n handleFastifyError.call(handleFastifyError, error, request, reply, 'onError-hook');\n });\n done();\n },\n {\n [Symbol.for('skip-override')]: true,\n [Symbol.for('fastify.display-name')]: 'sentry-fastify-error-handler',\n },\n );\n\n fastify.register(plugin);\n}\n\nfunction addFastifySpanAttributes(span: Span): void {\n const spanJSON = spanToJSON(span);\n const spanName = spanJSON.description;\n const attributes = spanJSON.data;\n\n const type = attributes['fastify.type'];\n\n const isHook = type === 'hook';\n const isHandler = type === spanName?.startsWith('handler -');\n // In @fastify/otel `request-handler` is separated by dash, not underscore\n const isRequestHandler = spanName === 'request' || type === 'request-handler';\n\n // If this is already set, or we have no fastify span, no need to process again...\n if (attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP] || (!isHandler && !isRequestHandler && !isHook)) {\n return;\n }\n\n const opPrefix = isHook ? 'hook' : isHandler ? 'middleware' : isRequestHandler ? 'request_handler' : '<unknown>';\n\n span.setAttributes({\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.otel.fastify',\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: `${opPrefix}.fastify`,\n });\n\n const attrName = attributes['fastify.name'] || attributes['plugin.name'] || attributes['hook.name'];\n if (typeof attrName === 'string') {\n // Try removing `fastify -> ` and `@fastify/otel -> ` prefixes\n // This is a bit of a hack, and not always working for all spans\n // But it's the best we can do without a proper API\n const updatedName = attrName.replace(/^fastify -> /, '').replace(/^@fastify\\/otel -> /, '');\n\n span.updateName(updatedName);\n }\n}\n\nfunction instrumentClient(): void {\n const client = getClient();\n if (client) {\n client.on('spanStart', (span: Span) => {\n addFastifySpanAttributes(span);\n });\n }\n}\n\nfunction instrumentOnRequest(fastify: FastifyInstance): void {\n fastify.addHook('onRequest', async (request: FastifyRequest & { opentelemetry?: () => { span?: Span } }, _reply) => {\n if (request.opentelemetry) {\n const { span } = request.opentelemetry();\n\n if (span) {\n addFastifySpanAttributes(span);\n }\n }\n\n const routeName = request.routeOptions?.url;\n const method = request.method || 'GET';\n\n getIsolationScope().setTransactionName(`${method} ${routeName}`);\n });\n}\n"],"names":["generateInstrumentOnce","FastifyInstrumentationV3","getClient","DEBUG_BUILD","debug","captureException","FastifyOtelInstrumentation","defineIntegration","spanToJSON","SEMANTIC_ATTRIBUTE_SENTRY_OP","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","getIsolationScope"],"mappings":";;;;;;;;;AAmBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAmDA,MAAM,gBAAA,GAAmB,SAAS;;AAE3B,MAAM,mBAAA,GAAsBA,+BAAsB;AACzD,EAAE,CAAC,EAAA,gBAAA,CAAA,GAAA,CAAA;AACA,EAAA,MAAA,IAAAC,wCAAA,EAAA;AACA;;AAEA,SAAA,qBAAA,GAAA;AACA,EAAA,MAAA,MAAA,GAAAC,cAAA,EAAA;AACA,EAAA,IAAA,CAAA,MAAA,EAAA;AACA,IAAA,OAAA,SAAA;AACA,EAAA,CAAA,MAAA;AACA,IAAA,OAAA,MAAA,CAAA,oBAAA,CAAA,gBAAA,CAAA;AACA,EAAA;AACA;;AAEA,SAAA,kBAAA;;AAIA,EAAA,KAAA;AACA,EAAA,OAAA;AACA,EAAA,KAAA;AACA,EAAA,aAAA;AACA,EAAA;AACA,EAAA,MAAA,iBAAA,GAAA,qBAAA,EAAA,EAAA,oBAAA,EAAA,IAAA,wBAAA;AACA;AACA,EAAA,IAAA,aAAA,KAAA,qBAAA,EAAA;AACA,IAAA,IAAA,CAAA,wBAAA,GAAA,IAAA;AACA,EAAA;;AAEA,EAAA,IAAA,IAAA,CAAA,wBAAA,IAAA,aAAA,KAAA,cAAA,EAAA;AACA,IAAAC,sBAAA;AACA,MAAAC,UAAA,CAAA,IAAA;AACA,QAAA,uEAAA;AACA,QAAA,+GAAA;AACA,OAAA;;AAEA;AACA,IAAA;AACA,EA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js","sources":["../../../../../src/integrations/tracing/fastify/index.ts"],"sourcesContent":["import * as diagnosticsChannel from 'node:diagnostics_channel';\nimport { FastifyOtelInstrumentation } from './vendored/instrumentation';\nimport type { Instrumentation, InstrumentationConfig } from '@opentelemetry/instrumentation';\nimport type { IntegrationFn, Span } from '@sentry/core';\nimport {\n captureException,\n debug,\n defineIntegration,\n getClient,\n getIsolationScope,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n spanToJSON,\n} from '@sentry/core';\nimport { generateInstrumentOnce } from '@sentry/node-core';\nimport { DEBUG_BUILD } from '../../../debug-build';\nimport type { FastifyInstance, FastifyMinimal, FastifyReply, FastifyRequest } from './types';\nimport { FastifyInstrumentationV3 } from './v3/instrumentation';\n\n/**\n * Options for the Fastify integration.\n *\n * `shouldHandleError` - Callback method deciding whether error should be captured and sent to Sentry\n * This is used on Fastify v5 where Sentry handles errors in the diagnostics channel.\n * Fastify v3 and v4 use `setupFastifyErrorHandler` instead.\n *\n * @example\n *\n * ```javascript\n * Sentry.init({\n * integrations: [\n * Sentry.fastifyIntegration({\n * shouldHandleError(_error, _request, reply) {\n * return reply.statusCode >= 500;\n * },\n * });\n * },\n * });\n * ```\n *\n */\ninterface FastifyIntegrationOptions {\n /**\n * Callback method deciding whether error should be captured and sent to Sentry\n * This is used on Fastify v5 where Sentry handles errors in the diagnostics channel.\n * Fastify v3 and v4 use `setupFastifyErrorHandler` instead.\n *\n * @param error Captured Fastify error\n * @param request Fastify request (or any object containing at least method, routeOptions.url, and routerPath)\n * @param reply Fastify reply (or any object containing at least statusCode)\n */\n shouldHandleError: (error: Error, request: FastifyRequest, reply: FastifyReply) => boolean;\n}\n\ninterface FastifyHandlerOptions {\n /**\n * Callback method deciding whether error should be captured and sent to Sentry\n *\n * @param error Captured Fastify error\n * @param request Fastify request (or any object containing at least method, routeOptions.url, and routerPath)\n * @param reply Fastify reply (or any object containing at least statusCode)\n *\n * @example\n *\n *\n * ```javascript\n * setupFastifyErrorHandler(app, {\n * shouldHandleError(_error, _request, reply) {\n * return reply.statusCode >= 400;\n * },\n * });\n * ```\n *\n *\n * If using TypeScript, you can cast the request and reply to get full type safety.\n *\n * ```typescript\n * import type { FastifyRequest, FastifyReply } from 'fastify';\n *\n * setupFastifyErrorHandler(app, {\n * shouldHandleError(error, minimalRequest, minimalReply) {\n * const request = minimalRequest as FastifyRequest;\n * const reply = minimalReply as FastifyReply;\n * return reply.statusCode >= 500;\n * },\n * });\n * ```\n */\n shouldHandleError: (error: Error, request: FastifyRequest, reply: FastifyReply) => boolean;\n}\n\nconst INTEGRATION_NAME = 'Fastify';\n\nexport const instrumentFastifyV3 = generateInstrumentOnce(\n `${INTEGRATION_NAME}.v3`,\n () => new FastifyInstrumentationV3(),\n);\n\nfunction getFastifyIntegration(): ReturnType<typeof _fastifyIntegration> | undefined {\n const client = getClient();\n if (!client) {\n return undefined;\n } else {\n return client.getIntegrationByName(INTEGRATION_NAME);\n }\n}\n\nfunction handleFastifyError(\n this: {\n diagnosticsChannelExists?: boolean;\n },\n error: Error,\n request: FastifyRequest & { opentelemetry?: () => { span?: Span } },\n reply: FastifyReply,\n handlerOrigin: 'diagnostics-channel' | 'onError-hook',\n): void {\n const shouldHandleError = getFastifyIntegration()?.getShouldHandleError() || defaultShouldHandleError;\n // Diagnostics channel runs before the onError hook, so we can use it to check if the handler was already registered\n if (handlerOrigin === 'diagnostics-channel') {\n this.diagnosticsChannelExists = true;\n }\n\n if (this.diagnosticsChannelExists && handlerOrigin === 'onError-hook') {\n DEBUG_BUILD &&\n debug.warn(\n 'Fastify error handler was already registered via diagnostics channel.',\n 'You can safely remove `setupFastifyErrorHandler` call and set `shouldHandleError` on the integration options.',\n );\n\n // If the diagnostics channel already exists, we don't need to handle the error again\n return;\n }\n\n if (shouldHandleError(error, request, reply)) {\n captureException(error, { mechanism: { handled: false, type: 'auto.function.fastify' } });\n }\n}\n\nexport const instrumentFastify = generateInstrumentOnce(`${INTEGRATION_NAME}.v5`, () => {\n const fastifyOtelInstrumentationInstance = new FastifyOtelInstrumentation();\n const plugin = fastifyOtelInstrumentationInstance.plugin();\n\n // This message handler works for Fastify versions 3, 4 and 5\n diagnosticsChannel.subscribe('fastify.initialization', message => {\n const fastifyInstance = (message as { fastify?: FastifyInstance }).fastify;\n\n fastifyInstance?.register(plugin).after(err => {\n if (err) {\n DEBUG_BUILD && debug.error('Failed to setup Fastify instrumentation', err);\n } else {\n instrumentClient();\n\n if (fastifyInstance) {\n instrumentOnRequest(fastifyInstance);\n }\n }\n });\n });\n\n // This diagnostics channel only works on Fastify version 5\n // For versions 3 and 4, we use `setupFastifyErrorHandler` instead\n diagnosticsChannel.subscribe('tracing:fastify.request.handler:error', message => {\n const { error, request, reply } = message as {\n error: Error;\n request: FastifyRequest & { opentelemetry?: () => { span?: Span } };\n reply: FastifyReply;\n };\n\n handleFastifyError.call(handleFastifyError, error, request, reply, 'diagnostics-channel');\n });\n\n // Returning this as Instrumentation to avoid leaking @fastify/otel types into the public API\n return fastifyOtelInstrumentationInstance as unknown as Instrumentation<InstrumentationConfig>;\n});\n\nconst _fastifyIntegration = (({ shouldHandleError }: Partial<FastifyIntegrationOptions>) => {\n let _shouldHandleError: (error: Error, request: FastifyRequest, reply: FastifyReply) => boolean;\n\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n _shouldHandleError = shouldHandleError || defaultShouldHandleError;\n\n instrumentFastifyV3();\n instrumentFastify();\n },\n getShouldHandleError() {\n return _shouldHandleError;\n },\n setShouldHandleError(fn: (error: Error, request: FastifyRequest, reply: FastifyReply) => boolean): void {\n _shouldHandleError = fn;\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for [Fastify](https://fastify.dev/).\n *\n * If you also want to capture errors, you need to call `setupFastifyErrorHandler(app)` after you set up your Fastify server.\n *\n * For more information, see the [fastify documentation](https://docs.sentry.io/platforms/javascript/guides/fastify/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.fastifyIntegration()],\n * })\n * ```\n */\nexport const fastifyIntegration = defineIntegration((options: Partial<FastifyIntegrationOptions> = {}) =>\n _fastifyIntegration(options),\n);\n\n/**\n * Default function to determine if an error should be sent to Sentry\n *\n * 3xx and 4xx errors are not sent by default.\n */\nfunction defaultShouldHandleError(_error: Error, _request: FastifyRequest, reply: FastifyReply): boolean {\n const statusCode = reply.statusCode;\n // 3xx and 4xx errors are not sent by default.\n return statusCode >= 500 || statusCode <= 299;\n}\n\n/**\n * Add an Fastify error handler to capture errors to Sentry.\n *\n * @param fastify The Fastify instance to which to add the error handler\n * @param options Configuration options for the handler\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n * const Fastify = require(\"fastify\");\n *\n * const app = Fastify();\n *\n * Sentry.setupFastifyErrorHandler(app);\n *\n * // Add your routes, etc.\n *\n * app.listen({ port: 3000 });\n * ```\n */\nexport function setupFastifyErrorHandler(fastify: FastifyMinimal, options?: Partial<FastifyHandlerOptions>): void {\n if (options?.shouldHandleError) {\n getFastifyIntegration()?.setShouldHandleError(options.shouldHandleError);\n }\n\n const plugin = Object.assign(\n function (fastify: FastifyInstance, _options: unknown, done: () => void): void {\n fastify.addHook('onError', async (request, reply, error) => {\n handleFastifyError.call(handleFastifyError, error, request, reply, 'onError-hook');\n });\n done();\n },\n {\n [Symbol.for('skip-override')]: true,\n [Symbol.for('fastify.display-name')]: 'sentry-fastify-error-handler',\n },\n );\n\n fastify.register(plugin);\n}\n\nfunction addFastifySpanAttributes(span: Span): void {\n const spanJSON = spanToJSON(span);\n const spanName = spanJSON.description;\n const attributes = spanJSON.data;\n\n const type = attributes['fastify.type'];\n\n const isHook = type === 'hook';\n const isHandler = type === spanName?.startsWith('handler -');\n // In @fastify/otel `request-handler` is separated by dash, not underscore\n const isRequestHandler = spanName === 'request' || type === 'request-handler';\n\n // If this is already set, or we have no fastify span, no need to process again...\n if (attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP] || (!isHandler && !isRequestHandler && !isHook)) {\n return;\n }\n\n const opPrefix = isHook ? 'hook' : isHandler ? 'middleware' : isRequestHandler ? 'request_handler' : '<unknown>';\n\n span.setAttributes({\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.otel.fastify',\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: `${opPrefix}.fastify`,\n });\n\n const attrName = attributes['fastify.name'] || attributes['plugin.name'] || attributes['hook.name'];\n if (typeof attrName === 'string') {\n // Try removing `fastify -> ` and `@fastify/otel -> ` prefixes\n // This is a bit of a hack, and not always working for all spans\n // But it's the best we can do without a proper API\n const updatedName = attrName\n .replace(/^fastify -> /, '')\n .replace(/^@fastify\\/otel -> /, '')\n .replace(/^@sentry\\/instrumentation-fastify -> /, '');\n\n span.updateName(updatedName);\n }\n}\n\nfunction instrumentClient(): void {\n const client = getClient();\n if (client) {\n client.on('spanStart', (span: Span) => {\n addFastifySpanAttributes(span);\n });\n }\n}\n\nfunction instrumentOnRequest(fastify: FastifyInstance): void {\n fastify.addHook('onRequest', async (request: FastifyRequest & { opentelemetry?: () => { span?: Span } }, _reply) => {\n if (request.opentelemetry) {\n const { span } = request.opentelemetry();\n\n if (span) {\n addFastifySpanAttributes(span);\n }\n }\n\n const routeName = request.routeOptions?.url;\n const method = request.method || 'GET';\n\n getIsolationScope().setTransactionName(`${method} ${routeName}`);\n });\n}\n"],"names":["generateInstrumentOnce","FastifyInstrumentationV3","getClient","DEBUG_BUILD","debug","captureException","FastifyOtelInstrumentation","diagnosticsChannel","defineIntegration","fastify","spanToJSON","SEMANTIC_ATTRIBUTE_SENTRY_OP","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","getIsolationScope"],"mappings":";;;;;;;;;AA2FA,MAAM,gBAAA,GAAmB,SAAA;AAElB,MAAM,mBAAA,GAAsBA,+BAAA;AAAA,EACjC,GAAG,gBAAgB,CAAA,GAAA,CAAA;AAAA,E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,CAAQ,aAAA,EAAc;AAEvC,MAAA,IAAI,IAAA,EAAM;AACR,QAAA,wBAAA,CAAyB,IAAI,CAAA;AAAA,MAC/B;AAAA,IACF;AAEA,IAAA,MAAM,SAAA,GAAY,QAAQ,YAAA,EAAc,GAAA;AACxC,IAAA,MAAM,MAAA,GAAS,QAAQ,MAAA,IAAU,KAAA;AAEjC,IAAAW,sBAAA,GAAoB,kBAAA,CAAmB,CAAA,EAAG,MAAM,CAAA,CAAA,EAAI,SAAS,CAAA,CAAE,CAAA;AAAA,EACjE,CAAC,CAAA;AACH;;;;;;;"}
@@ -1,23 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
 
3
- // Vendored from https://github.com/open-telemetry/opentelemetry-js-contrib/blob/407f61591ba69a39a6908264379d4d98a48dbec4/plugins/node/opentelemetry-instrumentation-fastify/src/constants.ts
4
- /*
5
- * Copyright The OpenTelemetry Authors
6
- *
7
- * Licensed under the Apache License, Version 2.0 (the "License");
8
- * you may not use this file except in compliance with the License.
9
- * You may obtain a copy of the License at
10
- *
11
- * https://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing, software
14
- * distributed under the License is distributed on an "AS IS" BASIS,
15
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- * See the License for the specific language governing permissions and
17
- * limitations under the License.
18
- */
19
-
20
- const spanRequestSymbol = Symbol('opentelemetry.instrumentation.fastify.request_active_span');
3
+ const spanRequestSymbol = /* @__PURE__ */ Symbol("opentelemetry.instrumentation.fastify.request_active_span");
21
4
 
22
5
  exports.spanRequestSymbol = spanRequestSymbol;
23
6
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sources":["../../../../../../src/integrations/tracing/fastify/v3/constants.ts"],"sourcesContent":["// Vendored from https://github.com/open-telemetry/opentelemetry-js-contrib/blob/407f61591ba69a39a6908264379d4d98a48dbec4/plugins/node/opentelemetry-instrumentation-fastify/src/constants.ts\n/*\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\nexport const spanRequestSymbol = Symbol('opentelemetry.instrumentation.fastify.request_active_span');\n\n// The instrumentation creates a span for invocations of lifecycle hook handlers\n// that take `(request, reply, ...[, done])` arguments. Currently this is all\n// lifecycle hooks except `onRequestAbort`.\n// https://fastify.dev/docs/latest/Reference/Hooks\nexport const hooksNamesToWrap = new Set([\n 'onTimeout',\n 'onRequest',\n 'preParsing',\n 'preValidation',\n 'preSerialization',\n 'preHandler',\n 'onSend',\n 'onResponse',\n 'onError',\n]);\n"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;MAEa,iBAAA,GAAoB,MAAM,CAAC,2DAA2D;;;;"}
1
+ {"version":3,"file":"constants.js","sources":["../../../../../../src/integrations/tracing/fastify/v3/constants.ts"],"sourcesContent":["// Vendored from https://github.com/open-telemetry/opentelemetry-js-contrib/blob/407f61591ba69a39a6908264379d4d98a48dbec4/plugins/node/opentelemetry-instrumentation-fastify/src/constants.ts\n/*\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\nexport const spanRequestSymbol = Symbol('opentelemetry.instrumentation.fastify.request_active_span');\n\n// The instrumentation creates a span for invocations of lifecycle hook handlers\n// that take `(request, reply, ...[, done])` arguments. Currently this is all\n// lifecycle hooks except `onRequestAbort`.\n// https://fastify.dev/docs/latest/Reference/Hooks\nexport const hooksNamesToWrap = new Set([\n 'onTimeout',\n 'onRequest',\n 'preParsing',\n 'preValidation',\n 'preSerialization',\n 'preHandler',\n 'onSend',\n 'onResponse',\n 'onError',\n]);\n"],"names":[],"mappings":";;AAiBO,MAAM,iBAAA,0BAA2B,2DAA2D;;;;"}