@depup/sentry__node 10.48.0-depup.0 → 10.67.0-depup.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (987) hide show
  1. package/README.md +7 -6
  2. package/build/cjs/debug-build.js +0 -5
  3. package/build/cjs/debug-build.js.map +1 -1
  4. package/build/cjs/index.js +76 -67
  5. package/build/cjs/index.js.map +1 -1
  6. package/build/cjs/init.js +0 -6
  7. package/build/cjs/init.js.map +1 -1
  8. package/build/cjs/integrations/featureFlagShims/growthbook.js +0 -4
  9. package/build/cjs/integrations/featureFlagShims/growthbook.js.map +1 -1
  10. package/build/cjs/integrations/featureFlagShims/launchDarkly.js +6 -18
  11. package/build/cjs/integrations/featureFlagShims/launchDarkly.js.map +1 -1
  12. package/build/cjs/integrations/featureFlagShims/openFeature.js +6 -21
  13. package/build/cjs/integrations/featureFlagShims/openFeature.js.map +1 -1
  14. package/build/cjs/integrations/featureFlagShims/statsig.js +2 -8
  15. package/build/cjs/integrations/featureFlagShims/statsig.js.map +1 -1
  16. package/build/cjs/integrations/featureFlagShims/unleash.js +2 -8
  17. package/build/cjs/integrations/featureFlagShims/unleash.js.map +1 -1
  18. package/build/cjs/integrations/fs/index.js +17 -0
  19. package/build/cjs/integrations/fs/index.js.map +1 -0
  20. package/build/cjs/integrations/fs/vendored/constants.js +138 -0
  21. package/build/cjs/integrations/fs/vendored/constants.js.map +1 -0
  22. package/build/cjs/integrations/fs/vendored/instrumentation.js +230 -0
  23. package/build/cjs/integrations/fs/vendored/instrumentation.js.map +1 -0
  24. package/build/cjs/integrations/fs/vendored/utils.js +31 -0
  25. package/build/cjs/integrations/fs/vendored/utils.js.map +1 -0
  26. package/build/cjs/integrations/http.js +19 -175
  27. package/build/cjs/integrations/http.js.map +1 -1
  28. package/build/cjs/integrations/node-fetch.js +10 -94
  29. package/build/cjs/integrations/node-fetch.js.map +1 -1
  30. package/build/cjs/integrations/tracing/InstrumentationNodeModuleFile.js +15 -0
  31. package/build/cjs/integrations/tracing/InstrumentationNodeModuleFile.js.map +1 -0
  32. package/build/cjs/integrations/tracing/amqplib/index.js +21 -0
  33. package/build/cjs/integrations/tracing/amqplib/index.js.map +1 -0
  34. package/build/cjs/integrations/tracing/amqplib/vendored/instrumentation.js +117 -0
  35. package/build/cjs/integrations/tracing/amqplib/vendored/instrumentation.js.map +1 -0
  36. package/build/cjs/integrations/tracing/amqplib/vendored/patches.js +185 -0
  37. package/build/cjs/integrations/tracing/amqplib/vendored/patches.js.map +1 -0
  38. package/build/cjs/integrations/tracing/amqplib/vendored/semconv.js +26 -0
  39. package/build/cjs/integrations/tracing/amqplib/vendored/semconv.js.map +1 -0
  40. package/build/cjs/integrations/tracing/amqplib/vendored/types.js +17 -0
  41. package/build/cjs/integrations/tracing/amqplib/vendored/types.js.map +1 -0
  42. package/build/cjs/integrations/tracing/amqplib/vendored/utils.js +129 -0
  43. package/build/cjs/integrations/tracing/amqplib/vendored/utils.js.map +1 -0
  44. package/build/cjs/integrations/tracing/anthropic-ai/index.js +3 -58
  45. package/build/cjs/integrations/tracing/anthropic-ai/index.js.map +1 -1
  46. package/build/cjs/integrations/tracing/anthropic-ai/instrumentation.js +21 -44
  47. package/build/cjs/integrations/tracing/anthropic-ai/instrumentation.js.map +1 -1
  48. package/build/cjs/integrations/tracing/connect/index.js +35 -0
  49. package/build/cjs/integrations/tracing/connect/index.js.map +1 -0
  50. package/build/cjs/integrations/tracing/connect/vendored/enums/AttributeNames.js +16 -0
  51. package/build/cjs/integrations/tracing/connect/vendored/enums/AttributeNames.js.map +1 -0
  52. package/build/cjs/integrations/tracing/connect/vendored/instrumentation.js +137 -0
  53. package/build/cjs/integrations/tracing/connect/vendored/instrumentation.js.map +1 -0
  54. package/build/cjs/integrations/tracing/connect/vendored/internal-types.js +8 -0
  55. package/build/cjs/integrations/tracing/connect/vendored/internal-types.js.map +1 -0
  56. package/build/cjs/integrations/tracing/connect/vendored/utils.js +36 -0
  57. package/build/cjs/integrations/tracing/connect/vendored/utils.js.map +1 -0
  58. package/build/cjs/integrations/tracing/dataloader/index.js +26 -0
  59. package/build/cjs/integrations/tracing/dataloader/index.js.map +1 -0
  60. package/build/cjs/integrations/tracing/dataloader/vendored/instrumentation.js +217 -0
  61. package/build/cjs/integrations/tracing/dataloader/vendored/instrumentation.js.map +1 -0
  62. package/build/cjs/integrations/tracing/express.js +22 -34
  63. package/build/cjs/integrations/tracing/express.js.map +1 -1
  64. package/build/cjs/integrations/tracing/fastify/index.js +19 -234
  65. package/build/cjs/integrations/tracing/fastify/index.js.map +1 -1
  66. package/build/cjs/integrations/tracing/fastify/v3/constants.js +1 -18
  67. package/build/cjs/integrations/tracing/fastify/v3/constants.js.map +1 -1
  68. package/build/cjs/integrations/tracing/fastify/v3/enums/AttributeNames.js +20 -33
  69. package/build/cjs/integrations/tracing/fastify/v3/enums/AttributeNames.js.map +1 -1
  70. package/build/cjs/integrations/tracing/fastify/v3/instrumentation.js +78 -162
  71. package/build/cjs/integrations/tracing/fastify/v3/instrumentation.js.map +1 -1
  72. package/build/cjs/integrations/tracing/fastify/v3/utils.js +8 -79
  73. package/build/cjs/integrations/tracing/fastify/v3/utils.js.map +1 -1
  74. package/build/cjs/integrations/tracing/firebase/firebase.js +4 -33
  75. package/build/cjs/integrations/tracing/firebase/firebase.js.map +1 -1
  76. package/build/cjs/integrations/tracing/firebase/otel/firebaseInstrumentation.js +7 -23
  77. package/build/cjs/integrations/tracing/firebase/otel/firebaseInstrumentation.js.map +1 -1
  78. package/build/cjs/integrations/tracing/firebase/otel/patches/firestore.js +73 -215
  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 +86 -210
  81. package/build/cjs/integrations/tracing/firebase/otel/patches/functions.js.map +1 -1
  82. package/build/cjs/integrations/tracing/genericPool/index.js +21 -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 +23 -43
  89. package/build/cjs/integrations/tracing/google-genai/instrumentation.js.map +1 -1
  90. package/build/cjs/integrations/tracing/graphql/index.js +34 -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 +15 -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 +329 -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 +265 -0
  103. package/build/cjs/integrations/tracing/graphql/vendored/utils.js.map +1 -0
  104. package/build/cjs/integrations/tracing/hapi/index.js +16 -91
  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 +255 -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/utils.js +85 -0
  113. package/build/cjs/integrations/tracing/hapi/vendored/utils.js.map +1 -0
  114. package/build/cjs/integrations/tracing/hono/constants.js +6 -7
  115. package/build/cjs/integrations/tracing/hono/constants.js.map +1 -1
  116. package/build/cjs/integrations/tracing/hono/index.js +26 -77
  117. package/build/cjs/integrations/tracing/hono/index.js.map +1 -1
  118. package/build/cjs/integrations/tracing/hono/instrumentation.js +47 -82
  119. package/build/cjs/integrations/tracing/hono/instrumentation.js.map +1 -1
  120. package/build/cjs/integrations/tracing/index.js +74 -83
  121. package/build/cjs/integrations/tracing/index.js.map +1 -1
  122. package/build/cjs/integrations/tracing/kafka/index.js +21 -0
  123. package/build/cjs/integrations/tracing/kafka/index.js.map +1 -0
  124. package/build/cjs/integrations/tracing/kafka/vendored/instrumentation.js +237 -0
  125. package/build/cjs/integrations/tracing/kafka/vendored/instrumentation.js.map +1 -0
  126. package/build/cjs/integrations/tracing/kafka/vendored/semconv.js +22 -0
  127. package/build/cjs/integrations/tracing/kafka/vendored/semconv.js.map +1 -0
  128. package/build/cjs/integrations/tracing/kafka/vendored/utils.js +114 -0
  129. package/build/cjs/integrations/tracing/kafka/vendored/utils.js.map +1 -0
  130. package/build/cjs/integrations/tracing/knex/index.js +26 -0
  131. package/build/cjs/integrations/tracing/knex/index.js.map +1 -0
  132. package/build/cjs/integrations/tracing/knex/vendored/instrumentation.js +135 -0
  133. package/build/cjs/integrations/tracing/knex/vendored/instrumentation.js.map +1 -0
  134. package/build/cjs/integrations/tracing/knex/vendored/semconv.js +10 -0
  135. package/build/cjs/integrations/tracing/knex/vendored/semconv.js.map +1 -0
  136. package/build/cjs/integrations/tracing/knex/vendored/utils.js +84 -0
  137. package/build/cjs/integrations/tracing/knex/vendored/utils.js.map +1 -0
  138. package/build/cjs/integrations/tracing/koa/index.js +46 -0
  139. package/build/cjs/integrations/tracing/koa/index.js.map +1 -0
  140. package/build/cjs/integrations/tracing/koa/vendored/enums/AttributeNames.js +10 -0
  141. package/build/cjs/integrations/tracing/koa/vendored/enums/AttributeNames.js.map +1 -0
  142. package/build/cjs/integrations/tracing/koa/vendored/instrumentation.js +127 -0
  143. package/build/cjs/integrations/tracing/koa/vendored/instrumentation.js.map +1 -0
  144. package/build/cjs/integrations/tracing/koa/vendored/internal-types.js +6 -0
  145. package/build/cjs/integrations/tracing/koa/vendored/internal-types.js.map +1 -0
  146. package/build/cjs/integrations/tracing/koa/vendored/types.js +10 -0
  147. package/build/cjs/integrations/tracing/koa/vendored/types.js.map +1 -0
  148. package/build/cjs/integrations/tracing/koa/vendored/utils.js +36 -0
  149. package/build/cjs/integrations/tracing/koa/vendored/utils.js.map +1 -0
  150. package/build/cjs/integrations/tracing/langchain/index.js +3 -97
  151. package/build/cjs/integrations/tracing/langchain/index.js.map +1 -1
  152. package/build/cjs/integrations/tracing/langchain/instrumentation.js +57 -151
  153. package/build/cjs/integrations/tracing/langchain/instrumentation.js.map +1 -1
  154. package/build/cjs/integrations/tracing/langgraph/index.js +3 -73
  155. package/build/cjs/integrations/tracing/langgraph/index.js.map +1 -1
  156. package/build/cjs/integrations/tracing/langgraph/instrumentation.js +76 -40
  157. package/build/cjs/integrations/tracing/langgraph/instrumentation.js.map +1 -1
  158. package/build/cjs/integrations/tracing/lrumemoizer/index.js +21 -0
  159. package/build/cjs/integrations/tracing/lrumemoizer/index.js.map +1 -0
  160. package/build/cjs/integrations/tracing/lrumemoizer/vendored/instrumentation.js +38 -0
  161. package/build/cjs/integrations/tracing/lrumemoizer/vendored/instrumentation.js.map +1 -0
  162. package/build/cjs/integrations/tracing/mongo/index.js +21 -0
  163. package/build/cjs/integrations/tracing/mongo/index.js.map +1 -0
  164. package/build/cjs/integrations/tracing/mongo/vendored/instrumentation.js +129 -0
  165. package/build/cjs/integrations/tracing/mongo/vendored/instrumentation.js.map +1 -0
  166. package/build/cjs/integrations/tracing/mongo/vendored/patches.js +150 -0
  167. package/build/cjs/integrations/tracing/mongo/vendored/patches.js.map +1 -0
  168. package/build/cjs/integrations/tracing/mongo/vendored/utils.js +40 -0
  169. package/build/cjs/integrations/tracing/mongo/vendored/utils.js.map +1 -0
  170. package/build/cjs/integrations/tracing/mongoose/index.js +22 -0
  171. package/build/cjs/integrations/tracing/mongoose/index.js.map +1 -0
  172. package/build/cjs/integrations/tracing/mongoose/vendored/mongoose.js +240 -0
  173. package/build/cjs/integrations/tracing/mongoose/vendored/mongoose.js.map +1 -0
  174. package/build/cjs/integrations/tracing/mongoose/vendored/utils.js +41 -0
  175. package/build/cjs/integrations/tracing/mongoose/vendored/utils.js.map +1 -0
  176. package/build/cjs/integrations/tracing/mysql/index.js +21 -0
  177. package/build/cjs/integrations/tracing/mysql/index.js.map +1 -0
  178. package/build/cjs/integrations/tracing/mysql/vendored/instrumentation.js +185 -0
  179. package/build/cjs/integrations/tracing/mysql/vendored/instrumentation.js.map +1 -0
  180. package/build/cjs/integrations/tracing/mysql/vendored/semconv.js +8 -0
  181. package/build/cjs/integrations/tracing/mysql/vendored/semconv.js.map +1 -0
  182. package/build/cjs/integrations/tracing/mysql/vendored/utils.js +38 -0
  183. package/build/cjs/integrations/tracing/mysql/vendored/utils.js.map +1 -0
  184. package/build/cjs/integrations/tracing/mysql2/index.js +22 -0
  185. package/build/cjs/integrations/tracing/mysql2/index.js.map +1 -0
  186. package/build/cjs/integrations/tracing/mysql2/vendored/instrumentation.js +138 -0
  187. package/build/cjs/integrations/tracing/mysql2/vendored/instrumentation.js.map +1 -0
  188. package/build/cjs/integrations/tracing/mysql2/vendored/semconv.js +8 -0
  189. package/build/cjs/integrations/tracing/mysql2/vendored/semconv.js.map +1 -0
  190. package/build/cjs/integrations/tracing/mysql2/vendored/utils.js +81 -0
  191. package/build/cjs/integrations/tracing/mysql2/vendored/utils.js.map +1 -0
  192. package/build/cjs/integrations/tracing/openai/index.js +3 -58
  193. package/build/cjs/integrations/tracing/openai/index.js.map +1 -1
  194. package/build/cjs/integrations/tracing/openai/instrumentation.js +25 -49
  195. package/build/cjs/integrations/tracing/openai/instrumentation.js.map +1 -1
  196. package/build/cjs/integrations/tracing/postgres/index.js +27 -0
  197. package/build/cjs/integrations/tracing/postgres/index.js.map +1 -0
  198. package/build/cjs/integrations/tracing/postgres/vendored/enums/AttributeNames.js +11 -0
  199. package/build/cjs/integrations/tracing/postgres/vendored/enums/AttributeNames.js.map +1 -0
  200. package/build/cjs/integrations/tracing/postgres/vendored/enums/SpanNames.js +11 -0
  201. package/build/cjs/integrations/tracing/postgres/vendored/enums/SpanNames.js.map +1 -0
  202. package/build/cjs/integrations/tracing/postgres/vendored/instrumentation.js +225 -0
  203. package/build/cjs/integrations/tracing/postgres/vendored/instrumentation.js.map +1 -0
  204. package/build/cjs/integrations/tracing/postgres/vendored/semconv.js +8 -0
  205. package/build/cjs/integrations/tracing/postgres/vendored/semconv.js.map +1 -0
  206. package/build/cjs/integrations/tracing/postgres/vendored/utils.js +151 -0
  207. package/build/cjs/integrations/tracing/postgres/vendored/utils.js.map +1 -0
  208. package/build/cjs/integrations/tracing/postgresjs.js +77 -190
  209. package/build/cjs/integrations/tracing/postgresjs.js.map +1 -1
  210. package/build/cjs/integrations/tracing/redis/cache.js +41 -0
  211. package/build/cjs/integrations/tracing/redis/cache.js.map +1 -0
  212. package/build/cjs/integrations/tracing/redis/index.js +50 -0
  213. package/build/cjs/integrations/tracing/redis/index.js.map +1 -0
  214. package/build/cjs/integrations/tracing/redis/vendored/ioredis-instrumentation.js +147 -0
  215. package/build/cjs/integrations/tracing/redis/vendored/ioredis-instrumentation.js.map +1 -0
  216. package/build/cjs/integrations/tracing/redis/vendored/redis-instrumentation.js +445 -0
  217. package/build/cjs/integrations/tracing/redis/vendored/redis-instrumentation.js.map +1 -0
  218. package/build/cjs/integrations/tracing/redis/vendored/semconv.js +8 -0
  219. package/build/cjs/integrations/tracing/redis/vendored/semconv.js.map +1 -0
  220. package/build/cjs/integrations/tracing/tedious/index.js +21 -0
  221. package/build/cjs/integrations/tracing/tedious/index.js.map +1 -0
  222. package/build/cjs/integrations/tracing/tedious/vendored/instrumentation.js +154 -0
  223. package/build/cjs/integrations/tracing/tedious/vendored/instrumentation.js.map +1 -0
  224. package/build/cjs/integrations/tracing/tedious/vendored/semconv.js +8 -0
  225. package/build/cjs/integrations/tracing/tedious/vendored/semconv.js.map +1 -0
  226. package/build/cjs/integrations/tracing/tedious/vendored/utils.js +29 -0
  227. package/build/cjs/integrations/tracing/tedious/vendored/utils.js.map +1 -0
  228. package/build/cjs/integrations/tracing/vercelai/constants.js +1 -1
  229. package/build/cjs/integrations/tracing/vercelai/constants.js.map +1 -1
  230. package/build/cjs/integrations/tracing/vercelai/index.js +7 -53
  231. package/build/cjs/integrations/tracing/vercelai/index.js.map +1 -1
  232. package/build/cjs/integrations/tracing/vercelai/instrumentation.js +60 -158
  233. package/build/cjs/integrations/tracing/vercelai/instrumentation.js.map +1 -1
  234. package/build/cjs/preload.js +1 -14
  235. package/build/cjs/preload.js.map +1 -1
  236. package/build/cjs/sdk/diagnosticsChannelInjection.js +21 -0
  237. package/build/cjs/sdk/diagnosticsChannelInjection.js.map +1 -0
  238. package/build/cjs/sdk/experimentalUseDiagnosticsChannelInjection.js +33 -0
  239. package/build/cjs/sdk/experimentalUseDiagnosticsChannelInjection.js.map +1 -0
  240. package/build/cjs/sdk/index.js +33 -35
  241. package/build/cjs/sdk/index.js.map +1 -1
  242. package/build/cjs/sdk/initOtel.js +74 -60
  243. package/build/cjs/sdk/initOtel.js.map +1 -1
  244. package/build/cjs/utils/redisCache.js +24 -52
  245. package/build/cjs/utils/redisCache.js.map +1 -1
  246. package/build/cjs/utils/setHttpServerSpanRouteAttribute.js +21 -0
  247. package/build/cjs/utils/setHttpServerSpanRouteAttribute.js.map +1 -0
  248. package/build/esm/debug-build.js +0 -5
  249. package/build/esm/debug-build.js.map +1 -1
  250. package/build/esm/index.js +23 -21
  251. package/build/esm/index.js.map +1 -1
  252. package/build/esm/init.js +0 -6
  253. package/build/esm/init.js.map +1 -1
  254. package/build/esm/integrations/featureFlagShims/growthbook.js +0 -4
  255. package/build/esm/integrations/featureFlagShims/growthbook.js.map +1 -1
  256. package/build/esm/integrations/featureFlagShims/launchDarkly.js +6 -18
  257. package/build/esm/integrations/featureFlagShims/launchDarkly.js.map +1 -1
  258. package/build/esm/integrations/featureFlagShims/openFeature.js +6 -21
  259. package/build/esm/integrations/featureFlagShims/openFeature.js.map +1 -1
  260. package/build/esm/integrations/featureFlagShims/statsig.js +2 -8
  261. package/build/esm/integrations/featureFlagShims/statsig.js.map +1 -1
  262. package/build/esm/integrations/featureFlagShims/unleash.js +2 -8
  263. package/build/esm/integrations/featureFlagShims/unleash.js.map +1 -1
  264. package/build/esm/integrations/fs/index.js +15 -0
  265. package/build/esm/integrations/fs/index.js.map +1 -0
  266. package/build/esm/integrations/fs/vendored/constants.js +134 -0
  267. package/build/esm/integrations/fs/vendored/constants.js.map +1 -0
  268. package/build/esm/integrations/fs/vendored/instrumentation.js +228 -0
  269. package/build/esm/integrations/fs/vendored/instrumentation.js.map +1 -0
  270. package/build/esm/integrations/fs/vendored/utils.js +28 -0
  271. package/build/esm/integrations/fs/vendored/utils.js.map +1 -0
  272. package/build/esm/integrations/http.js +22 -176
  273. package/build/esm/integrations/http.js.map +1 -1
  274. package/build/esm/integrations/node-fetch.js +12 -95
  275. package/build/esm/integrations/node-fetch.js.map +1 -1
  276. package/build/esm/integrations/tracing/InstrumentationNodeModuleFile.js +13 -0
  277. package/build/esm/integrations/tracing/InstrumentationNodeModuleFile.js.map +1 -0
  278. package/build/esm/integrations/tracing/amqplib/index.js +18 -0
  279. package/build/esm/integrations/tracing/amqplib/index.js.map +1 -0
  280. package/build/esm/integrations/tracing/amqplib/vendored/instrumentation.js +115 -0
  281. package/build/esm/integrations/tracing/amqplib/vendored/instrumentation.js.map +1 -0
  282. package/build/esm/integrations/tracing/amqplib/vendored/patches.js +177 -0
  283. package/build/esm/integrations/tracing/amqplib/vendored/patches.js.map +1 -0
  284. package/build/esm/integrations/tracing/amqplib/vendored/semconv.js +14 -0
  285. package/build/esm/integrations/tracing/amqplib/vendored/semconv.js.map +1 -0
  286. package/build/esm/integrations/tracing/amqplib/vendored/types.js +15 -0
  287. package/build/esm/integrations/tracing/amqplib/vendored/types.js.map +1 -0
  288. package/build/esm/integrations/tracing/amqplib/vendored/utils.js +117 -0
  289. package/build/esm/integrations/tracing/amqplib/vendored/utils.js.map +1 -0
  290. package/build/esm/integrations/tracing/anthropic-ai/index.js +3 -58
  291. package/build/esm/integrations/tracing/anthropic-ai/index.js.map +1 -1
  292. package/build/esm/integrations/tracing/anthropic-ai/instrumentation.js +21 -44
  293. package/build/esm/integrations/tracing/anthropic-ai/instrumentation.js.map +1 -1
  294. package/build/esm/integrations/tracing/connect/index.js +31 -0
  295. package/build/esm/integrations/tracing/connect/index.js.map +1 -0
  296. package/build/esm/integrations/tracing/connect/vendored/enums/AttributeNames.js +13 -0
  297. package/build/esm/integrations/tracing/connect/vendored/enums/AttributeNames.js.map +1 -0
  298. package/build/esm/integrations/tracing/connect/vendored/instrumentation.js +135 -0
  299. package/build/esm/integrations/tracing/connect/vendored/instrumentation.js.map +1 -0
  300. package/build/esm/integrations/tracing/connect/vendored/internal-types.js +6 -0
  301. package/build/esm/integrations/tracing/connect/vendored/internal-types.js.map +1 -0
  302. package/build/esm/integrations/tracing/connect/vendored/utils.js +32 -0
  303. package/build/esm/integrations/tracing/connect/vendored/utils.js.map +1 -0
  304. package/build/esm/integrations/tracing/dataloader/index.js +23 -0
  305. package/build/esm/integrations/tracing/dataloader/index.js.map +1 -0
  306. package/build/esm/integrations/tracing/dataloader/vendored/instrumentation.js +215 -0
  307. package/build/esm/integrations/tracing/dataloader/vendored/instrumentation.js.map +1 -0
  308. package/build/esm/integrations/tracing/express.js +22 -34
  309. package/build/esm/integrations/tracing/express.js.map +1 -1
  310. package/build/esm/integrations/tracing/fastify/index.js +21 -235
  311. package/build/esm/integrations/tracing/fastify/index.js.map +1 -1
  312. package/build/esm/integrations/tracing/fastify/v3/constants.js +1 -18
  313. package/build/esm/integrations/tracing/fastify/v3/constants.js.map +1 -1
  314. package/build/esm/integrations/tracing/fastify/v3/enums/AttributeNames.js +17 -34
  315. package/build/esm/integrations/tracing/fastify/v3/enums/AttributeNames.js.map +1 -1
  316. package/build/esm/integrations/tracing/fastify/v3/instrumentation.js +74 -158
  317. package/build/esm/integrations/tracing/fastify/v3/instrumentation.js.map +1 -1
  318. package/build/esm/integrations/tracing/fastify/v3/utils.js +8 -79
  319. package/build/esm/integrations/tracing/fastify/v3/utils.js.map +1 -1
  320. package/build/esm/integrations/tracing/firebase/firebase.js +6 -35
  321. package/build/esm/integrations/tracing/firebase/firebase.js.map +1 -1
  322. package/build/esm/integrations/tracing/firebase/otel/firebaseInstrumentation.js +7 -23
  323. package/build/esm/integrations/tracing/firebase/otel/firebaseInstrumentation.js.map +1 -1
  324. package/build/esm/integrations/tracing/firebase/otel/patches/firestore.js +72 -214
  325. package/build/esm/integrations/tracing/firebase/otel/patches/firestore.js.map +1 -1
  326. package/build/esm/integrations/tracing/firebase/otel/patches/functions.js +86 -210
  327. package/build/esm/integrations/tracing/firebase/otel/patches/functions.js.map +1 -1
  328. package/build/esm/integrations/tracing/genericPool/index.js +18 -0
  329. package/build/esm/integrations/tracing/genericPool/index.js.map +1 -0
  330. package/build/esm/integrations/tracing/genericPool/vendored/instrumentation.js +120 -0
  331. package/build/esm/integrations/tracing/genericPool/vendored/instrumentation.js.map +1 -0
  332. package/build/esm/integrations/tracing/google-genai/index.js +3 -58
  333. package/build/esm/integrations/tracing/google-genai/index.js.map +1 -1
  334. package/build/esm/integrations/tracing/google-genai/instrumentation.js +23 -43
  335. package/build/esm/integrations/tracing/google-genai/instrumentation.js.map +1 -1
  336. package/build/esm/integrations/tracing/graphql/index.js +31 -0
  337. package/build/esm/integrations/tracing/graphql/index.js.map +1 -0
  338. package/build/esm/integrations/tracing/graphql/vendored/enum.js +43 -0
  339. package/build/esm/integrations/tracing/graphql/vendored/enum.js.map +1 -0
  340. package/build/esm/integrations/tracing/graphql/vendored/enums/AttributeNames.js +13 -0
  341. package/build/esm/integrations/tracing/graphql/vendored/enums/AttributeNames.js.map +1 -0
  342. package/build/esm/integrations/tracing/graphql/vendored/instrumentation.js +327 -0
  343. package/build/esm/integrations/tracing/graphql/vendored/instrumentation.js.map +1 -0
  344. package/build/esm/integrations/tracing/graphql/vendored/internal-types.js +4 -0
  345. package/build/esm/integrations/tracing/graphql/vendored/internal-types.js.map +1 -0
  346. package/build/esm/integrations/tracing/graphql/vendored/symbols.js +5 -0
  347. package/build/esm/integrations/tracing/graphql/vendored/symbols.js.map +1 -0
  348. package/build/esm/integrations/tracing/graphql/vendored/utils.js +257 -0
  349. package/build/esm/integrations/tracing/graphql/vendored/utils.js.map +1 -0
  350. package/build/esm/integrations/tracing/hapi/index.js +16 -91
  351. package/build/esm/integrations/tracing/hapi/index.js.map +1 -1
  352. package/build/esm/integrations/tracing/hapi/vendored/enums/AttributeNames.js +9 -0
  353. package/build/esm/integrations/tracing/hapi/vendored/enums/AttributeNames.js.map +1 -0
  354. package/build/esm/integrations/tracing/hapi/vendored/instrumentation.js +253 -0
  355. package/build/esm/integrations/tracing/hapi/vendored/instrumentation.js.map +1 -0
  356. package/build/esm/integrations/tracing/hapi/vendored/internal-types.js +19 -0
  357. package/build/esm/integrations/tracing/hapi/vendored/internal-types.js.map +1 -0
  358. package/build/esm/integrations/tracing/hapi/vendored/utils.js +76 -0
  359. package/build/esm/integrations/tracing/hapi/vendored/utils.js.map +1 -0
  360. package/build/esm/integrations/tracing/hono/constants.js +6 -7
  361. package/build/esm/integrations/tracing/hono/constants.js.map +1 -1
  362. package/build/esm/integrations/tracing/hono/index.js +22 -73
  363. package/build/esm/integrations/tracing/hono/index.js.map +1 -1
  364. package/build/esm/integrations/tracing/hono/instrumentation.js +47 -82
  365. package/build/esm/integrations/tracing/hono/instrumentation.js.map +1 -1
  366. package/build/esm/integrations/tracing/index.js +20 -29
  367. package/build/esm/integrations/tracing/index.js.map +1 -1
  368. package/build/esm/integrations/tracing/kafka/index.js +18 -0
  369. package/build/esm/integrations/tracing/kafka/index.js.map +1 -0
  370. package/build/esm/integrations/tracing/kafka/vendored/instrumentation.js +235 -0
  371. package/build/esm/integrations/tracing/kafka/vendored/instrumentation.js.map +1 -0
  372. package/build/esm/integrations/tracing/kafka/vendored/semconv.js +12 -0
  373. package/build/esm/integrations/tracing/kafka/vendored/semconv.js.map +1 -0
  374. package/build/esm/integrations/tracing/kafka/vendored/utils.js +108 -0
  375. package/build/esm/integrations/tracing/kafka/vendored/utils.js.map +1 -0
  376. package/build/esm/integrations/tracing/knex/index.js +23 -0
  377. package/build/esm/integrations/tracing/knex/index.js.map +1 -0
  378. package/build/esm/integrations/tracing/knex/vendored/instrumentation.js +133 -0
  379. package/build/esm/integrations/tracing/knex/vendored/instrumentation.js.map +1 -0
  380. package/build/esm/integrations/tracing/knex/vendored/semconv.js +6 -0
  381. package/build/esm/integrations/tracing/knex/vendored/semconv.js.map +1 -0
  382. package/build/esm/integrations/tracing/knex/vendored/utils.js +75 -0
  383. package/build/esm/integrations/tracing/knex/vendored/utils.js.map +1 -0
  384. package/build/esm/integrations/tracing/koa/index.js +42 -0
  385. package/build/esm/integrations/tracing/koa/index.js.map +1 -0
  386. package/build/esm/integrations/tracing/koa/vendored/enums/AttributeNames.js +8 -0
  387. package/build/esm/integrations/tracing/koa/vendored/enums/AttributeNames.js.map +1 -0
  388. package/build/esm/integrations/tracing/koa/vendored/instrumentation.js +125 -0
  389. package/build/esm/integrations/tracing/koa/vendored/instrumentation.js.map +1 -0
  390. package/build/esm/integrations/tracing/koa/vendored/internal-types.js +4 -0
  391. package/build/esm/integrations/tracing/koa/vendored/internal-types.js.map +1 -0
  392. package/build/esm/integrations/tracing/koa/vendored/types.js +8 -0
  393. package/build/esm/integrations/tracing/koa/vendored/types.js.map +1 -0
  394. package/build/esm/integrations/tracing/koa/vendored/utils.js +33 -0
  395. package/build/esm/integrations/tracing/koa/vendored/utils.js.map +1 -0
  396. package/build/esm/integrations/tracing/langchain/index.js +3 -97
  397. package/build/esm/integrations/tracing/langchain/index.js.map +1 -1
  398. package/build/esm/integrations/tracing/langchain/instrumentation.js +57 -151
  399. package/build/esm/integrations/tracing/langchain/instrumentation.js.map +1 -1
  400. package/build/esm/integrations/tracing/langgraph/index.js +3 -73
  401. package/build/esm/integrations/tracing/langgraph/index.js.map +1 -1
  402. package/build/esm/integrations/tracing/langgraph/instrumentation.js +78 -42
  403. package/build/esm/integrations/tracing/langgraph/instrumentation.js.map +1 -1
  404. package/build/esm/integrations/tracing/lrumemoizer/index.js +18 -0
  405. package/build/esm/integrations/tracing/lrumemoizer/index.js.map +1 -0
  406. package/build/esm/integrations/tracing/lrumemoizer/vendored/instrumentation.js +36 -0
  407. package/build/esm/integrations/tracing/lrumemoizer/vendored/instrumentation.js.map +1 -0
  408. package/build/esm/integrations/tracing/mongo/index.js +18 -0
  409. package/build/esm/integrations/tracing/mongo/index.js.map +1 -0
  410. package/build/esm/integrations/tracing/mongo/vendored/instrumentation.js +127 -0
  411. package/build/esm/integrations/tracing/mongo/vendored/instrumentation.js.map +1 -0
  412. package/build/esm/integrations/tracing/mongo/vendored/patches.js +142 -0
  413. package/build/esm/integrations/tracing/mongo/vendored/patches.js.map +1 -0
  414. package/build/esm/integrations/tracing/mongo/vendored/utils.js +34 -0
  415. package/build/esm/integrations/tracing/mongo/vendored/utils.js.map +1 -0
  416. package/build/esm/integrations/tracing/mongoose/index.js +19 -0
  417. package/build/esm/integrations/tracing/mongoose/index.js.map +1 -0
  418. package/build/esm/integrations/tracing/mongoose/vendored/mongoose.js +236 -0
  419. package/build/esm/integrations/tracing/mongoose/vendored/mongoose.js.map +1 -0
  420. package/build/esm/integrations/tracing/mongoose/vendored/utils.js +38 -0
  421. package/build/esm/integrations/tracing/mongoose/vendored/utils.js.map +1 -0
  422. package/build/esm/integrations/tracing/mysql/index.js +18 -0
  423. package/build/esm/integrations/tracing/mysql/index.js.map +1 -0
  424. package/build/esm/integrations/tracing/mysql/vendored/instrumentation.js +183 -0
  425. package/build/esm/integrations/tracing/mysql/vendored/instrumentation.js.map +1 -0
  426. package/build/esm/integrations/tracing/mysql/vendored/semconv.js +5 -0
  427. package/build/esm/integrations/tracing/mysql/vendored/semconv.js.map +1 -0
  428. package/build/esm/integrations/tracing/mysql/vendored/utils.js +33 -0
  429. package/build/esm/integrations/tracing/mysql/vendored/utils.js.map +1 -0
  430. package/build/esm/integrations/tracing/mysql2/index.js +19 -0
  431. package/build/esm/integrations/tracing/mysql2/index.js.map +1 -0
  432. package/build/esm/integrations/tracing/mysql2/vendored/instrumentation.js +136 -0
  433. package/build/esm/integrations/tracing/mysql2/vendored/instrumentation.js.map +1 -0
  434. package/build/esm/integrations/tracing/mysql2/vendored/semconv.js +5 -0
  435. package/build/esm/integrations/tracing/mysql2/vendored/semconv.js.map +1 -0
  436. package/build/esm/integrations/tracing/mysql2/vendored/utils.js +75 -0
  437. package/build/esm/integrations/tracing/mysql2/vendored/utils.js.map +1 -0
  438. package/build/esm/integrations/tracing/openai/index.js +3 -58
  439. package/build/esm/integrations/tracing/openai/index.js.map +1 -1
  440. package/build/esm/integrations/tracing/openai/instrumentation.js +25 -49
  441. package/build/esm/integrations/tracing/openai/instrumentation.js.map +1 -1
  442. package/build/esm/integrations/tracing/postgres/index.js +24 -0
  443. package/build/esm/integrations/tracing/postgres/index.js.map +1 -0
  444. package/build/esm/integrations/tracing/postgres/vendored/enums/AttributeNames.js +9 -0
  445. package/build/esm/integrations/tracing/postgres/vendored/enums/AttributeNames.js.map +1 -0
  446. package/build/esm/integrations/tracing/postgres/vendored/enums/SpanNames.js +9 -0
  447. package/build/esm/integrations/tracing/postgres/vendored/enums/SpanNames.js.map +1 -0
  448. package/build/esm/integrations/tracing/postgres/vendored/instrumentation.js +223 -0
  449. package/build/esm/integrations/tracing/postgres/vendored/instrumentation.js.map +1 -0
  450. package/build/esm/integrations/tracing/postgres/vendored/semconv.js +5 -0
  451. package/build/esm/integrations/tracing/postgres/vendored/semconv.js.map +1 -0
  452. package/build/esm/integrations/tracing/postgres/vendored/utils.js +136 -0
  453. package/build/esm/integrations/tracing/postgres/vendored/utils.js.map +1 -0
  454. package/build/esm/integrations/tracing/postgresjs.js +77 -190
  455. package/build/esm/integrations/tracing/postgresjs.js.map +1 -1
  456. package/build/esm/integrations/tracing/redis/cache.js +38 -0
  457. package/build/esm/integrations/tracing/redis/cache.js.map +1 -0
  458. package/build/esm/integrations/tracing/redis/index.js +43 -0
  459. package/build/esm/integrations/tracing/redis/index.js.map +1 -0
  460. package/build/esm/integrations/tracing/redis/vendored/ioredis-instrumentation.js +145 -0
  461. package/build/esm/integrations/tracing/redis/vendored/ioredis-instrumentation.js.map +1 -0
  462. package/build/esm/integrations/tracing/redis/vendored/redis-instrumentation.js +443 -0
  463. package/build/esm/integrations/tracing/redis/vendored/redis-instrumentation.js.map +1 -0
  464. package/build/esm/integrations/tracing/redis/vendored/semconv.js +5 -0
  465. package/build/esm/integrations/tracing/redis/vendored/semconv.js.map +1 -0
  466. package/build/esm/integrations/tracing/tedious/index.js +18 -0
  467. package/build/esm/integrations/tracing/tedious/index.js.map +1 -0
  468. package/build/esm/integrations/tracing/tedious/vendored/instrumentation.js +152 -0
  469. package/build/esm/integrations/tracing/tedious/vendored/instrumentation.js.map +1 -0
  470. package/build/esm/integrations/tracing/tedious/vendored/semconv.js +5 -0
  471. package/build/esm/integrations/tracing/tedious/vendored/semconv.js.map +1 -0
  472. package/build/esm/integrations/tracing/tedious/vendored/utils.js +26 -0
  473. package/build/esm/integrations/tracing/tedious/vendored/utils.js.map +1 -0
  474. package/build/esm/integrations/tracing/vercelai/constants.js +1 -1
  475. package/build/esm/integrations/tracing/vercelai/constants.js.map +1 -1
  476. package/build/esm/integrations/tracing/vercelai/index.js +8 -54
  477. package/build/esm/integrations/tracing/vercelai/index.js.map +1 -1
  478. package/build/esm/integrations/tracing/vercelai/instrumentation.js +60 -158
  479. package/build/esm/integrations/tracing/vercelai/instrumentation.js.map +1 -1
  480. package/build/esm/package.json +1 -1
  481. package/build/esm/preload.js +1 -14
  482. package/build/esm/preload.js.map +1 -1
  483. package/build/esm/sdk/diagnosticsChannelInjection.js +17 -0
  484. package/build/esm/sdk/diagnosticsChannelInjection.js.map +1 -0
  485. package/build/esm/sdk/experimentalUseDiagnosticsChannelInjection.js +30 -0
  486. package/build/esm/sdk/experimentalUseDiagnosticsChannelInjection.js.map +1 -0
  487. package/build/esm/sdk/index.js +33 -36
  488. package/build/esm/sdk/index.js.map +1 -1
  489. package/build/esm/sdk/initOtel.js +77 -63
  490. package/build/esm/sdk/initOtel.js.map +1 -1
  491. package/build/esm/utils/redisCache.js +24 -52
  492. package/build/esm/utils/redisCache.js.map +1 -1
  493. package/build/esm/utils/setHttpServerSpanRouteAttribute.js +19 -0
  494. package/build/esm/utils/setHttpServerSpanRouteAttribute.js.map +1 -0
  495. package/build/import-hook.mjs +6 -0
  496. package/build/types/index.d.ts +6 -4
  497. package/build/types/index.d.ts.map +1 -1
  498. package/build/types/integrations/featureFlagShims/launchDarkly.d.ts +3 -1
  499. package/build/types/integrations/featureFlagShims/launchDarkly.d.ts.map +1 -1
  500. package/build/types/integrations/featureFlagShims/openFeature.d.ts +3 -1
  501. package/build/types/integrations/featureFlagShims/openFeature.d.ts.map +1 -1
  502. package/build/types/integrations/featureFlagShims/statsig.d.ts +3 -1
  503. package/build/types/integrations/featureFlagShims/statsig.d.ts.map +1 -1
  504. package/build/types/integrations/featureFlagShims/unleash.d.ts +3 -1
  505. package/build/types/integrations/featureFlagShims/unleash.d.ts.map +1 -1
  506. package/build/types/integrations/fs/index.d.ts +14 -0
  507. package/build/types/integrations/fs/index.d.ts.map +1 -0
  508. package/build/types/integrations/fs/vendored/constants.d.ts +5 -0
  509. package/build/types/integrations/fs/vendored/constants.d.ts.map +1 -0
  510. package/build/types/integrations/fs/vendored/instrumentation.d.ts +3 -0
  511. package/build/types/integrations/fs/vendored/instrumentation.d.ts.map +1 -0
  512. package/build/types/integrations/fs/vendored/types.d.ts +23 -0
  513. package/build/types/integrations/fs/vendored/types.d.ts.map +1 -0
  514. package/build/types/integrations/fs/vendored/utils.d.ts +10 -0
  515. package/build/types/integrations/fs/vendored/utils.d.ts.map +1 -0
  516. package/build/types/integrations/http.d.ts +12 -17
  517. package/build/types/integrations/http.d.ts.map +1 -1
  518. package/build/types/integrations/node-fetch.d.ts +8 -35
  519. package/build/types/integrations/node-fetch.d.ts.map +1 -1
  520. package/build/types/integrations/tracing/InstrumentationNodeModuleFile.d.ts +9 -0
  521. package/build/types/integrations/tracing/InstrumentationNodeModuleFile.d.ts.map +1 -0
  522. package/build/types/integrations/tracing/{amqplib.d.ts → amqplib/index.d.ts} +5 -3
  523. package/build/types/integrations/tracing/amqplib/index.d.ts.map +1 -0
  524. package/build/types/integrations/tracing/amqplib/vendored/amqplib-types.d.ts +44 -0
  525. package/build/types/integrations/tracing/amqplib/vendored/amqplib-types.d.ts.map +1 -0
  526. package/build/types/integrations/tracing/amqplib/vendored/instrumentation.d.ts +11 -0
  527. package/build/types/integrations/tracing/amqplib/vendored/instrumentation.d.ts.map +1 -0
  528. package/build/types/integrations/tracing/amqplib/vendored/patches.d.ts +11 -0
  529. package/build/types/integrations/tracing/amqplib/vendored/patches.d.ts.map +1 -0
  530. package/build/types/integrations/tracing/amqplib/vendored/semconv.d.ts +23 -0
  531. package/build/types/integrations/tracing/amqplib/vendored/semconv.d.ts.map +1 -0
  532. package/build/types/integrations/tracing/amqplib/vendored/types.d.ts +49 -0
  533. package/build/types/integrations/tracing/amqplib/vendored/types.d.ts.map +1 -0
  534. package/build/types/integrations/tracing/amqplib/vendored/utils.d.ts +42 -0
  535. package/build/types/integrations/tracing/amqplib/vendored/utils.d.ts.map +1 -0
  536. package/build/types/integrations/tracing/anthropic-ai/index.d.ts +11 -8
  537. package/build/types/integrations/tracing/anthropic-ai/index.d.ts.map +1 -1
  538. package/build/types/integrations/tracing/{connect.d.ts → connect/index.d.ts} +5 -3
  539. package/build/types/integrations/tracing/connect/index.d.ts.map +1 -0
  540. package/build/types/integrations/tracing/connect/vendored/enums/AttributeNames.d.ts +9 -0
  541. package/build/types/integrations/tracing/connect/vendored/enums/AttributeNames.d.ts.map +1 -0
  542. package/build/types/integrations/tracing/connect/vendored/instrumentation.d.ts +18 -0
  543. package/build/types/integrations/tracing/connect/vendored/instrumentation.d.ts.map +1 -0
  544. package/build/types/integrations/tracing/connect/vendored/internal-types.d.ts +31 -0
  545. package/build/types/integrations/tracing/connect/vendored/internal-types.d.ts.map +1 -0
  546. package/build/types/integrations/tracing/connect/vendored/utils.d.ts +5 -0
  547. package/build/types/integrations/tracing/connect/vendored/utils.d.ts.map +1 -0
  548. package/build/types/integrations/tracing/{dataloader.d.ts → dataloader/index.d.ts} +5 -3
  549. package/build/types/integrations/tracing/dataloader/index.d.ts.map +1 -0
  550. package/build/types/integrations/tracing/dataloader/vendored/instrumentation.d.ts +18 -0
  551. package/build/types/integrations/tracing/dataloader/vendored/instrumentation.d.ts.map +1 -0
  552. package/build/types/integrations/tracing/dataloader/vendored/types.d.ts +22 -0
  553. package/build/types/integrations/tracing/dataloader/vendored/types.d.ts.map +1 -0
  554. package/build/types/integrations/tracing/express.d.ts +3 -1
  555. package/build/types/integrations/tracing/express.d.ts.map +1 -1
  556. package/build/types/integrations/tracing/fastify/index.d.ts +6 -6
  557. package/build/types/integrations/tracing/fastify/index.d.ts.map +1 -1
  558. package/build/types/integrations/tracing/fastify/v3/instrumentation.d.ts.map +1 -1
  559. package/build/types/integrations/tracing/firebase/firebase.d.ts +3 -1
  560. package/build/types/integrations/tracing/firebase/firebase.d.ts.map +1 -1
  561. package/build/types/integrations/tracing/firebase/otel/firebaseInstrumentation.d.ts +4 -9
  562. package/build/types/integrations/tracing/firebase/otel/firebaseInstrumentation.d.ts.map +1 -1
  563. package/build/types/integrations/tracing/firebase/otel/patches/firestore.d.ts +2 -5
  564. package/build/types/integrations/tracing/firebase/otel/patches/firestore.d.ts.map +1 -1
  565. package/build/types/integrations/tracing/firebase/otel/patches/functions.d.ts +3 -8
  566. package/build/types/integrations/tracing/firebase/otel/patches/functions.d.ts.map +1 -1
  567. package/build/types/integrations/tracing/firebase/otel/types.d.ts +0 -20
  568. package/build/types/integrations/tracing/firebase/otel/types.d.ts.map +1 -1
  569. package/build/types/integrations/tracing/{genericPool.d.ts → genericPool/index.d.ts} +5 -3
  570. package/build/types/integrations/tracing/genericPool/index.d.ts.map +1 -0
  571. package/build/types/integrations/tracing/genericPool/vendored/generic-pool-types.d.ts +5 -0
  572. package/build/types/integrations/tracing/genericPool/vendored/generic-pool-types.d.ts.map +1 -0
  573. package/build/types/integrations/tracing/genericPool/vendored/instrumentation.d.ts +11 -0
  574. package/build/types/integrations/tracing/genericPool/vendored/instrumentation.d.ts.map +1 -0
  575. package/build/types/integrations/tracing/google-genai/index.d.ts +11 -8
  576. package/build/types/integrations/tracing/google-genai/index.d.ts.map +1 -1
  577. package/build/types/integrations/tracing/google-genai/instrumentation.d.ts.map +1 -1
  578. package/build/types/integrations/tracing/{graphql.d.ts → graphql/index.d.ts} +5 -3
  579. package/build/types/integrations/tracing/graphql/index.d.ts.map +1 -0
  580. package/build/types/integrations/tracing/graphql/vendored/enum.d.ts +38 -0
  581. package/build/types/integrations/tracing/graphql/vendored/enum.d.ts.map +1 -0
  582. package/build/types/integrations/tracing/graphql/vendored/enums/AttributeNames.d.ts +10 -0
  583. package/build/types/integrations/tracing/graphql/vendored/enums/AttributeNames.d.ts.map +1 -0
  584. package/build/types/integrations/tracing/graphql/vendored/graphql-types.d.ts +2 -0
  585. package/build/types/integrations/tracing/graphql/vendored/graphql-types.d.ts.map +1 -0
  586. package/build/types/integrations/tracing/graphql/vendored/instrumentation.d.ts +25 -0
  587. package/build/types/integrations/tracing/graphql/vendored/instrumentation.d.ts.map +1 -0
  588. package/build/types/integrations/tracing/graphql/vendored/internal-types.d.ts +63 -0
  589. package/build/types/integrations/tracing/graphql/vendored/internal-types.d.ts.map +1 -0
  590. package/build/types/integrations/tracing/graphql/vendored/symbols.d.ts +3 -0
  591. package/build/types/integrations/tracing/graphql/vendored/symbols.d.ts.map +1 -0
  592. package/build/types/integrations/tracing/graphql/vendored/types.d.ts +33 -0
  593. package/build/types/integrations/tracing/graphql/vendored/types.d.ts.map +1 -0
  594. package/build/types/integrations/tracing/graphql/vendored/utils.d.ts +14 -0
  595. package/build/types/integrations/tracing/graphql/vendored/utils.d.ts.map +1 -0
  596. package/build/types/integrations/tracing/hapi/index.d.ts +4 -2
  597. package/build/types/integrations/tracing/hapi/index.d.ts.map +1 -1
  598. package/build/types/integrations/tracing/hapi/vendored/enums/AttributeNames.d.ts +6 -0
  599. package/build/types/integrations/tracing/hapi/vendored/enums/AttributeNames.d.ts.map +1 -0
  600. package/build/types/integrations/tracing/hapi/vendored/hapi-types.d.ts +70 -0
  601. package/build/types/integrations/tracing/hapi/vendored/hapi-types.d.ts.map +1 -0
  602. package/build/types/integrations/tracing/hapi/vendored/instrumentation.d.ts +72 -0
  603. package/build/types/integrations/tracing/hapi/vendored/instrumentation.d.ts.map +1 -0
  604. package/build/types/integrations/tracing/hapi/vendored/internal-types.d.ts +32 -0
  605. package/build/types/integrations/tracing/hapi/vendored/internal-types.d.ts.map +1 -0
  606. package/build/types/integrations/tracing/hapi/vendored/utils.d.ts +18 -0
  607. package/build/types/integrations/tracing/hapi/vendored/utils.d.ts.map +1 -0
  608. package/build/types/integrations/tracing/hono/index.d.ts +9 -1
  609. package/build/types/integrations/tracing/hono/index.d.ts.map +1 -1
  610. package/build/types/integrations/tracing/index.d.ts.map +1 -1
  611. package/build/types/integrations/tracing/{kafka.d.ts → kafka/index.d.ts} +5 -3
  612. package/build/types/integrations/tracing/kafka/index.d.ts.map +1 -0
  613. package/build/types/integrations/tracing/kafka/vendored/instrumentation.d.ts +15 -0
  614. package/build/types/integrations/tracing/kafka/vendored/instrumentation.d.ts.map +1 -0
  615. package/build/types/integrations/tracing/kafka/vendored/kafkajs-types.d.ts +79 -0
  616. package/build/types/integrations/tracing/kafka/vendored/kafkajs-types.d.ts.map +1 -0
  617. package/build/types/integrations/tracing/kafka/vendored/semconv.d.ts +54 -0
  618. package/build/types/integrations/tracing/kafka/vendored/semconv.d.ts.map +1 -0
  619. package/build/types/integrations/tracing/kafka/vendored/utils.d.ts +29 -0
  620. package/build/types/integrations/tracing/kafka/vendored/utils.d.ts.map +1 -0
  621. package/build/types/integrations/tracing/{knex.d.ts → knex/index.d.ts} +5 -3
  622. package/build/types/integrations/tracing/knex/index.d.ts.map +1 -0
  623. package/build/types/integrations/tracing/knex/vendored/instrumentation.d.ts +12 -0
  624. package/build/types/integrations/tracing/knex/vendored/instrumentation.d.ts.map +1 -0
  625. package/build/types/integrations/tracing/knex/vendored/semconv.d.ts +7 -0
  626. package/build/types/integrations/tracing/knex/vendored/semconv.d.ts.map +1 -0
  627. package/build/types/integrations/tracing/knex/vendored/utils.d.ts +9 -0
  628. package/build/types/integrations/tracing/knex/vendored/utils.d.ts.map +1 -0
  629. package/build/types/integrations/tracing/{koa.d.ts → koa/index.d.ts} +5 -3
  630. package/build/types/integrations/tracing/koa/index.d.ts.map +1 -0
  631. package/build/types/integrations/tracing/koa/vendored/enums/AttributeNames.d.ts +5 -0
  632. package/build/types/integrations/tracing/koa/vendored/enums/AttributeNames.d.ts.map +1 -0
  633. package/build/types/integrations/tracing/koa/vendored/instrumentation.d.ts +32 -0
  634. package/build/types/integrations/tracing/koa/vendored/instrumentation.d.ts.map +1 -0
  635. package/build/types/integrations/tracing/koa/vendored/internal-types.d.ts +34 -0
  636. package/build/types/integrations/tracing/koa/vendored/internal-types.d.ts.map +1 -0
  637. package/build/types/integrations/tracing/koa/vendored/types.d.ts +13 -0
  638. package/build/types/integrations/tracing/koa/vendored/types.d.ts.map +1 -0
  639. package/build/types/integrations/tracing/koa/vendored/utils.d.ts +15 -0
  640. package/build/types/integrations/tracing/koa/vendored/utils.d.ts.map +1 -0
  641. package/build/types/integrations/tracing/langchain/index.d.ts +12 -9
  642. package/build/types/integrations/tracing/langchain/index.d.ts.map +1 -1
  643. package/build/types/integrations/tracing/langchain/instrumentation.d.ts.map +1 -1
  644. package/build/types/integrations/tracing/langgraph/index.d.ts +11 -8
  645. package/build/types/integrations/tracing/langgraph/index.d.ts.map +1 -1
  646. package/build/types/integrations/tracing/langgraph/instrumentation.d.ts +1 -1
  647. package/build/types/integrations/tracing/langgraph/instrumentation.d.ts.map +1 -1
  648. package/build/types/integrations/tracing/{lrumemoizer.d.ts → lrumemoizer/index.d.ts} +5 -3
  649. package/build/types/integrations/tracing/lrumemoizer/index.d.ts.map +1 -0
  650. package/build/types/integrations/tracing/lrumemoizer/vendored/instrumentation.d.ts +6 -0
  651. package/build/types/integrations/tracing/lrumemoizer/vendored/instrumentation.d.ts.map +1 -0
  652. package/build/{types-ts3.8/integrations/tracing/mongo.d.ts → types/integrations/tracing/mongo/index.d.ts} +22 -24
  653. package/build/types/integrations/tracing/mongo/index.d.ts.map +1 -0
  654. package/build/types/integrations/tracing/mongo/vendored/instrumentation.d.ts +11 -0
  655. package/build/types/integrations/tracing/mongo/vendored/instrumentation.d.ts.map +1 -0
  656. package/build/types/integrations/tracing/mongo/vendored/internal-types.d.ts +62 -0
  657. package/build/types/integrations/tracing/mongo/vendored/internal-types.d.ts.map +1 -0
  658. package/build/types/integrations/tracing/mongo/vendored/patches.d.ts +15 -0
  659. package/build/types/integrations/tracing/mongo/vendored/patches.d.ts.map +1 -0
  660. package/build/types/integrations/tracing/mongo/vendored/utils.d.ts +15 -0
  661. package/build/types/integrations/tracing/mongo/vendored/utils.d.ts.map +1 -0
  662. package/build/types/integrations/tracing/{mongoose.d.ts → mongoose/index.d.ts} +5 -3
  663. package/build/types/integrations/tracing/mongoose/index.d.ts.map +1 -0
  664. package/build/types/integrations/tracing/mongoose/vendored/mongoose-types.d.ts +33 -0
  665. package/build/types/integrations/tracing/mongoose/vendored/mongoose-types.d.ts.map +1 -0
  666. package/build/types/integrations/tracing/mongoose/vendored/mongoose.d.ts +18 -0
  667. package/build/types/integrations/tracing/mongoose/vendored/mongoose.d.ts.map +1 -0
  668. package/build/types/integrations/tracing/mongoose/vendored/utils.d.ts +4 -0
  669. package/build/types/integrations/tracing/mongoose/vendored/utils.d.ts.map +1 -0
  670. package/build/types/integrations/tracing/{mysql.d.ts → mysql/index.d.ts} +5 -3
  671. package/build/types/integrations/tracing/mysql/index.d.ts.map +1 -0
  672. package/build/types/integrations/tracing/mysql/vendored/instrumentation.d.ts +14 -0
  673. package/build/types/integrations/tracing/mysql/vendored/instrumentation.d.ts.map +1 -0
  674. package/build/types/integrations/tracing/mysql/vendored/mysql-types.d.ts +78 -0
  675. package/build/types/integrations/tracing/mysql/vendored/mysql-types.d.ts.map +1 -0
  676. package/build/types/integrations/tracing/mysql/vendored/semconv.d.ts +19 -0
  677. package/build/types/integrations/tracing/mysql/vendored/semconv.d.ts.map +1 -0
  678. package/build/types/integrations/tracing/mysql/vendored/utils.d.ts +22 -0
  679. package/build/types/integrations/tracing/mysql/vendored/utils.d.ts.map +1 -0
  680. package/build/types/integrations/tracing/{mysql2.d.ts → mysql2/index.d.ts} +5 -3
  681. package/build/types/integrations/tracing/mysql2/index.d.ts.map +1 -0
  682. package/build/types/integrations/tracing/mysql2/vendored/instrumentation.d.ts +9 -0
  683. package/build/types/integrations/tracing/mysql2/vendored/instrumentation.d.ts.map +1 -0
  684. package/build/types/integrations/tracing/mysql2/vendored/mysql2-types.d.ts +39 -0
  685. package/build/types/integrations/tracing/mysql2/vendored/mysql2-types.d.ts.map +1 -0
  686. package/build/types/integrations/tracing/mysql2/vendored/semconv.d.ts +3 -0
  687. package/build/types/integrations/tracing/mysql2/vendored/semconv.d.ts.map +1 -0
  688. package/build/types/integrations/tracing/mysql2/vendored/utils.d.ts +25 -0
  689. package/build/types/integrations/tracing/mysql2/vendored/utils.d.ts.map +1 -0
  690. package/build/types/integrations/tracing/openai/index.d.ts +11 -8
  691. package/build/types/integrations/tracing/openai/index.d.ts.map +1 -1
  692. package/build/types/integrations/tracing/{postgres.d.ts → postgres/index.d.ts} +5 -3
  693. package/build/types/integrations/tracing/postgres/index.d.ts.map +1 -0
  694. package/build/types/integrations/tracing/postgres/vendored/enums/AttributeNames.d.ts +6 -0
  695. package/build/types/integrations/tracing/postgres/vendored/enums/AttributeNames.d.ts.map +1 -0
  696. package/build/types/integrations/tracing/postgres/vendored/enums/SpanNames.d.ts +6 -0
  697. package/build/types/integrations/tracing/postgres/vendored/enums/SpanNames.d.ts.map +1 -0
  698. package/build/types/integrations/tracing/postgres/vendored/instrumentation.d.ts +12 -0
  699. package/build/types/integrations/tracing/postgres/vendored/instrumentation.d.ts.map +1 -0
  700. package/build/types/integrations/tracing/postgres/vendored/internal-types.d.ts +33 -0
  701. package/build/types/integrations/tracing/postgres/vendored/internal-types.d.ts.map +1 -0
  702. package/build/types/integrations/tracing/postgres/vendored/pg-pool-types.d.ts +20 -0
  703. package/build/types/integrations/tracing/postgres/vendored/pg-pool-types.d.ts.map +1 -0
  704. package/build/types/integrations/tracing/postgres/vendored/pg-types.d.ts +54 -0
  705. package/build/types/integrations/tracing/postgres/vendored/pg-types.d.ts.map +1 -0
  706. package/build/types/integrations/tracing/postgres/vendored/semconv.d.ts +13 -0
  707. package/build/types/integrations/tracing/postgres/vendored/semconv.d.ts.map +1 -0
  708. package/build/types/integrations/tracing/postgres/vendored/types.d.ts +11 -0
  709. package/build/types/integrations/tracing/postgres/vendored/types.d.ts.map +1 -0
  710. package/build/types/integrations/tracing/postgres/vendored/utils.d.ts +56 -0
  711. package/build/types/integrations/tracing/postgres/vendored/utils.d.ts.map +1 -0
  712. package/build/types/integrations/tracing/postgresjs.d.ts +3 -1
  713. package/build/types/integrations/tracing/postgresjs.d.ts.map +1 -1
  714. package/build/types/integrations/tracing/redis/cache.d.ts +22 -0
  715. package/build/types/integrations/tracing/redis/cache.d.ts.map +1 -0
  716. package/build/types/integrations/tracing/redis/index.d.ts +28 -0
  717. package/build/types/integrations/tracing/redis/index.d.ts.map +1 -0
  718. package/build/types/integrations/tracing/redis/vendored/ioredis-instrumentation.d.ts +10 -0
  719. package/build/types/integrations/tracing/redis/vendored/ioredis-instrumentation.d.ts.map +1 -0
  720. package/build/types/integrations/tracing/redis/vendored/redis-instrumentation.d.ts +16 -0
  721. package/build/types/integrations/tracing/redis/vendored/redis-instrumentation.d.ts.map +1 -0
  722. package/build/types/integrations/tracing/redis/vendored/semconv.d.ts +4 -0
  723. package/build/types/integrations/tracing/redis/vendored/semconv.d.ts.map +1 -0
  724. package/build/types/integrations/tracing/redis/vendored/types.d.ts +24 -0
  725. package/build/types/integrations/tracing/redis/vendored/types.d.ts.map +1 -0
  726. package/build/types/integrations/tracing/{tedious.d.ts → tedious/index.d.ts} +5 -3
  727. package/build/types/integrations/tracing/tedious/index.d.ts.map +1 -0
  728. package/build/types/integrations/tracing/tedious/vendored/instrumentation.d.ts +11 -0
  729. package/build/types/integrations/tracing/tedious/vendored/instrumentation.d.ts.map +1 -0
  730. package/build/types/integrations/tracing/tedious/vendored/semconv.d.ts +19 -0
  731. package/build/types/integrations/tracing/tedious/vendored/semconv.d.ts.map +1 -0
  732. package/build/types/integrations/tracing/tedious/vendored/tedious-types.d.ts +21 -0
  733. package/build/types/integrations/tracing/tedious/vendored/tedious-types.d.ts.map +1 -0
  734. package/build/types/integrations/tracing/tedious/vendored/utils.d.ts +9 -0
  735. package/build/types/integrations/tracing/tedious/vendored/utils.d.ts.map +1 -0
  736. package/build/types/integrations/tracing/vercelai/constants.d.ts +1 -1
  737. package/build/types/integrations/tracing/vercelai/constants.d.ts.map +1 -1
  738. package/build/types/integrations/tracing/vercelai/index.d.ts +3 -2
  739. package/build/types/integrations/tracing/vercelai/index.d.ts.map +1 -1
  740. package/build/types/integrations/tracing/vercelai/instrumentation.d.ts +2 -2
  741. package/build/types/integrations/tracing/vercelai/instrumentation.d.ts.map +1 -1
  742. package/build/types/integrations/tracing/vercelai/types.d.ts +11 -4
  743. package/build/types/integrations/tracing/vercelai/types.d.ts.map +1 -1
  744. package/build/types/sdk/diagnosticsChannelInjection.d.ts +41 -0
  745. package/build/types/sdk/diagnosticsChannelInjection.d.ts.map +1 -0
  746. package/build/types/sdk/experimentalUseDiagnosticsChannelInjection.d.ts +37 -0
  747. package/build/types/sdk/experimentalUseDiagnosticsChannelInjection.d.ts.map +1 -0
  748. package/build/types/sdk/index.d.ts +18 -0
  749. package/build/types/sdk/index.d.ts.map +1 -1
  750. package/build/types/sdk/initOtel.d.ts +2 -3
  751. package/build/types/sdk/initOtel.d.ts.map +1 -1
  752. package/build/types/utils/redisCache.d.ts +1 -1
  753. package/build/types/utils/redisCache.d.ts.map +1 -1
  754. package/build/types/utils/setHttpServerSpanRouteAttribute.d.ts +9 -0
  755. package/build/types/utils/setHttpServerSpanRouteAttribute.d.ts.map +1 -0
  756. package/build/types-ts3.8/index.d.ts +6 -4
  757. package/build/types-ts3.8/integrations/featureFlagShims/launchDarkly.d.ts +3 -1
  758. package/build/types-ts3.8/integrations/featureFlagShims/openFeature.d.ts +3 -1
  759. package/build/types-ts3.8/integrations/featureFlagShims/statsig.d.ts +3 -1
  760. package/build/types-ts3.8/integrations/featureFlagShims/unleash.d.ts +3 -1
  761. package/build/types-ts3.8/integrations/fs/index.d.ts +14 -0
  762. package/build/types-ts3.8/integrations/fs/vendored/constants.d.ts +5 -0
  763. package/build/types-ts3.8/integrations/fs/vendored/instrumentation.d.ts +3 -0
  764. package/build/types-ts3.8/integrations/fs/vendored/types.d.ts +23 -0
  765. package/build/types-ts3.8/integrations/fs/vendored/utils.d.ts +15 -0
  766. package/build/types-ts3.8/integrations/http.d.ts +12 -17
  767. package/build/types-ts3.8/integrations/node-fetch.d.ts +8 -35
  768. package/build/types-ts3.8/integrations/tracing/InstrumentationNodeModuleFile.d.ts +9 -0
  769. package/build/types-ts3.8/integrations/tracing/{amqplib.d.ts → amqplib/index.d.ts} +5 -3
  770. package/build/types-ts3.8/integrations/tracing/amqplib/vendored/amqplib-types.d.ts +44 -0
  771. package/build/types-ts3.8/integrations/tracing/amqplib/vendored/instrumentation.d.ts +11 -0
  772. package/build/types-ts3.8/integrations/tracing/amqplib/vendored/patches.d.ts +11 -0
  773. package/build/types-ts3.8/integrations/tracing/amqplib/vendored/semconv.d.ts +23 -0
  774. package/build/types-ts3.8/integrations/tracing/amqplib/vendored/types.d.ts +49 -0
  775. package/build/types-ts3.8/integrations/tracing/amqplib/vendored/utils.d.ts +42 -0
  776. package/build/types-ts3.8/integrations/tracing/anthropic-ai/index.d.ts +11 -8
  777. package/build/types-ts3.8/integrations/tracing/{connect.d.ts → connect/index.d.ts} +5 -3
  778. package/build/types-ts3.8/integrations/tracing/connect/vendored/enums/AttributeNames.d.ts +9 -0
  779. package/build/types-ts3.8/integrations/tracing/connect/vendored/instrumentation.d.ts +18 -0
  780. package/build/types-ts3.8/integrations/tracing/connect/vendored/internal-types.d.ts +36 -0
  781. package/build/types-ts3.8/integrations/tracing/connect/vendored/utils.d.ts +5 -0
  782. package/build/types-ts3.8/integrations/tracing/{dataloader.d.ts → dataloader/index.d.ts} +5 -3
  783. package/build/types-ts3.8/integrations/tracing/dataloader/vendored/instrumentation.d.ts +18 -0
  784. package/build/types-ts3.8/integrations/tracing/dataloader/vendored/types.d.ts +22 -0
  785. package/build/types-ts3.8/integrations/tracing/express.d.ts +3 -1
  786. package/build/types-ts3.8/integrations/tracing/fastify/index.d.ts +6 -6
  787. package/build/types-ts3.8/integrations/tracing/firebase/firebase.d.ts +3 -1
  788. package/build/types-ts3.8/integrations/tracing/firebase/otel/firebaseInstrumentation.d.ts +4 -9
  789. package/build/types-ts3.8/integrations/tracing/firebase/otel/patches/firestore.d.ts +2 -5
  790. package/build/types-ts3.8/integrations/tracing/firebase/otel/patches/functions.d.ts +3 -8
  791. package/build/types-ts3.8/integrations/tracing/firebase/otel/types.d.ts +0 -20
  792. package/build/types-ts3.8/integrations/tracing/{genericPool.d.ts → genericPool/index.d.ts} +5 -3
  793. package/build/types-ts3.8/integrations/tracing/genericPool/vendored/generic-pool-types.d.ts +5 -0
  794. package/build/types-ts3.8/integrations/tracing/genericPool/vendored/instrumentation.d.ts +11 -0
  795. package/build/types-ts3.8/integrations/tracing/google-genai/index.d.ts +11 -8
  796. package/build/types-ts3.8/integrations/tracing/{graphql.d.ts → graphql/index.d.ts} +5 -3
  797. package/build/types-ts3.8/integrations/tracing/graphql/vendored/enum.d.ts +38 -0
  798. package/build/types-ts3.8/integrations/tracing/graphql/vendored/enums/AttributeNames.d.ts +10 -0
  799. package/build/types-ts3.8/integrations/tracing/graphql/vendored/graphql-types.d.ts +2 -0
  800. package/build/types-ts3.8/integrations/tracing/graphql/vendored/instrumentation.d.ts +25 -0
  801. package/build/types-ts3.8/integrations/tracing/graphql/vendored/internal-types.d.ts +63 -0
  802. package/build/types-ts3.8/integrations/tracing/graphql/vendored/symbols.d.ts +3 -0
  803. package/build/types-ts3.8/integrations/tracing/graphql/vendored/types.d.ts +33 -0
  804. package/build/types-ts3.8/integrations/tracing/graphql/vendored/utils.d.ts +14 -0
  805. package/build/types-ts3.8/integrations/tracing/hapi/index.d.ts +4 -2
  806. package/build/types-ts3.8/integrations/tracing/hapi/vendored/enums/AttributeNames.d.ts +6 -0
  807. package/build/types-ts3.8/integrations/tracing/hapi/vendored/hapi-types.d.ts +70 -0
  808. package/build/types-ts3.8/integrations/tracing/hapi/vendored/instrumentation.d.ts +72 -0
  809. package/build/types-ts3.8/integrations/tracing/hapi/vendored/internal-types.d.ts +32 -0
  810. package/build/types-ts3.8/integrations/tracing/hapi/vendored/utils.d.ts +18 -0
  811. package/build/types-ts3.8/integrations/tracing/hono/index.d.ts +9 -1
  812. package/build/types-ts3.8/integrations/tracing/{kafka.d.ts → kafka/index.d.ts} +5 -3
  813. package/build/types-ts3.8/integrations/tracing/kafka/vendored/instrumentation.d.ts +15 -0
  814. package/build/types-ts3.8/integrations/tracing/kafka/vendored/kafkajs-types.d.ts +79 -0
  815. package/build/types-ts3.8/integrations/tracing/kafka/vendored/semconv.d.ts +54 -0
  816. package/build/types-ts3.8/integrations/tracing/kafka/vendored/utils.d.ts +29 -0
  817. package/build/types-ts3.8/integrations/tracing/{knex.d.ts → knex/index.d.ts} +5 -3
  818. package/build/types-ts3.8/integrations/tracing/knex/vendored/instrumentation.d.ts +12 -0
  819. package/build/types-ts3.8/integrations/tracing/knex/vendored/semconv.d.ts +7 -0
  820. package/build/types-ts3.8/integrations/tracing/knex/vendored/utils.d.ts +9 -0
  821. package/build/types-ts3.8/integrations/tracing/{koa.d.ts → koa/index.d.ts} +5 -3
  822. package/build/types-ts3.8/integrations/tracing/koa/vendored/enums/AttributeNames.d.ts +5 -0
  823. package/build/types-ts3.8/integrations/tracing/koa/vendored/instrumentation.d.ts +32 -0
  824. package/build/types-ts3.8/integrations/tracing/koa/vendored/internal-types.d.ts +34 -0
  825. package/build/types-ts3.8/integrations/tracing/koa/vendored/types.d.ts +13 -0
  826. package/build/types-ts3.8/integrations/tracing/koa/vendored/utils.d.ts +15 -0
  827. package/build/types-ts3.8/integrations/tracing/langchain/index.d.ts +12 -9
  828. package/build/types-ts3.8/integrations/tracing/langgraph/index.d.ts +11 -8
  829. package/build/types-ts3.8/integrations/tracing/langgraph/instrumentation.d.ts +1 -1
  830. package/build/types-ts3.8/integrations/tracing/{lrumemoizer.d.ts → lrumemoizer/index.d.ts} +5 -3
  831. package/build/types-ts3.8/integrations/tracing/lrumemoizer/vendored/instrumentation.d.ts +6 -0
  832. package/build/{types/integrations/tracing/mongo.d.ts → types-ts3.8/integrations/tracing/mongo/index.d.ts} +22 -24
  833. package/build/types-ts3.8/integrations/tracing/mongo/vendored/instrumentation.d.ts +11 -0
  834. package/build/types-ts3.8/integrations/tracing/mongo/vendored/internal-types.d.ts +62 -0
  835. package/build/types-ts3.8/integrations/tracing/mongo/vendored/patches.d.ts +15 -0
  836. package/build/types-ts3.8/integrations/tracing/mongo/vendored/utils.d.ts +15 -0
  837. package/build/types-ts3.8/integrations/tracing/{mongoose.d.ts → mongoose/index.d.ts} +5 -3
  838. package/build/types-ts3.8/integrations/tracing/mongoose/vendored/mongoose-types.d.ts +33 -0
  839. package/build/types-ts3.8/integrations/tracing/mongoose/vendored/mongoose.d.ts +18 -0
  840. package/build/types-ts3.8/integrations/tracing/mongoose/vendored/utils.d.ts +4 -0
  841. package/build/types-ts3.8/integrations/tracing/{mysql.d.ts → mysql/index.d.ts} +5 -3
  842. package/build/types-ts3.8/integrations/tracing/mysql/vendored/instrumentation.d.ts +14 -0
  843. package/build/types-ts3.8/integrations/tracing/mysql/vendored/mysql-types.d.ts +78 -0
  844. package/build/types-ts3.8/integrations/tracing/mysql/vendored/semconv.d.ts +19 -0
  845. package/build/types-ts3.8/integrations/tracing/mysql/vendored/utils.d.ts +22 -0
  846. package/build/types-ts3.8/integrations/tracing/{mysql2.d.ts → mysql2/index.d.ts} +5 -3
  847. package/build/types-ts3.8/integrations/tracing/mysql2/vendored/instrumentation.d.ts +9 -0
  848. package/build/types-ts3.8/integrations/tracing/mysql2/vendored/mysql2-types.d.ts +39 -0
  849. package/build/types-ts3.8/integrations/tracing/mysql2/vendored/semconv.d.ts +3 -0
  850. package/build/types-ts3.8/integrations/tracing/mysql2/vendored/utils.d.ts +25 -0
  851. package/build/types-ts3.8/integrations/tracing/openai/index.d.ts +11 -8
  852. package/build/types-ts3.8/integrations/tracing/{postgres.d.ts → postgres/index.d.ts} +5 -3
  853. package/build/types-ts3.8/integrations/tracing/postgres/vendored/enums/AttributeNames.d.ts +6 -0
  854. package/build/types-ts3.8/integrations/tracing/postgres/vendored/enums/SpanNames.d.ts +6 -0
  855. package/build/types-ts3.8/integrations/tracing/postgres/vendored/instrumentation.d.ts +12 -0
  856. package/build/types-ts3.8/integrations/tracing/postgres/vendored/internal-types.d.ts +33 -0
  857. package/build/types-ts3.8/integrations/tracing/postgres/vendored/pg-pool-types.d.ts +20 -0
  858. package/build/types-ts3.8/integrations/tracing/postgres/vendored/pg-types.d.ts +54 -0
  859. package/build/types-ts3.8/integrations/tracing/postgres/vendored/semconv.d.ts +13 -0
  860. package/build/types-ts3.8/integrations/tracing/postgres/vendored/types.d.ts +11 -0
  861. package/build/types-ts3.8/integrations/tracing/postgres/vendored/utils.d.ts +56 -0
  862. package/build/types-ts3.8/integrations/tracing/postgresjs.d.ts +3 -1
  863. package/build/types-ts3.8/integrations/tracing/redis/cache.d.ts +22 -0
  864. package/build/types-ts3.8/integrations/tracing/redis/index.d.ts +28 -0
  865. package/build/types-ts3.8/integrations/tracing/redis/vendored/ioredis-instrumentation.d.ts +10 -0
  866. package/build/types-ts3.8/integrations/tracing/redis/vendored/redis-instrumentation.d.ts +16 -0
  867. package/build/types-ts3.8/integrations/tracing/redis/vendored/semconv.d.ts +4 -0
  868. package/build/types-ts3.8/integrations/tracing/redis/vendored/types.d.ts +24 -0
  869. package/build/types-ts3.8/integrations/tracing/{tedious.d.ts → tedious/index.d.ts} +5 -3
  870. package/build/types-ts3.8/integrations/tracing/tedious/vendored/instrumentation.d.ts +11 -0
  871. package/build/types-ts3.8/integrations/tracing/tedious/vendored/semconv.d.ts +19 -0
  872. package/build/types-ts3.8/integrations/tracing/tedious/vendored/tedious-types.d.ts +21 -0
  873. package/build/types-ts3.8/integrations/tracing/tedious/vendored/utils.d.ts +9 -0
  874. package/build/types-ts3.8/integrations/tracing/vercelai/constants.d.ts +1 -1
  875. package/build/types-ts3.8/integrations/tracing/vercelai/index.d.ts +3 -2
  876. package/build/types-ts3.8/integrations/tracing/vercelai/instrumentation.d.ts +2 -2
  877. package/build/types-ts3.8/integrations/tracing/vercelai/types.d.ts +11 -4
  878. package/build/types-ts3.8/sdk/diagnosticsChannelInjection.d.ts +41 -0
  879. package/build/types-ts3.8/sdk/experimentalUseDiagnosticsChannelInjection.d.ts +37 -0
  880. package/build/types-ts3.8/sdk/index.d.ts +18 -0
  881. package/build/types-ts3.8/sdk/initOtel.d.ts +3 -4
  882. package/build/types-ts3.8/utils/redisCache.d.ts +1 -1
  883. package/build/types-ts3.8/utils/setHttpServerSpanRouteAttribute.d.ts +9 -0
  884. package/changes.json +13 -9
  885. package/package.json +37 -44
  886. package/build/cjs/integrations/fs.js +0 -142
  887. package/build/cjs/integrations/fs.js.map +0 -1
  888. package/build/cjs/integrations/tracing/amqplib.js +0 -47
  889. package/build/cjs/integrations/tracing/amqplib.js.map +0 -1
  890. package/build/cjs/integrations/tracing/connect.js +0 -110
  891. package/build/cjs/integrations/tracing/connect.js.map +0 -1
  892. package/build/cjs/integrations/tracing/dataloader.js +0 -72
  893. package/build/cjs/integrations/tracing/dataloader.js.map +0 -1
  894. package/build/cjs/integrations/tracing/genericPool.js +0 -59
  895. package/build/cjs/integrations/tracing/genericPool.js.map +0 -1
  896. package/build/cjs/integrations/tracing/graphql.js +0 -127
  897. package/build/cjs/integrations/tracing/graphql.js.map +0 -1
  898. package/build/cjs/integrations/tracing/kafka.js +0 -48
  899. package/build/cjs/integrations/tracing/kafka.js.map +0 -1
  900. package/build/cjs/integrations/tracing/knex.js +0 -57
  901. package/build/cjs/integrations/tracing/knex.js.map +0 -1
  902. package/build/cjs/integrations/tracing/koa.js +0 -138
  903. package/build/cjs/integrations/tracing/koa.js.map +0 -1
  904. package/build/cjs/integrations/tracing/lrumemoizer.js +0 -37
  905. package/build/cjs/integrations/tracing/lrumemoizer.js.map +0 -1
  906. package/build/cjs/integrations/tracing/mongo.js +0 -93
  907. package/build/cjs/integrations/tracing/mongo.js.map +0 -1
  908. package/build/cjs/integrations/tracing/mongoose.js +0 -46
  909. package/build/cjs/integrations/tracing/mongoose.js.map +0 -1
  910. package/build/cjs/integrations/tracing/mysql.js +0 -38
  911. package/build/cjs/integrations/tracing/mysql.js.map +0 -1
  912. package/build/cjs/integrations/tracing/mysql2.js +0 -46
  913. package/build/cjs/integrations/tracing/mysql2.js.map +0 -1
  914. package/build/cjs/integrations/tracing/postgres.js +0 -48
  915. package/build/cjs/integrations/tracing/postgres.js.map +0 -1
  916. package/build/cjs/integrations/tracing/prisma.js +0 -203
  917. package/build/cjs/integrations/tracing/prisma.js.map +0 -1
  918. package/build/cjs/integrations/tracing/redis.js +0 -121
  919. package/build/cjs/integrations/tracing/redis.js.map +0 -1
  920. package/build/cjs/integrations/tracing/tedious.js +0 -67
  921. package/build/cjs/integrations/tracing/tedious.js.map +0 -1
  922. package/build/esm/integrations/fs.js +0 -140
  923. package/build/esm/integrations/fs.js.map +0 -1
  924. package/build/esm/integrations/tracing/amqplib.js +0 -44
  925. package/build/esm/integrations/tracing/amqplib.js.map +0 -1
  926. package/build/esm/integrations/tracing/connect.js +0 -106
  927. package/build/esm/integrations/tracing/connect.js.map +0 -1
  928. package/build/esm/integrations/tracing/dataloader.js +0 -69
  929. package/build/esm/integrations/tracing/dataloader.js.map +0 -1
  930. package/build/esm/integrations/tracing/genericPool.js +0 -56
  931. package/build/esm/integrations/tracing/genericPool.js.map +0 -1
  932. package/build/esm/integrations/tracing/graphql.js +0 -124
  933. package/build/esm/integrations/tracing/graphql.js.map +0 -1
  934. package/build/esm/integrations/tracing/kafka.js +0 -45
  935. package/build/esm/integrations/tracing/kafka.js.map +0 -1
  936. package/build/esm/integrations/tracing/knex.js +0 -54
  937. package/build/esm/integrations/tracing/knex.js.map +0 -1
  938. package/build/esm/integrations/tracing/koa.js +0 -134
  939. package/build/esm/integrations/tracing/koa.js.map +0 -1
  940. package/build/esm/integrations/tracing/lrumemoizer.js +0 -34
  941. package/build/esm/integrations/tracing/lrumemoizer.js.map +0 -1
  942. package/build/esm/integrations/tracing/mongo.js +0 -89
  943. package/build/esm/integrations/tracing/mongo.js.map +0 -1
  944. package/build/esm/integrations/tracing/mongoose.js +0 -43
  945. package/build/esm/integrations/tracing/mongoose.js.map +0 -1
  946. package/build/esm/integrations/tracing/mysql.js +0 -35
  947. package/build/esm/integrations/tracing/mysql.js.map +0 -1
  948. package/build/esm/integrations/tracing/mysql2.js +0 -43
  949. package/build/esm/integrations/tracing/mysql2.js.map +0 -1
  950. package/build/esm/integrations/tracing/postgres.js +0 -45
  951. package/build/esm/integrations/tracing/postgres.js.map +0 -1
  952. package/build/esm/integrations/tracing/prisma.js +0 -200
  953. package/build/esm/integrations/tracing/prisma.js.map +0 -1
  954. package/build/esm/integrations/tracing/redis.js +0 -117
  955. package/build/esm/integrations/tracing/redis.js.map +0 -1
  956. package/build/esm/integrations/tracing/tedious.js +0 -64
  957. package/build/esm/integrations/tracing/tedious.js.map +0 -1
  958. package/build/types/integrations/fs.d.ts +0 -24
  959. package/build/types/integrations/fs.d.ts.map +0 -1
  960. package/build/types/integrations/tracing/amqplib.d.ts.map +0 -1
  961. package/build/types/integrations/tracing/connect.d.ts.map +0 -1
  962. package/build/types/integrations/tracing/dataloader.d.ts.map +0 -1
  963. package/build/types/integrations/tracing/genericPool.d.ts.map +0 -1
  964. package/build/types/integrations/tracing/graphql.d.ts.map +0 -1
  965. package/build/types/integrations/tracing/kafka.d.ts.map +0 -1
  966. package/build/types/integrations/tracing/knex.d.ts.map +0 -1
  967. package/build/types/integrations/tracing/koa.d.ts.map +0 -1
  968. package/build/types/integrations/tracing/lrumemoizer.d.ts.map +0 -1
  969. package/build/types/integrations/tracing/mongo.d.ts.map +0 -1
  970. package/build/types/integrations/tracing/mongoose.d.ts.map +0 -1
  971. package/build/types/integrations/tracing/mysql.d.ts.map +0 -1
  972. package/build/types/integrations/tracing/mysql2.d.ts.map +0 -1
  973. package/build/types/integrations/tracing/postgres.d.ts.map +0 -1
  974. package/build/types/integrations/tracing/prisma/vendor/v5-tracing-helper.d.ts +0 -38
  975. package/build/types/integrations/tracing/prisma/vendor/v5-tracing-helper.d.ts.map +0 -1
  976. package/build/types/integrations/tracing/prisma/vendor/v6-tracing-helper.d.ts +0 -31
  977. package/build/types/integrations/tracing/prisma/vendor/v6-tracing-helper.d.ts.map +0 -1
  978. package/build/types/integrations/tracing/prisma.d.ts +0 -50
  979. package/build/types/integrations/tracing/prisma.d.ts.map +0 -1
  980. package/build/types/integrations/tracing/redis.d.ts +0 -41
  981. package/build/types/integrations/tracing/redis.d.ts.map +0 -1
  982. package/build/types/integrations/tracing/tedious.d.ts.map +0 -1
  983. package/build/types-ts3.8/integrations/fs.d.ts +0 -24
  984. package/build/types-ts3.8/integrations/tracing/prisma/vendor/v5-tracing-helper.d.ts +0 -44
  985. package/build/types-ts3.8/integrations/tracing/prisma/vendor/v6-tracing-helper.d.ts +0 -34
  986. package/build/types-ts3.8/integrations/tracing/prisma.d.ts +0 -50
  987. package/build/types-ts3.8/integrations/tracing/redis.d.ts +0 -41
@@ -1,160 +1,76 @@
1
- import { SpanKind, context, trace, diag } from '@opentelemetry/api';
2
- import { InstrumentationNodeModuleDefinition, InstrumentationNodeModuleFile, isWrapped, safeExecuteInTheMiddle } from '@opentelemetry/instrumentation';
1
+ import { InstrumentationNodeModuleDefinition, isWrapped } from '@opentelemetry/instrumentation';
2
+ import { InstrumentationNodeModuleFile } from '../../../InstrumentationNodeModuleFile.js';
3
+ import { startSpanManual, SPAN_KIND, SPAN_STATUS_ERROR, captureException, flush, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/core';
3
4
 
4
- /**
5
- * Patches Firebase Functions v2 to add OpenTelemetry instrumentation
6
- * @param tracer - Opentelemetry Tracer
7
- * @param functionsSupportedVersions - supported versions of firebase-functions
8
- * @param wrap - reference to native instrumentation wrap function
9
- * @param unwrap - reference to native instrumentation unwrap function
10
- * @param config - Firebase instrumentation config
11
- */
12
- function patchFunctions(
13
- tracer,
14
- functionsSupportedVersions,
15
- wrap,
16
- unwrap,
17
- config,
18
- ) {
19
- let requestHook = () => {};
20
- let responseHook = () => {};
21
- const errorHook = config.functions?.errorHook;
22
- const configRequestHook = config.functions?.requestHook;
23
- const configResponseHook = config.functions?.responseHook;
24
-
25
- if (typeof configResponseHook === 'function') {
26
- responseHook = (span, err) => {
27
- safeExecuteInTheMiddle(
28
- () => configResponseHook(span, err),
29
- error => {
30
- if (!error) {
31
- return;
32
- }
33
- diag.error(error?.message);
34
- },
35
- true,
36
- );
37
- };
38
- }
39
- if (typeof configRequestHook === 'function') {
40
- requestHook = (span) => {
41
- safeExecuteInTheMiddle(
42
- () => configRequestHook(span),
43
- error => {
44
- if (!error) {
45
- return;
46
- }
47
- diag.error(error?.message);
48
- },
49
- true,
50
- );
51
- };
52
- }
53
-
54
- const moduleFunctionsCJS = new InstrumentationNodeModuleDefinition('firebase-functions', functionsSupportedVersions);
5
+ function patchFunctions(functionsSupportedVersions, wrap, unwrap) {
6
+ const moduleFunctionsCJS = new InstrumentationNodeModuleDefinition("firebase-functions", functionsSupportedVersions);
55
7
  const modulesToInstrument = [
56
- { name: 'firebase-functions/lib/v2/providers/https.js', triggerType: 'function' },
57
- { name: 'firebase-functions/lib/v2/providers/firestore.js', triggerType: 'firestore' },
58
- { name: 'firebase-functions/lib/v2/providers/scheduler.js', triggerType: 'scheduler' },
59
- { name: 'firebase-functions/lib/v2/storage.js', triggerType: 'storage' },
60
- ] ;
61
-
8
+ { name: "firebase-functions/lib/v2/providers/https.js", triggerType: "function" },
9
+ { name: "firebase-functions/lib/v2/providers/firestore.js", triggerType: "firestore" },
10
+ { name: "firebase-functions/lib/v2/providers/scheduler.js", triggerType: "scheduler" },
11
+ { name: "firebase-functions/lib/v2/storage.js", triggerType: "storage" }
12
+ ];
62
13
  modulesToInstrument.forEach(({ name, triggerType }) => {
63
14
  moduleFunctionsCJS.files.push(
64
15
  new InstrumentationNodeModuleFile(
65
16
  name,
66
17
  functionsSupportedVersions,
67
- moduleExports =>
68
- wrapCommonFunctions(
69
- moduleExports,
70
- wrap,
71
- unwrap,
72
- tracer,
73
- { requestHook, responseHook, errorHook },
74
- triggerType,
75
- ),
76
- moduleExports => unwrapCommonFunctions(moduleExports, unwrap),
77
- ),
18
+ (moduleExports) => wrapCommonFunctions(moduleExports, wrap, unwrap, triggerType),
19
+ (moduleExports) => unwrapCommonFunctions(moduleExports, unwrap)
20
+ )
78
21
  );
79
22
  });
80
-
81
23
  return moduleFunctionsCJS;
82
24
  }
83
-
84
- /**
85
- * Patches Cloud Functions for Firebase (v2) to add OpenTelemetry instrumentation
86
- *
87
- * @param tracer - Opentelemetry Tracer
88
- * @param functionsConfig - Firebase instrumentation config
89
- * @param triggerType - Type of trigger
90
- * @returns A function that patches the function
91
- */
92
- function patchV2Functions(
93
- tracer,
94
- functionsConfig,
95
- triggerType,
96
- ) {
25
+ function patchV2Functions(triggerType) {
97
26
  return function v2FunctionsWrapper(original) {
98
- return function ( ...args) {
99
- const handler = typeof args[0] === 'function' ? args[0] : args[1];
100
- const documentOrOptions = typeof args[0] === 'function' ? undefined : args[0];
101
-
27
+ return function(...args) {
28
+ const handler = typeof args[0] === "function" ? args[0] : args[1];
29
+ const documentOrOptions = typeof args[0] === "function" ? void 0 : args[0];
102
30
  if (!handler) {
103
31
  return original.call(this, ...args);
104
32
  }
105
-
106
- const wrappedHandler = async function ( ...handlerArgs) {
107
- const functionName = process.env.FUNCTION_TARGET || process.env.K_SERVICE || 'unknown';
108
- const span = tracer.startSpan(`firebase.function.${triggerType}`, {
109
- kind: SpanKind.SERVER,
110
- });
111
-
33
+ const wrappedHandler = async function(...handlerArgs) {
34
+ const functionName = process.env.FUNCTION_TARGET || process.env.K_SERVICE || "unknown";
112
35
  const attributes = {
113
- 'faas.name': functionName,
114
- 'faas.trigger': triggerType,
115
- 'faas.provider': 'firebase',
36
+ [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.firebase.otel.functions",
37
+ "faas.name": functionName,
38
+ "faas.trigger": triggerType,
39
+ "faas.provider": "firebase"
116
40
  };
117
-
118
41
  if (process.env.GCLOUD_PROJECT) {
119
- attributes['cloud.project_id'] = process.env.GCLOUD_PROJECT;
42
+ attributes["cloud.project_id"] = process.env.GCLOUD_PROJECT;
120
43
  }
121
-
122
44
  if (process.env.EVENTARC_CLOUD_EVENT_SOURCE) {
123
- attributes['cloud.event_source'] = process.env.EVENTARC_CLOUD_EVENT_SOURCE;
45
+ attributes["cloud.event_source"] = process.env.EVENTARC_CLOUD_EVENT_SOURCE;
124
46
  }
125
-
126
- span.setAttributes(attributes);
127
- functionsConfig?.requestHook?.(span);
128
-
129
- // Can be changed to safeExecuteInTheMiddleAsync once following is merged and released
130
- // https://github.com/open-telemetry/opentelemetry-js/pull/6032
131
- return context.with(trace.setSpan(context.active(), span), async () => {
132
- let error;
133
- let result;
134
-
135
- try {
136
- result = await handler.apply(this, handlerArgs);
137
- } catch (e) {
138
- error = e ;
139
- }
140
-
141
- functionsConfig?.responseHook?.(span, error);
142
-
143
- if (error) {
144
- span.recordException(error);
145
- }
146
-
147
- span.end();
148
-
149
- if (error) {
150
- await functionsConfig?.errorHook?.(span, error);
151
- throw error;
47
+ return startSpanManual(
48
+ {
49
+ name: `firebase.function.${triggerType}`,
50
+ op: "http.request",
51
+ kind: SPAN_KIND.SERVER,
52
+ attributes
53
+ },
54
+ async (span) => {
55
+ try {
56
+ const result = await handler.apply(this, handlerArgs);
57
+ span.end();
58
+ return result;
59
+ } catch (error) {
60
+ span.setStatus({ code: SPAN_STATUS_ERROR });
61
+ captureException(error, {
62
+ mechanism: {
63
+ type: "auto.firebase.otel.functions",
64
+ handled: false
65
+ }
66
+ });
67
+ span.end();
68
+ await flush(2e3);
69
+ throw error;
70
+ }
152
71
  }
153
-
154
- return result;
155
- });
72
+ );
156
73
  };
157
-
158
74
  if (documentOrOptions) {
159
75
  return original.call(this, documentOrOptions, wrappedHandler);
160
76
  } else {
@@ -163,93 +79,53 @@ function patchV2Functions(
163
79
  };
164
80
  };
165
81
  }
166
-
167
- function wrapCommonFunctions(
168
- moduleExports,
169
- wrap,
170
- unwrap,
171
- tracer,
172
- functionsConfig,
173
- triggerType,
174
- ) {
82
+ function wrapCommonFunctions(moduleExports, wrap, unwrap, triggerType) {
175
83
  unwrapCommonFunctions(moduleExports, unwrap);
176
-
177
84
  switch (triggerType) {
178
- case 'function':
179
- wrap(moduleExports, 'onRequest', patchV2Functions(tracer, functionsConfig, 'http.request'));
180
- wrap(moduleExports, 'onCall', patchV2Functions(tracer, functionsConfig, 'http.call'));
85
+ case "function":
86
+ wrap(moduleExports, "onRequest", patchV2Functions("http.request"));
87
+ wrap(moduleExports, "onCall", patchV2Functions("http.call"));
181
88
  break;
182
-
183
- case 'firestore':
184
- wrap(moduleExports, 'onDocumentCreated', patchV2Functions(tracer, functionsConfig, 'firestore.document.created'));
185
- wrap(moduleExports, 'onDocumentUpdated', patchV2Functions(tracer, functionsConfig, 'firestore.document.updated'));
186
- wrap(moduleExports, 'onDocumentDeleted', patchV2Functions(tracer, functionsConfig, 'firestore.document.deleted'));
187
- wrap(moduleExports, 'onDocumentWritten', patchV2Functions(tracer, functionsConfig, 'firestore.document.written'));
188
- wrap(
189
- moduleExports,
190
- 'onDocumentCreatedWithAuthContext',
191
- patchV2Functions(tracer, functionsConfig, 'firestore.document.created'),
192
- );
193
- wrap(
194
- moduleExports,
195
- 'onDocumentUpdatedWithAuthContext',
196
- patchV2Functions(tracer, functionsConfig, 'firestore.document.updated'),
197
- );
198
-
199
- wrap(
200
- moduleExports,
201
- 'onDocumentDeletedWithAuthContext',
202
- patchV2Functions(tracer, functionsConfig, 'firestore.document.deleted'),
203
- );
204
-
205
- wrap(
206
- moduleExports,
207
- 'onDocumentWrittenWithAuthContext',
208
- patchV2Functions(tracer, functionsConfig, 'firestore.document.written'),
209
- );
89
+ case "firestore":
90
+ wrap(moduleExports, "onDocumentCreated", patchV2Functions("firestore.document.created"));
91
+ wrap(moduleExports, "onDocumentUpdated", patchV2Functions("firestore.document.updated"));
92
+ wrap(moduleExports, "onDocumentDeleted", patchV2Functions("firestore.document.deleted"));
93
+ wrap(moduleExports, "onDocumentWritten", patchV2Functions("firestore.document.written"));
94
+ wrap(moduleExports, "onDocumentCreatedWithAuthContext", patchV2Functions("firestore.document.created"));
95
+ wrap(moduleExports, "onDocumentUpdatedWithAuthContext", patchV2Functions("firestore.document.updated"));
96
+ wrap(moduleExports, "onDocumentDeletedWithAuthContext", patchV2Functions("firestore.document.deleted"));
97
+ wrap(moduleExports, "onDocumentWrittenWithAuthContext", patchV2Functions("firestore.document.written"));
210
98
  break;
211
-
212
- case 'scheduler':
213
- wrap(moduleExports, 'onSchedule', patchV2Functions(tracer, functionsConfig, 'scheduler.scheduled'));
99
+ case "scheduler":
100
+ wrap(moduleExports, "onSchedule", patchV2Functions("scheduler.scheduled"));
214
101
  break;
215
-
216
- case 'storage':
217
- wrap(moduleExports, 'onObjectFinalized', patchV2Functions(tracer, functionsConfig, 'storage.object.finalized'));
218
- wrap(moduleExports, 'onObjectArchived', patchV2Functions(tracer, functionsConfig, 'storage.object.archived'));
219
- wrap(moduleExports, 'onObjectDeleted', patchV2Functions(tracer, functionsConfig, 'storage.object.deleted'));
220
- wrap(
221
- moduleExports,
222
- 'onObjectMetadataUpdated',
223
- patchV2Functions(tracer, functionsConfig, 'storage.object.metadataUpdated'),
224
- );
102
+ case "storage":
103
+ wrap(moduleExports, "onObjectFinalized", patchV2Functions("storage.object.finalized"));
104
+ wrap(moduleExports, "onObjectArchived", patchV2Functions("storage.object.archived"));
105
+ wrap(moduleExports, "onObjectDeleted", patchV2Functions("storage.object.deleted"));
106
+ wrap(moduleExports, "onObjectMetadataUpdated", patchV2Functions("storage.object.metadataUpdated"));
225
107
  break;
226
108
  }
227
-
228
109
  return moduleExports;
229
110
  }
230
-
231
- function unwrapCommonFunctions(
232
- moduleExports,
233
- unwrap,
234
- ) {
111
+ function unwrapCommonFunctions(moduleExports, unwrap) {
235
112
  const methods = [
236
- 'onSchedule',
237
- 'onRequest',
238
- 'onCall',
239
- 'onObjectFinalized',
240
- 'onObjectArchived',
241
- 'onObjectDeleted',
242
- 'onObjectMetadataUpdated',
243
- 'onDocumentCreated',
244
- 'onDocumentUpdated',
245
- 'onDocumentDeleted',
246
- 'onDocumentWritten',
247
- 'onDocumentCreatedWithAuthContext',
248
- 'onDocumentUpdatedWithAuthContext',
249
- 'onDocumentDeletedWithAuthContext',
250
- 'onDocumentWrittenWithAuthContext',
113
+ "onSchedule",
114
+ "onRequest",
115
+ "onCall",
116
+ "onObjectFinalized",
117
+ "onObjectArchived",
118
+ "onObjectDeleted",
119
+ "onObjectMetadataUpdated",
120
+ "onDocumentCreated",
121
+ "onDocumentUpdated",
122
+ "onDocumentDeleted",
123
+ "onDocumentWritten",
124
+ "onDocumentCreatedWithAuthContext",
125
+ "onDocumentUpdatedWithAuthContext",
126
+ "onDocumentDeletedWithAuthContext",
127
+ "onDocumentWrittenWithAuthContext"
251
128
  ];
252
-
253
129
  for (const method of methods) {
254
130
  if (isWrapped(moduleExports[method])) {
255
131
  unwrap(moduleExports, method);
@@ -1 +1 @@
1
- {"version":3,"file":"functions.js","sources":["../../../../../../../src/integrations/tracing/firebase/otel/patches/functions.ts"],"sourcesContent":["import type { Span, Tracer } from '@opentelemetry/api';\nimport { context, diag, SpanKind, trace } from '@opentelemetry/api';\nimport type { InstrumentationBase } from '@opentelemetry/instrumentation';\nimport {\n InstrumentationNodeModuleDefinition,\n InstrumentationNodeModuleFile,\n isWrapped,\n safeExecuteInTheMiddle,\n} from '@opentelemetry/instrumentation';\nimport type { SpanAttributes } from '@sentry/core';\nimport type { FirebaseInstrumentation } from '../firebaseInstrumentation';\nimport type {\n AvailableFirebaseFunctions,\n FirebaseFunctions,\n FirebaseInstrumentationConfig,\n OverloadedParameters,\n RequestHook,\n ResponseHook,\n} from '../types';\n\n/**\n * Patches Firebase Functions v2 to add OpenTelemetry instrumentation\n * @param tracer - Opentelemetry Tracer\n * @param functionsSupportedVersions - supported versions of firebase-functions\n * @param wrap - reference to native instrumentation wrap function\n * @param unwrap - reference to native instrumentation unwrap function\n * @param config - Firebase instrumentation config\n */\nexport function patchFunctions(\n tracer: Tracer,\n functionsSupportedVersions: string[],\n wrap: InstrumentationBase['_wrap'],\n unwrap: InstrumentationBase['_unwrap'],\n config: FirebaseInstrumentationConfig,\n): InstrumentationNodeModuleDefinition {\n let requestHook: RequestHook = () => {};\n let responseHook: ResponseHook = () => {};\n const errorHook = config.functions?.errorHook;\n const configRequestHook = config.functions?.requestHook;\n const configResponseHook = config.functions?.responseHook;\n\n if (typeof configResponseHook === 'function') {\n responseHook = (span: Span, err: unknown) => {\n safeExecuteInTheMiddle(\n () => configResponseHook(span, err),\n error => {\n if (!error) {\n return;\n }\n diag.error(error?.message);\n },\n true,\n );\n };\n }\n if (typeof configRequestHook === 'function') {\n requestHook = (span: Span) => {\n safeExecuteInTheMiddle(\n () => configRequestHook(span),\n error => {\n if (!error) {\n return;\n }\n diag.error(error?.message);\n },\n true,\n );\n };\n }\n\n const moduleFunctionsCJS = new InstrumentationNodeModuleDefinition('firebase-functions', functionsSupportedVersions);\n const modulesToInstrument = [\n { name: 'firebase-functions/lib/v2/providers/https.js', triggerType: 'function' },\n { name: 'firebase-functions/lib/v2/providers/firestore.js', triggerType: 'firestore' },\n { name: 'firebase-functions/lib/v2/providers/scheduler.js', triggerType: 'scheduler' },\n { name: 'firebase-functions/lib/v2/storage.js', triggerType: 'storage' },\n ] as const;\n\n modulesToInstrument.forEach(({ name, triggerType }) => {\n moduleFunctionsCJS.files.push(\n new InstrumentationNodeModuleFile(\n name,\n functionsSupportedVersions,\n moduleExports =>\n wrapCommonFunctions(\n moduleExports,\n wrap,\n unwrap,\n tracer,\n { requestHook, responseHook, errorHook },\n triggerType,\n ),\n moduleExports => unwrapCommonFunctions(moduleExports, unwrap),\n ),\n );\n });\n\n return moduleFunctionsCJS;\n}\n\n/**\n * Patches Cloud Functions for Firebase (v2) to add OpenTelemetry instrumentation\n *\n * @param tracer - Opentelemetry Tracer\n * @param functionsConfig - Firebase instrumentation config\n * @param triggerType - Type of trigger\n * @returns A function that patches the function\n */\nexport function patchV2Functions<T extends FirebaseFunctions = FirebaseFunctions>(\n tracer: Tracer,\n functionsConfig: FirebaseInstrumentationConfig['functions'],\n triggerType: string,\n): (original: T) => (...args: OverloadedParameters<T>) => ReturnType<T> {\n return function v2FunctionsWrapper(original: T): (...args: OverloadedParameters<T>) => ReturnType<T> {\n return function (this: FirebaseInstrumentation, ...args: OverloadedParameters<T>): ReturnType<T> {\n const handler = typeof args[0] === 'function' ? args[0] : args[1];\n const documentOrOptions = typeof args[0] === 'function' ? undefined : args[0];\n\n if (!handler) {\n return original.call(this, ...args);\n }\n\n const wrappedHandler = async function (this: unknown, ...handlerArgs: unknown[]): Promise<unknown> {\n const functionName = process.env.FUNCTION_TARGET || process.env.K_SERVICE || 'unknown';\n const span = tracer.startSpan(`firebase.function.${triggerType}`, {\n kind: SpanKind.SERVER,\n });\n\n const attributes: SpanAttributes = {\n 'faas.name': functionName,\n 'faas.trigger': triggerType,\n 'faas.provider': 'firebase',\n };\n\n if (process.env.GCLOUD_PROJECT) {\n attributes['cloud.project_id'] = process.env.GCLOUD_PROJECT;\n }\n\n if (process.env.EVENTARC_CLOUD_EVENT_SOURCE) {\n attributes['cloud.event_source'] = process.env.EVENTARC_CLOUD_EVENT_SOURCE;\n }\n\n span.setAttributes(attributes);\n functionsConfig?.requestHook?.(span);\n\n // Can be changed to safeExecuteInTheMiddleAsync once following is merged and released\n // https://github.com/open-telemetry/opentelemetry-js/pull/6032\n return context.with(trace.setSpan(context.active(), span), async () => {\n let error: Error | undefined;\n let result: T | undefined;\n\n try {\n result = await handler.apply(this, handlerArgs);\n } catch (e) {\n error = e as Error;\n }\n\n functionsConfig?.responseHook?.(span, error);\n\n if (error) {\n span.recordException(error);\n }\n\n span.end();\n\n if (error) {\n await functionsConfig?.errorHook?.(span, error);\n throw error;\n }\n\n return result;\n });\n };\n\n if (documentOrOptions) {\n return original.call(this, documentOrOptions, wrappedHandler);\n } else {\n return original.call(this, wrappedHandler);\n }\n };\n };\n}\n\nfunction wrapCommonFunctions(\n moduleExports: AvailableFirebaseFunctions,\n wrap: InstrumentationBase<FirebaseInstrumentationConfig>['_wrap'],\n unwrap: InstrumentationBase<FirebaseInstrumentationConfig>['_unwrap'],\n tracer: Tracer,\n functionsConfig: FirebaseInstrumentationConfig['functions'],\n triggerType: 'function' | 'firestore' | 'scheduler' | 'storage',\n): AvailableFirebaseFunctions {\n unwrapCommonFunctions(moduleExports, unwrap);\n\n switch (triggerType) {\n case 'function':\n wrap(moduleExports, 'onRequest', patchV2Functions(tracer, functionsConfig, 'http.request'));\n wrap(moduleExports, 'onCall', patchV2Functions(tracer, functionsConfig, 'http.call'));\n break;\n\n case 'firestore':\n wrap(moduleExports, 'onDocumentCreated', patchV2Functions(tracer, functionsConfig, 'firestore.document.created'));\n wrap(moduleExports, 'onDocumentUpdated', patchV2Functions(tracer, functionsConfig, 'firestore.document.updated'));\n wrap(moduleExports, 'onDocumentDeleted', patchV2Functions(tracer, functionsConfig, 'firestore.document.deleted'));\n wrap(moduleExports, 'onDocumentWritten', patchV2Functions(tracer, functionsConfig, 'firestore.document.written'));\n wrap(\n moduleExports,\n 'onDocumentCreatedWithAuthContext',\n patchV2Functions(tracer, functionsConfig, 'firestore.document.created'),\n );\n wrap(\n moduleExports,\n 'onDocumentUpdatedWithAuthContext',\n patchV2Functions(tracer, functionsConfig, 'firestore.document.updated'),\n );\n\n wrap(\n moduleExports,\n 'onDocumentDeletedWithAuthContext',\n patchV2Functions(tracer, functionsConfig, 'firestore.document.deleted'),\n );\n\n wrap(\n moduleExports,\n 'onDocumentWrittenWithAuthContext',\n patchV2Functions(tracer, functionsConfig, 'firestore.document.written'),\n );\n break;\n\n case 'scheduler':\n wrap(moduleExports, 'onSchedule', patchV2Functions(tracer, functionsConfig, 'scheduler.scheduled'));\n break;\n\n case 'storage':\n wrap(moduleExports, 'onObjectFinalized', patchV2Functions(tracer, functionsConfig, 'storage.object.finalized'));\n wrap(moduleExports, 'onObjectArchived', patchV2Functions(tracer, functionsConfig, 'storage.object.archived'));\n wrap(moduleExports, 'onObjectDeleted', patchV2Functions(tracer, functionsConfig, 'storage.object.deleted'));\n wrap(\n moduleExports,\n 'onObjectMetadataUpdated',\n patchV2Functions(tracer, functionsConfig, 'storage.object.metadataUpdated'),\n );\n break;\n }\n\n return moduleExports;\n}\n\nfunction unwrapCommonFunctions(\n moduleExports: AvailableFirebaseFunctions,\n unwrap: InstrumentationBase<FirebaseInstrumentationConfig>['_unwrap'],\n): AvailableFirebaseFunctions {\n const methods: (keyof AvailableFirebaseFunctions)[] = [\n 'onSchedule',\n 'onRequest',\n 'onCall',\n 'onObjectFinalized',\n 'onObjectArchived',\n 'onObjectDeleted',\n 'onObjectMetadataUpdated',\n 'onDocumentCreated',\n 'onDocumentUpdated',\n 'onDocumentDeleted',\n 'onDocumentWritten',\n 'onDocumentCreatedWithAuthContext',\n 'onDocumentUpdatedWithAuthContext',\n 'onDocumentDeletedWithAuthContext',\n 'onDocumentWrittenWithAuthContext',\n ];\n\n for (const method of methods) {\n if (isWrapped(moduleExports[method])) {\n unwrap(moduleExports, method);\n }\n }\n return moduleExports;\n}\n"],"names":[],"mappings":";;;AAoBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,cAAc;AAC9B,EAAE,MAAM;AACR,EAAE,0BAA0B;AAC5B,EAAE,IAAI;AACN,EAAE,MAAM;AACR,EAAE,MAAM;AACR,EAAuC;AACvC,EAAE,IAAI,WAAW,GAAgB,MAAM,CAAC,CAAC;AACzC,EAAE,IAAI,YAAY,GAAiB,MAAM,CAAC,CAAC;AAC3C,EAAE,MAAM,SAAA,GAAY,MAAM,CAAC,SAAS,EAAE,SAAS;AAC/C,EAAE,MAAM,iBAAA,GAAoB,MAAM,CAAC,SAAS,EAAE,WAAW;AACzD,EAAE,MAAM,kBAAA,GAAqB,MAAM,CAAC,SAAS,EAAE,YAAY;;AAE3D,EAAE,IAAI,OAAO,kBAAA,KAAuB,UAAU,EAAE;AAChD,IAAI,eAAe,CAAC,IAAI,EAAQ,GAAG,KAAc;AACjD,MAAM,sBAAsB;AAC5B,QAAQ,MAAM,kBAAkB,CAAC,IAAI,EAAE,GAAG,CAAC;AAC3C,QAAQ,SAAS;AACjB,UAAU,IAAI,C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A,IAAA,mBAAA;AACA,IAAA,mBAAA;AACA,IAAA,kCAAA;AACA,IAAA,kCAAA;AACA,IAAA,kCAAA;AACA,IAAA,kCAAA;AACA,GAAA;;AAEA,EAAA,KAAA,MAAA,MAAA,IAAA,OAAA,EAAA;AACA,IAAA,IAAA,SAAA,CAAA,aAAA,CAAA,MAAA,CAAA,CAAA,EAAA;AACA,MAAA,MAAA,CAAA,aAAA,EAAA,MAAA,CAAA;AACA,IAAA;AACA,EAAA;AACA,EAAA,OAAA,aAAA;AACA;;;;"}
1
+ {"version":3,"file":"functions.js","sources":["../../../../../../../src/integrations/tracing/firebase/otel/patches/functions.ts"],"sourcesContent":["import type { InstrumentationBase } from '@opentelemetry/instrumentation';\nimport { InstrumentationNodeModuleDefinition, isWrapped } from '@opentelemetry/instrumentation';\nimport { InstrumentationNodeModuleFile } from '../../../InstrumentationNodeModuleFile';\nimport type { SpanAttributes } from '@sentry/core';\nimport {\n captureException,\n flush,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SPAN_KIND,\n SPAN_STATUS_ERROR,\n startSpanManual,\n} from '@sentry/core';\nimport type { FirebaseInstrumentation } from '../firebaseInstrumentation';\nimport type { AvailableFirebaseFunctions, FirebaseFunctions, OverloadedParameters } from '../types';\n\n/**\n * Patches Firebase Functions v2 to add OpenTelemetry instrumentation\n * @param functionsSupportedVersions - supported versions of firebase-functions\n * @param wrap - reference to native instrumentation wrap function\n * @param unwrap - reference to native instrumentation unwrap function\n */\nexport function patchFunctions(\n functionsSupportedVersions: string[],\n wrap: InstrumentationBase['_wrap'],\n unwrap: InstrumentationBase['_unwrap'],\n): InstrumentationNodeModuleDefinition {\n const moduleFunctionsCJS = new InstrumentationNodeModuleDefinition('firebase-functions', functionsSupportedVersions);\n const modulesToInstrument = [\n { name: 'firebase-functions/lib/v2/providers/https.js', triggerType: 'function' },\n { name: 'firebase-functions/lib/v2/providers/firestore.js', triggerType: 'firestore' },\n { name: 'firebase-functions/lib/v2/providers/scheduler.js', triggerType: 'scheduler' },\n { name: 'firebase-functions/lib/v2/storage.js', triggerType: 'storage' },\n ] as const;\n\n modulesToInstrument.forEach(({ name, triggerType }) => {\n moduleFunctionsCJS.files.push(\n new InstrumentationNodeModuleFile(\n name,\n functionsSupportedVersions,\n moduleExports => wrapCommonFunctions(moduleExports, wrap, unwrap, triggerType),\n moduleExports => unwrapCommonFunctions(moduleExports, unwrap),\n ),\n );\n });\n\n return moduleFunctionsCJS;\n}\n\n/**\n * Patches Cloud Functions for Firebase (v2) to add OpenTelemetry instrumentation\n *\n * @param triggerType - Type of trigger\n * @returns A function that patches the function\n */\nexport function patchV2Functions<T extends FirebaseFunctions = FirebaseFunctions>(\n triggerType: string,\n): (original: T) => (...args: OverloadedParameters<T>) => ReturnType<T> {\n return function v2FunctionsWrapper(original: T): (...args: OverloadedParameters<T>) => ReturnType<T> {\n return function (this: FirebaseInstrumentation, ...args: OverloadedParameters<T>): ReturnType<T> {\n const handler = typeof args[0] === 'function' ? args[0] : args[1];\n const documentOrOptions = typeof args[0] === 'function' ? undefined : args[0];\n\n if (!handler) {\n return original.call(this, ...args);\n }\n\n const wrappedHandler = async function (this: unknown, ...handlerArgs: unknown[]): Promise<unknown> {\n const functionName = process.env.FUNCTION_TARGET || process.env.K_SERVICE || 'unknown';\n\n const attributes: SpanAttributes = {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.firebase.otel.functions',\n 'faas.name': functionName,\n 'faas.trigger': triggerType,\n 'faas.provider': 'firebase',\n };\n\n if (process.env.GCLOUD_PROJECT) {\n attributes['cloud.project_id'] = process.env.GCLOUD_PROJECT;\n }\n\n if (process.env.EVENTARC_CLOUD_EVENT_SOURCE) {\n attributes['cloud.event_source'] = process.env.EVENTARC_CLOUD_EVENT_SOURCE;\n }\n\n // `startSpanManual` to keep the span active but while still allowing us to end it before flushing on error.\n return startSpanManual(\n {\n name: `firebase.function.${triggerType}`,\n op: 'http.request',\n kind: SPAN_KIND.SERVER,\n attributes,\n },\n async span => {\n try {\n const result = await handler.apply(this, handlerArgs);\n span.end();\n return result;\n } catch (error) {\n span.setStatus({ code: SPAN_STATUS_ERROR });\n captureException(error, {\n mechanism: {\n type: 'auto.firebase.otel.functions',\n handled: false,\n },\n });\n span.end();\n await flush(2000);\n throw error;\n }\n },\n );\n };\n\n if (documentOrOptions) {\n return original.call(this, documentOrOptions, wrappedHandler);\n } else {\n return original.call(this, wrappedHandler);\n }\n };\n };\n}\n\nfunction wrapCommonFunctions(\n moduleExports: AvailableFirebaseFunctions,\n wrap: InstrumentationBase['_wrap'],\n unwrap: InstrumentationBase['_unwrap'],\n triggerType: 'function' | 'firestore' | 'scheduler' | 'storage',\n): AvailableFirebaseFunctions {\n unwrapCommonFunctions(moduleExports, unwrap);\n\n switch (triggerType) {\n case 'function':\n wrap(moduleExports, 'onRequest', patchV2Functions('http.request'));\n wrap(moduleExports, 'onCall', patchV2Functions('http.call'));\n break;\n\n case 'firestore':\n wrap(moduleExports, 'onDocumentCreated', patchV2Functions('firestore.document.created'));\n wrap(moduleExports, 'onDocumentUpdated', patchV2Functions('firestore.document.updated'));\n wrap(moduleExports, 'onDocumentDeleted', patchV2Functions('firestore.document.deleted'));\n wrap(moduleExports, 'onDocumentWritten', patchV2Functions('firestore.document.written'));\n wrap(moduleExports, 'onDocumentCreatedWithAuthContext', patchV2Functions('firestore.document.created'));\n wrap(moduleExports, 'onDocumentUpdatedWithAuthContext', patchV2Functions('firestore.document.updated'));\n wrap(moduleExports, 'onDocumentDeletedWithAuthContext', patchV2Functions('firestore.document.deleted'));\n wrap(moduleExports, 'onDocumentWrittenWithAuthContext', patchV2Functions('firestore.document.written'));\n break;\n\n case 'scheduler':\n wrap(moduleExports, 'onSchedule', patchV2Functions('scheduler.scheduled'));\n break;\n\n case 'storage':\n wrap(moduleExports, 'onObjectFinalized', patchV2Functions('storage.object.finalized'));\n wrap(moduleExports, 'onObjectArchived', patchV2Functions('storage.object.archived'));\n wrap(moduleExports, 'onObjectDeleted', patchV2Functions('storage.object.deleted'));\n wrap(moduleExports, 'onObjectMetadataUpdated', patchV2Functions('storage.object.metadataUpdated'));\n break;\n }\n\n return moduleExports;\n}\n\nfunction unwrapCommonFunctions(\n moduleExports: AvailableFirebaseFunctions,\n unwrap: InstrumentationBase['_unwrap'],\n): AvailableFirebaseFunctions {\n const methods: (keyof AvailableFirebaseFunctions)[] = [\n 'onSchedule',\n 'onRequest',\n 'onCall',\n 'onObjectFinalized',\n 'onObjectArchived',\n 'onObjectDeleted',\n 'onObjectMetadataUpdated',\n 'onDocumentCreated',\n 'onDocumentUpdated',\n 'onDocumentDeleted',\n 'onDocumentWritten',\n 'onDocumentCreatedWithAuthContext',\n 'onDocumentUpdatedWithAuthContext',\n 'onDocumentDeletedWithAuthContext',\n 'onDocumentWrittenWithAuthContext',\n ];\n\n for (const method of methods) {\n if (isWrapped(moduleExports[method])) {\n unwrap(moduleExports, method);\n }\n }\n return moduleExports;\n}\n"],"names":[],"mappings":";;;;AAqBO,SAAS,cAAA,CACd,0BAAA,EACA,IAAA,EACA,MAAA,EACqC;AACrC,EAAA,MAAM,kBAAA,GAAqB,IAAI,mCAAA,CAAoC,oBAAA,EAAsB,0BAA0B,CAAA;AACnH,EAAA,MAAM,mBAAA,GAAsB;AAAA,IAC1B,EAAE,IAAA,EAAM,8CAAA,EAAgD,WAAA,EAAa,UAAA,EAAW;AAAA,IAChF,EAAE,IAAA,EAAM,kDAAA,EAAoD,WAAA,EAAa,WAAA,EAAY;AAAA,IACrF,EAAE,IAAA,EAAM,kDAAA,EAAoD,WAAA,EAAa,WAAA,EAAY;AAAA,IACrF,EAAE,IAAA,EAAM,sCAAA,EAAwC,WAAA,EAAa,SAAA;AAAU,GACzE;AAEA,EAAA,mBAAA,CAAoB,OAAA,CAAQ,CAAC,EAAE,IAAA,EAAM,aAAY,KAAM;AACrD,IAAA,kBAAA,CAAmB,KAAA,CAAM,IAAA;AAAA,MACvB,IAAI,6BAAA;AAAA,QACF,IA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AA,IAAA,CAAK,aAAA,EAAe,iBAAA,EAAmB,gBAAA,CAAiB,wBAAwB,CAAC,CAAA;AACjF,MAAA,IAAA,CAAK,aAAA,EAAe,yBAAA,EAA2B,gBAAA,CAAiB,gCAAgC,CAAC,CAAA;AACjG,MAAA;AAAA;AAGJ,EAAA,OAAO,aAAA;AACT;AAEA,SAAS,qBAAA,CACP,eACA,MAAA,EAC4B;AAC5B,EAAA,MAAM,OAAA,GAAgD;AAAA,IACpD,YAAA;AAAA,IACA,WAAA;AAAA,IACA,QAAA;AAAA,IACA,mBAAA;AAAA,IACA,kBAAA;AAAA,IACA,iBAAA;AAAA,IACA,yBAAA;AAAA,IACA,mBAAA;AAAA,IACA,mBAAA;AAAA,IACA,mBAAA;AAAA,IACA,mBAAA;AAAA,IACA,kCAAA;AAAA,IACA,kCAAA;AAAA,IACA,kCAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAA,KAAA,MAAW,UAAU,OAAA,EAAS;AAC5B,IAAA,IAAI,SAAA,CAAU,aAAA,CAAc,MAAM,CAAC,CAAA,EAAG;AACpC,MAAA,MAAA,CAAO,eAAe,MAAM,CAAA;AAAA,IAC9B;AAAA,EACF;AACA,EAAA,OAAO,aAAA;AACT;;;;"}
@@ -0,0 +1,18 @@
1
+ import { GenericPoolInstrumentation } from './vendored/instrumentation.js';
2
+ import { defineIntegration } from '@sentry/core';
3
+ import { generateInstrumentOnce } from '@sentry/node-core';
4
+
5
+ const INTEGRATION_NAME = "GenericPool";
6
+ const instrumentGenericPool = generateInstrumentOnce(INTEGRATION_NAME, () => new GenericPoolInstrumentation({}));
7
+ const _genericPoolIntegration = (() => {
8
+ return {
9
+ name: INTEGRATION_NAME,
10
+ setupOnce() {
11
+ instrumentGenericPool();
12
+ }
13
+ };
14
+ });
15
+ const genericPoolIntegration = defineIntegration(_genericPoolIntegration);
16
+
17
+ export { genericPoolIntegration, instrumentGenericPool };
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/genericPool/index.ts"],"sourcesContent":["import { GenericPoolInstrumentation } from './vendored/instrumentation';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { generateInstrumentOnce } from '@sentry/node-core';\n\nconst INTEGRATION_NAME = 'GenericPool' as const;\n\nexport const instrumentGenericPool = generateInstrumentOnce(INTEGRATION_NAME, () => new GenericPoolInstrumentation({}));\n\nconst _genericPoolIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentGenericPool();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [generic-pool](https://www.npmjs.com/package/generic-pool) library.\n *\n * For more information, see the [`genericPoolIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/genericpool/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.genericPoolIntegration()],\n * });\n * ```\n */\nexport const genericPoolIntegration = defineIntegration(_genericPoolIntegration);\n"],"names":[],"mappings":";;;;AAKA,MAAM,gBAAA,GAAmB,aAAA;AAElB,MAAM,qBAAA,GAAwB,uBAAuB,gBAAA,EAAkB,MAAM,IAAI,0BAAA,CAA2B,EAAE,CAAC;AAEtH,MAAM,2BAA2B,MAAM;AACrC,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AACV,MAAA,qBAAA,EAAsB;AAAA,IACxB;AAAA,GACF;AACF,CAAA,CAAA;AAgBO,MAAM,sBAAA,GAAyB,kBAAkB,uBAAuB;;;;"}
@@ -0,0 +1,120 @@
1
+ import { InstrumentationBase, InstrumentationNodeModuleDefinition, isWrapped } from '@opentelemetry/instrumentation';
2
+ import { SDK_VERSION, startSpan, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, startSpanManual, SPAN_STATUS_ERROR } from '@sentry/core';
3
+
4
+ const MODULE_NAME = "generic-pool";
5
+ const PACKAGE_NAME = "@sentry/instrumentation-generic-pool";
6
+ class GenericPoolInstrumentation extends InstrumentationBase {
7
+ constructor(config = {}) {
8
+ super(PACKAGE_NAME, SDK_VERSION, config);
9
+ // only used for v2 - v2.3)
10
+ this._isDisabled = false;
11
+ }
12
+ init() {
13
+ return [
14
+ new InstrumentationNodeModuleDefinition(
15
+ MODULE_NAME,
16
+ [">=3.0.0 <4"],
17
+ (moduleExports) => {
18
+ const Pool = moduleExports.Pool;
19
+ if (isWrapped(Pool.prototype.acquire)) {
20
+ this._unwrap(Pool.prototype, "acquire");
21
+ }
22
+ this._wrap(Pool.prototype, "acquire", this._acquirePatcher.bind(this));
23
+ return moduleExports;
24
+ },
25
+ (moduleExports) => {
26
+ const Pool = moduleExports.Pool;
27
+ this._unwrap(Pool.prototype, "acquire");
28
+ return moduleExports;
29
+ }
30
+ ),
31
+ new InstrumentationNodeModuleDefinition(
32
+ MODULE_NAME,
33
+ [">=2.4.0 <3"],
34
+ (moduleExports) => {
35
+ const Pool = moduleExports.Pool;
36
+ if (isWrapped(Pool.prototype.acquire)) {
37
+ this._unwrap(Pool.prototype, "acquire");
38
+ }
39
+ this._wrap(Pool.prototype, "acquire", this._acquireWithCallbacksPatcher.bind(this));
40
+ return moduleExports;
41
+ },
42
+ (moduleExports) => {
43
+ const Pool = moduleExports.Pool;
44
+ this._unwrap(Pool.prototype, "acquire");
45
+ return moduleExports;
46
+ }
47
+ ),
48
+ new InstrumentationNodeModuleDefinition(
49
+ MODULE_NAME,
50
+ [">=2.0.0 <2.4"],
51
+ (moduleExports) => {
52
+ this._isDisabled = false;
53
+ if (isWrapped(moduleExports.Pool)) {
54
+ this._unwrap(moduleExports, "Pool");
55
+ }
56
+ this._wrap(moduleExports, "Pool", this._poolWrapper.bind(this));
57
+ return moduleExports;
58
+ },
59
+ (moduleExports) => {
60
+ this._isDisabled = true;
61
+ return moduleExports;
62
+ }
63
+ )
64
+ ];
65
+ }
66
+ _acquirePatcher(original) {
67
+ return function wrapped_acquire(...args) {
68
+ return startSpan(
69
+ {
70
+ name: "generic-pool.acquire",
71
+ attributes: { [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.db.otel.generic_pool" }
72
+ },
73
+ () => {
74
+ return original.call(this, ...args);
75
+ }
76
+ );
77
+ };
78
+ }
79
+ _poolWrapper(original) {
80
+ const wrap = this._wrap.bind(this);
81
+ const acquireWithCallbacksPatcher = this._acquireWithCallbacksPatcher.bind(this);
82
+ return function wrapped_pool(...args) {
83
+ const pool = original.apply(this, args);
84
+ wrap(pool, "acquire", acquireWithCallbacksPatcher);
85
+ return pool;
86
+ };
87
+ }
88
+ _acquireWithCallbacksPatcher(original) {
89
+ const isDisabled = () => this._isDisabled;
90
+ return function wrapped_acquire(cb, priority) {
91
+ if (isDisabled()) {
92
+ return original.call(this, cb, priority);
93
+ }
94
+ return startSpanManual(
95
+ {
96
+ name: "generic-pool.acquire",
97
+ attributes: { [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.db.otel.generic_pool" }
98
+ },
99
+ (span) => {
100
+ original.call(
101
+ this,
102
+ (err, client) => {
103
+ if (err) {
104
+ span.setStatus({ code: SPAN_STATUS_ERROR, message: "internal_error" });
105
+ }
106
+ span.end();
107
+ if (cb) {
108
+ cb(err, client);
109
+ }
110
+ },
111
+ priority
112
+ );
113
+ }
114
+ );
115
+ };
116
+ }
117
+ }
118
+
119
+ export { GenericPoolInstrumentation };
120
+ //# sourceMappingURL=instrumentation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instrumentation.js","sources":["../../../../../../src/integrations/tracing/genericPool/vendored/instrumentation.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-generic-pool\n * - Upstream version: @opentelemetry/instrumentation-generic-pool@0.61.0\n * - Minor TypeScript strictness adjustments for this repository's compiler settings\n */\n\nimport type { InstrumentationConfig } from '@opentelemetry/instrumentation';\nimport { InstrumentationBase, InstrumentationNodeModuleDefinition, isWrapped } from '@opentelemetry/instrumentation';\nimport {\n SDK_VERSION,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SPAN_STATUS_ERROR,\n startSpan,\n startSpanManual,\n} from '@sentry/core';\nimport type * as genericPool from './generic-pool-types';\n\nconst MODULE_NAME = 'generic-pool';\nconst PACKAGE_NAME = '@sentry/instrumentation-generic-pool';\n\ntype AcquireFn = (this: unknown, ...args: unknown[]) => unknown;\ninterface PoolConstructor {\n prototype: { acquire: AcquireFn };\n}\ninterface GenericPoolModule {\n Pool: PoolConstructor;\n}\n\nexport class GenericPoolInstrumentation extends InstrumentationBase {\n // only used for v2 - v2.3)\n private _isDisabled = false;\n\n constructor(config: InstrumentationConfig = {}) {\n super(PACKAGE_NAME, SDK_VERSION, config);\n }\n\n init() {\n return [\n new InstrumentationNodeModuleDefinition(\n MODULE_NAME,\n ['>=3.0.0 <4'],\n (moduleExports: GenericPoolModule) => {\n const Pool = moduleExports.Pool;\n if (isWrapped(Pool.prototype.acquire)) {\n this._unwrap(Pool.prototype, 'acquire');\n }\n this._wrap(Pool.prototype, 'acquire', this._acquirePatcher.bind(this));\n return moduleExports;\n },\n (moduleExports: GenericPoolModule) => {\n const Pool = moduleExports.Pool;\n this._unwrap(Pool.prototype, 'acquire');\n return moduleExports;\n },\n ),\n new InstrumentationNodeModuleDefinition(\n MODULE_NAME,\n ['>=2.4.0 <3'],\n (moduleExports: GenericPoolModule) => {\n const Pool = moduleExports.Pool;\n if (isWrapped(Pool.prototype.acquire)) {\n this._unwrap(Pool.prototype, 'acquire');\n }\n this._wrap(Pool.prototype, 'acquire', this._acquireWithCallbacksPatcher.bind(this));\n return moduleExports;\n },\n (moduleExports: GenericPoolModule) => {\n const Pool = moduleExports.Pool;\n this._unwrap(Pool.prototype, 'acquire');\n return moduleExports;\n },\n ),\n new InstrumentationNodeModuleDefinition(\n MODULE_NAME,\n ['>=2.0.0 <2.4'],\n (moduleExports: GenericPoolModule) => {\n this._isDisabled = false;\n if (isWrapped(moduleExports.Pool)) {\n this._unwrap(moduleExports, 'Pool');\n }\n this._wrap(moduleExports, 'Pool', this._poolWrapper.bind(this));\n return moduleExports;\n },\n (moduleExports: GenericPoolModule) => {\n // since the object is created on the fly every time, we need to use\n // a boolean switch here to disable the instrumentation\n this._isDisabled = true;\n return moduleExports;\n },\n ),\n ];\n }\n\n private _acquirePatcher(original: AcquireFn) {\n return function wrapped_acquire(this: genericPool.Pool<unknown>, ...args: unknown[]) {\n return startSpan(\n {\n name: 'generic-pool.acquire',\n attributes: { [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.db.otel.generic_pool' },\n },\n () => {\n return original.call(this, ...args) as PromiseLike<unknown>;\n },\n );\n };\n }\n\n private _poolWrapper(original: (this: unknown, ...args: unknown[]) => { acquire: AcquireFn }) {\n const wrap = this._wrap.bind(this);\n const acquireWithCallbacksPatcher = this._acquireWithCallbacksPatcher.bind(this);\n return function wrapped_pool(this: unknown, ...args: unknown[]) {\n const pool = original.apply(this, args);\n wrap(pool, 'acquire', acquireWithCallbacksPatcher);\n return pool;\n };\n }\n\n private _acquireWithCallbacksPatcher(original: AcquireFn) {\n const isDisabled = (): boolean => this._isDisabled;\n return function wrapped_acquire(\n this: genericPool.Pool<unknown>,\n cb: (err: unknown, client: unknown) => unknown,\n priority: number,\n ) {\n // only used for v2 - v2.3\n if (isDisabled()) {\n return original.call(this, cb, priority);\n }\n\n return startSpanManual(\n {\n name: 'generic-pool.acquire',\n attributes: { [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.db.otel.generic_pool' },\n },\n span => {\n original.call(\n this,\n (err: unknown, client: unknown) => {\n if (err) {\n span.setStatus({ code: SPAN_STATUS_ERROR, message: 'internal_error' });\n }\n span.end();\n // Not checking whether cb is a function because\n // the original code doesn't do that either.\n // The callback's return value is unused by generic-pool, so we don't return it.\n if (cb) {\n cb(err, client);\n }\n },\n priority,\n );\n },\n );\n };\n }\n}\n"],"names":[],"mappings":";;;AAqBA,MAAM,WAAA,GAAc,cAAA;AACpB,MAAM,YAAA,GAAe,sCAAA;AAUd,MAAM,mCAAmC,mBAAA,CAAoB;AAAA,EAIlE,WAAA,CAAY,MAAA,GAAgC,EAAC,EAAG;AAC9C,IAAA,KAAA,CAAM,YAAA,EAAc,aAAa,MAAM,CAAA;AAHzC;AAAA,IAAA,IAAA,CAAQ,WAAA,GAAc,KAAA;AAAA,EAItB;AAAA,EAEA,IAAA,GAAO;AACL,IAAA,OAAO;AAAA,MACL,IAAI,mCAAA;AAAA,QACF,WAAA;AAAA,QACA,CAAC,YAAY,CAAA;AAAA,QACb,CAAC,aAAA,KAAqC;AACpC,UAAA,MAAM,OAAO,aAAA,CAAc,IAAA;AAC3B,UAAA,IAAI,SAAA,CAAU,IAAA,CAAK,SAAA,CAAU,OAAO,CAAA,EAAG;AACrC,YAAA,IAAA,CAAK,OAAA,CAAQ,IAAA,CAAK,SAAA,EAAW,SAAS,CAAA;AAAA,UACxC;AACA,UAAA,IAAA,CAAK,KAAA,CAAM,KAAK,SAAA,EAAW,SAAA,EAAW,KAAK,eAAA,CAAgB,IAAA,CAAK,IAAI,CAAC,CAAA;AACrE,UAAA,OAAO,aAAA;AAAA,QACT,CAAA;AAAA,QACA,CAAC,aAAA,KAAqC;AACpC,UAAA,MAAM,OAAO,aAAA,CAAc,IAAA;AAC3B,UAAA,IAAA,CAAK,OAAA,CAAQ,IAAA,CAAK,SAAA,EAAW,SAAS,CAAA;AACtC,UAAA,OAAO,aAAA;AAAA,QACT;AAAA,OACF;AAAA,MACA,IAAI,mCAAA;AAAA,QACF,WAAA;AAAA,QACA,CAAC,YAAY,CAAA;AAAA,QACb,CAAC,aAAA,KAAqC;AACpC,UAAA,MAAM,OAAO,aAAA,CAAc,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AS,kBAAkB,CAAA;AAAA,cACvE;AACA,cAAA,IAAA,CAAK,GAAA,EAAI;AAIT,cAAA,IAAI,EAAA,EAAI;AACN,gBAAA,EAAA,CAAG,KAAK,MAAM,CAAA;AAAA,cAChB;AAAA,YACF,CAAA;AAAA,YACA;AAAA,WACF;AAAA,QACF;AAAA,OACF;AAAA,IACF,CAAA;AAAA,EACF;AACF;;;;"}
@@ -4,71 +4,16 @@ import { SentryGoogleGenAiInstrumentation } from './instrumentation.js';
4
4
 
5
5
  const instrumentGoogleGenAI = generateInstrumentOnce(
6
6
  GOOGLE_GENAI_INTEGRATION_NAME,
7
- options => new SentryGoogleGenAiInstrumentation(options),
7
+ (options) => new SentryGoogleGenAiInstrumentation(options)
8
8
  );
9
-
10
9
  const _googleGenAIIntegration = ((options = {}) => {
11
10
  return {
12
11
  name: GOOGLE_GENAI_INTEGRATION_NAME,
13
12
  setupOnce() {
14
13
  instrumentGoogleGenAI(options);
15
- },
14
+ }
16
15
  };
17
- }) ;
18
-
19
- /**
20
- * Adds Sentry tracing instrumentation for the Google Generative AI SDK.
21
- *
22
- * This integration is enabled by default.
23
- *
24
- * When configured, this integration automatically instruments Google GenAI SDK client instances
25
- * to capture telemetry data following OpenTelemetry Semantic Conventions for Generative AI.
26
- *
27
- * @example
28
- * ```javascript
29
- * import * as Sentry from '@sentry/node';
30
- *
31
- * Sentry.init({
32
- * integrations: [Sentry.googleGenAiIntegration()],
33
- * });
34
- * ```
35
- *
36
- * ## Options
37
- *
38
- * - `recordInputs`: Whether to record prompt messages (default: respects `sendDefaultPii` client option)
39
- * - `recordOutputs`: Whether to record response text (default: respects `sendDefaultPii` client option)
40
- *
41
- * ### Default Behavior
42
- *
43
- * By default, the integration will:
44
- * - Record inputs and outputs ONLY if `sendDefaultPii` is set to `true` in your Sentry client options
45
- * - Otherwise, inputs and outputs are NOT recorded unless explicitly enabled
46
- *
47
- * @example
48
- * ```javascript
49
- * // Record inputs and outputs when sendDefaultPii is false
50
- * Sentry.init({
51
- * integrations: [
52
- * Sentry.googleGenAiIntegration({
53
- * recordInputs: true,
54
- * recordOutputs: true
55
- * })
56
- * ],
57
- * });
58
- *
59
- * // Never record inputs/outputs regardless of sendDefaultPii
60
- * Sentry.init({
61
- * sendDefaultPii: true,
62
- * integrations: [
63
- * Sentry.googleGenAiIntegration({
64
- * recordInputs: false,
65
- * recordOutputs: false
66
- * })
67
- * ],
68
- * });
69
- * ```
70
- *
71
- */
16
+ });
72
17
  const googleGenAIIntegration = defineIntegration(_googleGenAIIntegration);
73
18
 
74
19
  export { googleGenAIIntegration, instrumentGoogleGenAI };