@depup/sentry__node 10.44.0-depup.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (473) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +31 -0
  3. package/build/cjs/debug-build.js +11 -0
  4. package/build/cjs/debug-build.js.map +1 -0
  5. package/build/cjs/index.js +216 -0
  6. package/build/cjs/index.js.map +1 -0
  7. package/build/cjs/init.js +10 -0
  8. package/build/cjs/init.js.map +1 -0
  9. package/build/cjs/integrations/featureFlagShims/growthbook.js +12 -0
  10. package/build/cjs/integrations/featureFlagShims/growthbook.js.map +1 -0
  11. package/build/cjs/integrations/featureFlagShims/launchDarkly.js +43 -0
  12. package/build/cjs/integrations/featureFlagShims/launchDarkly.js.map +1 -0
  13. package/build/cjs/integrations/featureFlagShims/openFeature.js +55 -0
  14. package/build/cjs/integrations/featureFlagShims/openFeature.js.map +1 -0
  15. package/build/cjs/integrations/featureFlagShims/statsig.js +23 -0
  16. package/build/cjs/integrations/featureFlagShims/statsig.js.map +1 -0
  17. package/build/cjs/integrations/featureFlagShims/unleash.js +23 -0
  18. package/build/cjs/integrations/featureFlagShims/unleash.js.map +1 -0
  19. package/build/cjs/integrations/fs.js +142 -0
  20. package/build/cjs/integrations/fs.js.map +1 -0
  21. package/build/cjs/integrations/http.js +224 -0
  22. package/build/cjs/integrations/http.js.map +1 -0
  23. package/build/cjs/integrations/node-fetch.js +108 -0
  24. package/build/cjs/integrations/node-fetch.js.map +1 -0
  25. package/build/cjs/integrations/tracing/amqplib.js +47 -0
  26. package/build/cjs/integrations/tracing/amqplib.js.map +1 -0
  27. package/build/cjs/integrations/tracing/anthropic-ai/index.js +79 -0
  28. package/build/cjs/integrations/tracing/anthropic-ai/index.js.map +1 -0
  29. package/build/cjs/integrations/tracing/anthropic-ai/instrumentation.js +95 -0
  30. package/build/cjs/integrations/tracing/anthropic-ai/instrumentation.js.map +1 -0
  31. package/build/cjs/integrations/tracing/connect.js +110 -0
  32. package/build/cjs/integrations/tracing/connect.js.map +1 -0
  33. package/build/cjs/integrations/tracing/dataloader.js +72 -0
  34. package/build/cjs/integrations/tracing/dataloader.js.map +1 -0
  35. package/build/cjs/integrations/tracing/express.js +166 -0
  36. package/build/cjs/integrations/tracing/express.js.map +1 -0
  37. package/build/cjs/integrations/tracing/fastify/index.js +270 -0
  38. package/build/cjs/integrations/tracing/fastify/index.js.map +1 -0
  39. package/build/cjs/integrations/tracing/fastify/v3/constants.js +23 -0
  40. package/build/cjs/integrations/tracing/fastify/v3/constants.js.map +1 -0
  41. package/build/cjs/integrations/tracing/fastify/v3/enums/AttributeNames.js +37 -0
  42. package/build/cjs/integrations/tracing/fastify/v3/enums/AttributeNames.js.map +1 -0
  43. package/build/cjs/integrations/tracing/fastify/v3/instrumentation.js +304 -0
  44. package/build/cjs/integrations/tracing/fastify/v3/instrumentation.js.map +1 -0
  45. package/build/cjs/integrations/tracing/fastify/v3/utils.js +135 -0
  46. package/build/cjs/integrations/tracing/fastify/v3/utils.js.map +1 -0
  47. package/build/cjs/integrations/tracing/firebase/firebase.js +50 -0
  48. package/build/cjs/integrations/tracing/firebase/firebase.js.map +1 -0
  49. package/build/cjs/integrations/tracing/firebase/otel/firebaseInstrumentation.js +44 -0
  50. package/build/cjs/integrations/tracing/firebase/otel/firebaseInstrumentation.js.map +1 -0
  51. package/build/cjs/integrations/tracing/firebase/otel/patches/firestore.js +297 -0
  52. package/build/cjs/integrations/tracing/firebase/otel/patches/firestore.js.map +1 -0
  53. package/build/cjs/integrations/tracing/firebase/otel/patches/functions.js +265 -0
  54. package/build/cjs/integrations/tracing/firebase/otel/patches/functions.js.map +1 -0
  55. package/build/cjs/integrations/tracing/genericPool.js +59 -0
  56. package/build/cjs/integrations/tracing/genericPool.js.map +1 -0
  57. package/build/cjs/integrations/tracing/google-genai/index.js +78 -0
  58. package/build/cjs/integrations/tracing/google-genai/index.js.map +1 -0
  59. package/build/cjs/integrations/tracing/google-genai/instrumentation.js +88 -0
  60. package/build/cjs/integrations/tracing/google-genai/instrumentation.js.map +1 -0
  61. package/build/cjs/integrations/tracing/graphql.js +127 -0
  62. package/build/cjs/integrations/tracing/graphql.js.map +1 -0
  63. package/build/cjs/integrations/tracing/hapi/index.js +135 -0
  64. package/build/cjs/integrations/tracing/hapi/index.js.map +1 -0
  65. package/build/cjs/integrations/tracing/hono/constants.js +15 -0
  66. package/build/cjs/integrations/tracing/hono/constants.js.map +1 -0
  67. package/build/cjs/integrations/tracing/hono/index.js +137 -0
  68. package/build/cjs/integrations/tracing/hono/index.js.map +1 -0
  69. package/build/cjs/integrations/tracing/hono/instrumentation.js +236 -0
  70. package/build/cjs/integrations/tracing/hono/instrumentation.js.map +1 -0
  71. package/build/cjs/integrations/tracing/index.js +110 -0
  72. package/build/cjs/integrations/tracing/index.js.map +1 -0
  73. package/build/cjs/integrations/tracing/kafka.js +48 -0
  74. package/build/cjs/integrations/tracing/kafka.js.map +1 -0
  75. package/build/cjs/integrations/tracing/knex.js +57 -0
  76. package/build/cjs/integrations/tracing/knex.js.map +1 -0
  77. package/build/cjs/integrations/tracing/koa.js +138 -0
  78. package/build/cjs/integrations/tracing/koa.js.map +1 -0
  79. package/build/cjs/integrations/tracing/langchain/index.js +116 -0
  80. package/build/cjs/integrations/tracing/langchain/index.js.map +1 -0
  81. package/build/cjs/integrations/tracing/langchain/instrumentation.js +220 -0
  82. package/build/cjs/integrations/tracing/langchain/instrumentation.js.map +1 -0
  83. package/build/cjs/integrations/tracing/langgraph/index.js +93 -0
  84. package/build/cjs/integrations/tracing/langgraph/index.js.map +1 -0
  85. package/build/cjs/integrations/tracing/langgraph/instrumentation.js +60 -0
  86. package/build/cjs/integrations/tracing/langgraph/instrumentation.js.map +1 -0
  87. package/build/cjs/integrations/tracing/lrumemoizer.js +37 -0
  88. package/build/cjs/integrations/tracing/lrumemoizer.js.map +1 -0
  89. package/build/cjs/integrations/tracing/mongo.js +93 -0
  90. package/build/cjs/integrations/tracing/mongo.js.map +1 -0
  91. package/build/cjs/integrations/tracing/mongoose.js +46 -0
  92. package/build/cjs/integrations/tracing/mongoose.js.map +1 -0
  93. package/build/cjs/integrations/tracing/mysql.js +38 -0
  94. package/build/cjs/integrations/tracing/mysql.js.map +1 -0
  95. package/build/cjs/integrations/tracing/mysql2.js +46 -0
  96. package/build/cjs/integrations/tracing/mysql2.js.map +1 -0
  97. package/build/cjs/integrations/tracing/openai/index.js +78 -0
  98. package/build/cjs/integrations/tracing/openai/index.js.map +1 -0
  99. package/build/cjs/integrations/tracing/openai/instrumentation.js +104 -0
  100. package/build/cjs/integrations/tracing/openai/instrumentation.js.map +1 -0
  101. package/build/cjs/integrations/tracing/postgres.js +48 -0
  102. package/build/cjs/integrations/tracing/postgres.js.map +1 -0
  103. package/build/cjs/integrations/tracing/postgresjs.js +378 -0
  104. package/build/cjs/integrations/tracing/postgresjs.js.map +1 -0
  105. package/build/cjs/integrations/tracing/prisma.js +203 -0
  106. package/build/cjs/integrations/tracing/prisma.js.map +1 -0
  107. package/build/cjs/integrations/tracing/redis.js +121 -0
  108. package/build/cjs/integrations/tracing/redis.js.map +1 -0
  109. package/build/cjs/integrations/tracing/tedious.js +67 -0
  110. package/build/cjs/integrations/tracing/tedious.js.map +1 -0
  111. package/build/cjs/integrations/tracing/vercelai/constants.js +6 -0
  112. package/build/cjs/integrations/tracing/vercelai/constants.js.map +1 -0
  113. package/build/cjs/integrations/tracing/vercelai/index.js +82 -0
  114. package/build/cjs/integrations/tracing/vercelai/index.js.map +1 -0
  115. package/build/cjs/integrations/tracing/vercelai/instrumentation.js +274 -0
  116. package/build/cjs/integrations/tracing/vercelai/instrumentation.js.map +1 -0
  117. package/build/cjs/preload.js +21 -0
  118. package/build/cjs/preload.js.map +1 -0
  119. package/build/cjs/sdk/index.js +78 -0
  120. package/build/cjs/sdk/index.js.map +1 -0
  121. package/build/cjs/sdk/initOtel.js +126 -0
  122. package/build/cjs/sdk/initOtel.js.map +1 -0
  123. package/build/cjs/utils/redisCache.js +122 -0
  124. package/build/cjs/utils/redisCache.js.map +1 -0
  125. package/build/esm/debug-build.js +9 -0
  126. package/build/esm/debug-build.js.map +1 -0
  127. package/build/esm/index.js +44 -0
  128. package/build/esm/index.js.map +1 -0
  129. package/build/esm/init.js +10 -0
  130. package/build/esm/init.js.map +1 -0
  131. package/build/esm/integrations/featureFlagShims/growthbook.js +10 -0
  132. package/build/esm/integrations/featureFlagShims/growthbook.js.map +1 -0
  133. package/build/esm/integrations/featureFlagShims/launchDarkly.js +40 -0
  134. package/build/esm/integrations/featureFlagShims/launchDarkly.js.map +1 -0
  135. package/build/esm/integrations/featureFlagShims/openFeature.js +52 -0
  136. package/build/esm/integrations/featureFlagShims/openFeature.js.map +1 -0
  137. package/build/esm/integrations/featureFlagShims/statsig.js +21 -0
  138. package/build/esm/integrations/featureFlagShims/statsig.js.map +1 -0
  139. package/build/esm/integrations/featureFlagShims/unleash.js +21 -0
  140. package/build/esm/integrations/featureFlagShims/unleash.js.map +1 -0
  141. package/build/esm/integrations/fs.js +140 -0
  142. package/build/esm/integrations/fs.js.map +1 -0
  143. package/build/esm/integrations/http.js +219 -0
  144. package/build/esm/integrations/http.js.map +1 -0
  145. package/build/esm/integrations/node-fetch.js +105 -0
  146. package/build/esm/integrations/node-fetch.js.map +1 -0
  147. package/build/esm/integrations/tracing/amqplib.js +44 -0
  148. package/build/esm/integrations/tracing/amqplib.js.map +1 -0
  149. package/build/esm/integrations/tracing/anthropic-ai/index.js +76 -0
  150. package/build/esm/integrations/tracing/anthropic-ai/index.js.map +1 -0
  151. package/build/esm/integrations/tracing/anthropic-ai/instrumentation.js +93 -0
  152. package/build/esm/integrations/tracing/anthropic-ai/instrumentation.js.map +1 -0
  153. package/build/esm/integrations/tracing/connect.js +106 -0
  154. package/build/esm/integrations/tracing/connect.js.map +1 -0
  155. package/build/esm/integrations/tracing/dataloader.js +69 -0
  156. package/build/esm/integrations/tracing/dataloader.js.map +1 -0
  157. package/build/esm/integrations/tracing/express.js +161 -0
  158. package/build/esm/integrations/tracing/express.js.map +1 -0
  159. package/build/esm/integrations/tracing/fastify/index.js +265 -0
  160. package/build/esm/integrations/tracing/fastify/index.js.map +1 -0
  161. package/build/esm/integrations/tracing/fastify/v3/constants.js +21 -0
  162. package/build/esm/integrations/tracing/fastify/v3/constants.js.map +1 -0
  163. package/build/esm/integrations/tracing/fastify/v3/enums/AttributeNames.js +37 -0
  164. package/build/esm/integrations/tracing/fastify/v3/enums/AttributeNames.js.map +1 -0
  165. package/build/esm/integrations/tracing/fastify/v3/instrumentation.js +302 -0
  166. package/build/esm/integrations/tracing/fastify/v3/instrumentation.js.map +1 -0
  167. package/build/esm/integrations/tracing/fastify/v3/utils.js +131 -0
  168. package/build/esm/integrations/tracing/fastify/v3/utils.js.map +1 -0
  169. package/build/esm/integrations/tracing/firebase/firebase.js +47 -0
  170. package/build/esm/integrations/tracing/firebase/firebase.js.map +1 -0
  171. package/build/esm/integrations/tracing/firebase/otel/firebaseInstrumentation.js +42 -0
  172. package/build/esm/integrations/tracing/firebase/otel/firebaseInstrumentation.js.map +1 -0
  173. package/build/esm/integrations/tracing/firebase/otel/patches/firestore.js +294 -0
  174. package/build/esm/integrations/tracing/firebase/otel/patches/firestore.js.map +1 -0
  175. package/build/esm/integrations/tracing/firebase/otel/patches/functions.js +262 -0
  176. package/build/esm/integrations/tracing/firebase/otel/patches/functions.js.map +1 -0
  177. package/build/esm/integrations/tracing/genericPool.js +56 -0
  178. package/build/esm/integrations/tracing/genericPool.js.map +1 -0
  179. package/build/esm/integrations/tracing/google-genai/index.js +75 -0
  180. package/build/esm/integrations/tracing/google-genai/index.js.map +1 -0
  181. package/build/esm/integrations/tracing/google-genai/instrumentation.js +86 -0
  182. package/build/esm/integrations/tracing/google-genai/instrumentation.js.map +1 -0
  183. package/build/esm/integrations/tracing/graphql.js +124 -0
  184. package/build/esm/integrations/tracing/graphql.js.map +1 -0
  185. package/build/esm/integrations/tracing/hapi/index.js +130 -0
  186. package/build/esm/integrations/tracing/hapi/index.js.map +1 -0
  187. package/build/esm/integrations/tracing/hono/constants.js +12 -0
  188. package/build/esm/integrations/tracing/hono/constants.js.map +1 -0
  189. package/build/esm/integrations/tracing/hono/index.js +133 -0
  190. package/build/esm/integrations/tracing/hono/index.js.map +1 -0
  191. package/build/esm/integrations/tracing/hono/instrumentation.js +234 -0
  192. package/build/esm/integrations/tracing/hono/instrumentation.js.map +1 -0
  193. package/build/esm/integrations/tracing/index.js +107 -0
  194. package/build/esm/integrations/tracing/index.js.map +1 -0
  195. package/build/esm/integrations/tracing/kafka.js +45 -0
  196. package/build/esm/integrations/tracing/kafka.js.map +1 -0
  197. package/build/esm/integrations/tracing/knex.js +54 -0
  198. package/build/esm/integrations/tracing/knex.js.map +1 -0
  199. package/build/esm/integrations/tracing/koa.js +134 -0
  200. package/build/esm/integrations/tracing/koa.js.map +1 -0
  201. package/build/esm/integrations/tracing/langchain/index.js +113 -0
  202. package/build/esm/integrations/tracing/langchain/index.js.map +1 -0
  203. package/build/esm/integrations/tracing/langchain/instrumentation.js +218 -0
  204. package/build/esm/integrations/tracing/langchain/instrumentation.js.map +1 -0
  205. package/build/esm/integrations/tracing/langgraph/index.js +90 -0
  206. package/build/esm/integrations/tracing/langgraph/index.js.map +1 -0
  207. package/build/esm/integrations/tracing/langgraph/instrumentation.js +58 -0
  208. package/build/esm/integrations/tracing/langgraph/instrumentation.js.map +1 -0
  209. package/build/esm/integrations/tracing/lrumemoizer.js +34 -0
  210. package/build/esm/integrations/tracing/lrumemoizer.js.map +1 -0
  211. package/build/esm/integrations/tracing/mongo.js +89 -0
  212. package/build/esm/integrations/tracing/mongo.js.map +1 -0
  213. package/build/esm/integrations/tracing/mongoose.js +43 -0
  214. package/build/esm/integrations/tracing/mongoose.js.map +1 -0
  215. package/build/esm/integrations/tracing/mysql.js +35 -0
  216. package/build/esm/integrations/tracing/mysql.js.map +1 -0
  217. package/build/esm/integrations/tracing/mysql2.js +43 -0
  218. package/build/esm/integrations/tracing/mysql2.js.map +1 -0
  219. package/build/esm/integrations/tracing/openai/index.js +75 -0
  220. package/build/esm/integrations/tracing/openai/index.js.map +1 -0
  221. package/build/esm/integrations/tracing/openai/instrumentation.js +102 -0
  222. package/build/esm/integrations/tracing/openai/instrumentation.js.map +1 -0
  223. package/build/esm/integrations/tracing/postgres.js +45 -0
  224. package/build/esm/integrations/tracing/postgres.js.map +1 -0
  225. package/build/esm/integrations/tracing/postgresjs.js +374 -0
  226. package/build/esm/integrations/tracing/postgresjs.js.map +1 -0
  227. package/build/esm/integrations/tracing/prisma.js +200 -0
  228. package/build/esm/integrations/tracing/prisma.js.map +1 -0
  229. package/build/esm/integrations/tracing/redis.js +117 -0
  230. package/build/esm/integrations/tracing/redis.js.map +1 -0
  231. package/build/esm/integrations/tracing/tedious.js +64 -0
  232. package/build/esm/integrations/tracing/tedious.js.map +1 -0
  233. package/build/esm/integrations/tracing/vercelai/constants.js +4 -0
  234. package/build/esm/integrations/tracing/vercelai/constants.js.map +1 -0
  235. package/build/esm/integrations/tracing/vercelai/index.js +79 -0
  236. package/build/esm/integrations/tracing/vercelai/index.js.map +1 -0
  237. package/build/esm/integrations/tracing/vercelai/instrumentation.js +269 -0
  238. package/build/esm/integrations/tracing/vercelai/instrumentation.js.map +1 -0
  239. package/build/esm/package.json +1 -0
  240. package/build/esm/preload.js +21 -0
  241. package/build/esm/preload.js.map +1 -0
  242. package/build/esm/sdk/index.js +73 -0
  243. package/build/esm/sdk/index.js.map +1 -0
  244. package/build/esm/sdk/initOtel.js +121 -0
  245. package/build/esm/sdk/initOtel.js.map +1 -0
  246. package/build/esm/utils/redisCache.js +114 -0
  247. package/build/esm/utils/redisCache.js.map +1 -0
  248. package/build/import-hook.mjs +5 -0
  249. package/build/loader-hook.mjs +1 -0
  250. package/build/types/debug-build.d.ts +7 -0
  251. package/build/types/debug-build.d.ts.map +1 -0
  252. package/build/types/index.d.ts +42 -0
  253. package/build/types/index.d.ts.map +1 -0
  254. package/build/types/init.d.ts +2 -0
  255. package/build/types/init.d.ts.map +1 -0
  256. package/build/types/integrations/featureFlagShims/growthbook.d.ts +6 -0
  257. package/build/types/integrations/featureFlagShims/growthbook.d.ts.map +1 -0
  258. package/build/types/integrations/featureFlagShims/index.d.ts +6 -0
  259. package/build/types/integrations/featureFlagShims/index.d.ts.map +1 -0
  260. package/build/types/integrations/featureFlagShims/launchDarkly.d.ts +10 -0
  261. package/build/types/integrations/featureFlagShims/launchDarkly.d.ts.map +1 -0
  262. package/build/types/integrations/featureFlagShims/openFeature.d.ts +23 -0
  263. package/build/types/integrations/featureFlagShims/openFeature.d.ts.map +1 -0
  264. package/build/types/integrations/featureFlagShims/statsig.d.ts +6 -0
  265. package/build/types/integrations/featureFlagShims/statsig.d.ts.map +1 -0
  266. package/build/types/integrations/featureFlagShims/unleash.d.ts +6 -0
  267. package/build/types/integrations/featureFlagShims/unleash.d.ts.map +1 -0
  268. package/build/types/integrations/fs.d.ts +24 -0
  269. package/build/types/integrations/fs.d.ts.map +1 -0
  270. package/build/types/integrations/http.d.ts +136 -0
  271. package/build/types/integrations/http.d.ts.map +1 -0
  272. package/build/types/integrations/node-fetch.d.ts +36 -0
  273. package/build/types/integrations/node-fetch.d.ts.map +1 -0
  274. package/build/types/integrations/tracing/amqplib.d.ts +20 -0
  275. package/build/types/integrations/tracing/amqplib.d.ts.map +1 -0
  276. package/build/types/integrations/tracing/anthropic-ai/index.d.ts +59 -0
  277. package/build/types/integrations/tracing/anthropic-ai/index.d.ts.map +1 -0
  278. package/build/types/integrations/tracing/anthropic-ai/instrumentation.d.ts +19 -0
  279. package/build/types/integrations/tracing/anthropic-ai/instrumentation.d.ts.map +1 -0
  280. package/build/types/integrations/tracing/connect.d.ts +46 -0
  281. package/build/types/integrations/tracing/connect.d.ts.map +1 -0
  282. package/build/types/integrations/tracing/dataloader.d.ts +20 -0
  283. package/build/types/integrations/tracing/dataloader.d.ts.map +1 -0
  284. package/build/types/integrations/tracing/express.d.ts +72 -0
  285. package/build/types/integrations/tracing/express.d.ts.map +1 -0
  286. package/build/types/integrations/tracing/fastify/index.d.ts +119 -0
  287. package/build/types/integrations/tracing/fastify/index.d.ts.map +1 -0
  288. package/build/types/integrations/tracing/fastify/types.d.ts +33 -0
  289. package/build/types/integrations/tracing/fastify/types.d.ts.map +1 -0
  290. package/build/types/integrations/tracing/fastify/v3/constants.d.ts +3 -0
  291. package/build/types/integrations/tracing/fastify/v3/constants.d.ts.map +1 -0
  292. package/build/types/integrations/tracing/fastify/v3/enums/AttributeNames.d.ts +15 -0
  293. package/build/types/integrations/tracing/fastify/v3/enums/AttributeNames.d.ts.map +1 -0
  294. package/build/types/integrations/tracing/fastify/v3/instrumentation.d.ts +16 -0
  295. package/build/types/integrations/tracing/fastify/v3/instrumentation.d.ts.map +1 -0
  296. package/build/types/integrations/tracing/fastify/v3/internal-types.d.ts +7 -0
  297. package/build/types/integrations/tracing/fastify/v3/internal-types.d.ts.map +1 -0
  298. package/build/types/integrations/tracing/fastify/v3/types.d.ts +21 -0
  299. package/build/types/integrations/tracing/fastify/v3/types.d.ts.map +1 -0
  300. package/build/types/integrations/tracing/fastify/v3/utils.d.ts +28 -0
  301. package/build/types/integrations/tracing/fastify/v3/utils.d.ts.map +1 -0
  302. package/build/types/integrations/tracing/firebase/firebase.d.ts +6 -0
  303. package/build/types/integrations/tracing/firebase/firebase.d.ts.map +1 -0
  304. package/build/types/integrations/tracing/firebase/index.d.ts +2 -0
  305. package/build/types/integrations/tracing/firebase/index.d.ts.map +1 -0
  306. package/build/types/integrations/tracing/firebase/otel/firebaseInstrumentation.d.ts +19 -0
  307. package/build/types/integrations/tracing/firebase/otel/firebaseInstrumentation.d.ts.map +1 -0
  308. package/build/types/integrations/tracing/firebase/otel/index.d.ts +3 -0
  309. package/build/types/integrations/tracing/firebase/otel/index.d.ts.map +1 -0
  310. package/build/types/integrations/tracing/firebase/otel/patches/firestore.d.ts +25 -0
  311. package/build/types/integrations/tracing/firebase/otel/patches/firestore.d.ts.map +1 -0
  312. package/build/types/integrations/tracing/firebase/otel/patches/functions.d.ts +23 -0
  313. package/build/types/integrations/tracing/firebase/otel/patches/functions.d.ts.map +1 -0
  314. package/build/types/integrations/tracing/firebase/otel/types.d.ts +120 -0
  315. package/build/types/integrations/tracing/firebase/otel/types.d.ts.map +1 -0
  316. package/build/types/integrations/tracing/genericPool.d.ts +20 -0
  317. package/build/types/integrations/tracing/genericPool.d.ts.map +1 -0
  318. package/build/types/integrations/tracing/google-genai/index.d.ts +59 -0
  319. package/build/types/integrations/tracing/google-genai/index.d.ts.map +1 -0
  320. package/build/types/integrations/tracing/google-genai/instrumentation.d.ts +20 -0
  321. package/build/types/integrations/tracing/google-genai/instrumentation.d.ts.map +1 -0
  322. package/build/types/integrations/tracing/graphql.d.ts +48 -0
  323. package/build/types/integrations/tracing/graphql.d.ts.map +1 -0
  324. package/build/types/integrations/tracing/hapi/index.d.ts +50 -0
  325. package/build/types/integrations/tracing/hapi/index.d.ts.map +1 -0
  326. package/build/types/integrations/tracing/hapi/types.d.ts +166 -0
  327. package/build/types/integrations/tracing/hapi/types.d.ts.map +1 -0
  328. package/build/types/integrations/tracing/hono/constants.d.ts +11 -0
  329. package/build/types/integrations/tracing/hono/constants.d.ts.map +1 -0
  330. package/build/types/integrations/tracing/hono/index.d.ts +52 -0
  331. package/build/types/integrations/tracing/hono/index.d.ts.map +1 -0
  332. package/build/types/integrations/tracing/hono/instrumentation.d.ts +55 -0
  333. package/build/types/integrations/tracing/hono/instrumentation.d.ts.map +1 -0
  334. package/build/types/integrations/tracing/hono/types.d.ts +36 -0
  335. package/build/types/integrations/tracing/hono/types.d.ts.map +1 -0
  336. package/build/types/integrations/tracing/index.d.ts +12 -0
  337. package/build/types/integrations/tracing/index.d.ts.map +1 -0
  338. package/build/types/integrations/tracing/kafka.d.ts +19 -0
  339. package/build/types/integrations/tracing/kafka.d.ts.map +1 -0
  340. package/build/types/integrations/tracing/knex.d.ts +20 -0
  341. package/build/types/integrations/tracing/knex.d.ts.map +1 -0
  342. package/build/types/integrations/tracing/koa.d.ts +70 -0
  343. package/build/types/integrations/tracing/koa.d.ts.map +1 -0
  344. package/build/types/integrations/tracing/langchain/index.d.ts +97 -0
  345. package/build/types/integrations/tracing/langchain/index.d.ts.map +1 -0
  346. package/build/types/integrations/tracing/langchain/instrumentation.d.ts +29 -0
  347. package/build/types/integrations/tracing/langchain/instrumentation.d.ts.map +1 -0
  348. package/build/types/integrations/tracing/langgraph/index.d.ts +74 -0
  349. package/build/types/integrations/tracing/langgraph/index.d.ts.map +1 -0
  350. package/build/types/integrations/tracing/langgraph/instrumentation.d.ts +19 -0
  351. package/build/types/integrations/tracing/langgraph/instrumentation.d.ts.map +1 -0
  352. package/build/types/integrations/tracing/lrumemoizer.d.ts +19 -0
  353. package/build/types/integrations/tracing/lrumemoizer.d.ts.map +1 -0
  354. package/build/types/integrations/tracing/mongo.d.ts +24 -0
  355. package/build/types/integrations/tracing/mongo.d.ts.map +1 -0
  356. package/build/types/integrations/tracing/mongoose.d.ts +20 -0
  357. package/build/types/integrations/tracing/mongoose.d.ts.map +1 -0
  358. package/build/types/integrations/tracing/mysql.d.ts +20 -0
  359. package/build/types/integrations/tracing/mysql.d.ts.map +1 -0
  360. package/build/types/integrations/tracing/mysql2.d.ts +20 -0
  361. package/build/types/integrations/tracing/mysql2.d.ts.map +1 -0
  362. package/build/types/integrations/tracing/openai/index.d.ts +59 -0
  363. package/build/types/integrations/tracing/openai/index.d.ts.map +1 -0
  364. package/build/types/integrations/tracing/openai/instrumentation.d.ts +26 -0
  365. package/build/types/integrations/tracing/openai/instrumentation.d.ts.map +1 -0
  366. package/build/types/integrations/tracing/postgres.d.ts +24 -0
  367. package/build/types/integrations/tracing/postgres.d.ts.map +1 -0
  368. package/build/types/integrations/tracing/postgresjs.d.ts +101 -0
  369. package/build/types/integrations/tracing/postgresjs.d.ts.map +1 -0
  370. package/build/types/integrations/tracing/prisma/vendor/v5-tracing-helper.d.ts +38 -0
  371. package/build/types/integrations/tracing/prisma/vendor/v5-tracing-helper.d.ts.map +1 -0
  372. package/build/types/integrations/tracing/prisma/vendor/v6-tracing-helper.d.ts +31 -0
  373. package/build/types/integrations/tracing/prisma/vendor/v6-tracing-helper.d.ts.map +1 -0
  374. package/build/types/integrations/tracing/prisma.d.ts +50 -0
  375. package/build/types/integrations/tracing/prisma.d.ts.map +1 -0
  376. package/build/types/integrations/tracing/redis.d.ts +41 -0
  377. package/build/types/integrations/tracing/redis.d.ts.map +1 -0
  378. package/build/types/integrations/tracing/tedious.d.ts +20 -0
  379. package/build/types/integrations/tracing/tedious.d.ts.map +1 -0
  380. package/build/types/integrations/tracing/vercelai/constants.d.ts +2 -0
  381. package/build/types/integrations/tracing/vercelai/constants.d.ts.map +1 -0
  382. package/build/types/integrations/tracing/vercelai/index.d.ts +43 -0
  383. package/build/types/integrations/tracing/vercelai/index.d.ts.map +1 -0
  384. package/build/types/integrations/tracing/vercelai/instrumentation.d.ts +56 -0
  385. package/build/types/integrations/tracing/vercelai/instrumentation.d.ts.map +1 -0
  386. package/build/types/integrations/tracing/vercelai/types.d.ts +59 -0
  387. package/build/types/integrations/tracing/vercelai/types.d.ts.map +1 -0
  388. package/build/types/preload.d.ts +2 -0
  389. package/build/types/preload.d.ts.map +1 -0
  390. package/build/types/sdk/index.d.ts +18 -0
  391. package/build/types/sdk/index.d.ts.map +1 -0
  392. package/build/types/sdk/initOtel.d.ts +28 -0
  393. package/build/types/sdk/initOtel.d.ts.map +1 -0
  394. package/build/types/types.d.ts +89 -0
  395. package/build/types/types.d.ts.map +1 -0
  396. package/build/types/utils/redisCache.d.ts +16 -0
  397. package/build/types/utils/redisCache.d.ts.map +1 -0
  398. package/build/types-ts3.8/debug-build.d.ts +7 -0
  399. package/build/types-ts3.8/index.d.ts +42 -0
  400. package/build/types-ts3.8/init.d.ts +2 -0
  401. package/build/types-ts3.8/integrations/featureFlagShims/growthbook.d.ts +6 -0
  402. package/build/types-ts3.8/integrations/featureFlagShims/index.d.ts +6 -0
  403. package/build/types-ts3.8/integrations/featureFlagShims/launchDarkly.d.ts +10 -0
  404. package/build/types-ts3.8/integrations/featureFlagShims/openFeature.d.ts +23 -0
  405. package/build/types-ts3.8/integrations/featureFlagShims/statsig.d.ts +6 -0
  406. package/build/types-ts3.8/integrations/featureFlagShims/unleash.d.ts +6 -0
  407. package/build/types-ts3.8/integrations/fs.d.ts +24 -0
  408. package/build/types-ts3.8/integrations/http.d.ts +139 -0
  409. package/build/types-ts3.8/integrations/node-fetch.d.ts +36 -0
  410. package/build/types-ts3.8/integrations/tracing/amqplib.d.ts +20 -0
  411. package/build/types-ts3.8/integrations/tracing/anthropic-ai/index.d.ts +59 -0
  412. package/build/types-ts3.8/integrations/tracing/anthropic-ai/instrumentation.d.ts +19 -0
  413. package/build/types-ts3.8/integrations/tracing/connect.d.ts +46 -0
  414. package/build/types-ts3.8/integrations/tracing/dataloader.d.ts +20 -0
  415. package/build/types-ts3.8/integrations/tracing/express.d.ts +72 -0
  416. package/build/types-ts3.8/integrations/tracing/fastify/index.d.ts +119 -0
  417. package/build/types-ts3.8/integrations/tracing/fastify/types.d.ts +33 -0
  418. package/build/types-ts3.8/integrations/tracing/fastify/v3/constants.d.ts +3 -0
  419. package/build/types-ts3.8/integrations/tracing/fastify/v3/enums/AttributeNames.d.ts +15 -0
  420. package/build/types-ts3.8/integrations/tracing/fastify/v3/instrumentation.d.ts +16 -0
  421. package/build/types-ts3.8/integrations/tracing/fastify/v3/internal-types.d.ts +7 -0
  422. package/build/types-ts3.8/integrations/tracing/fastify/v3/types.d.ts +21 -0
  423. package/build/types-ts3.8/integrations/tracing/fastify/v3/utils.d.ts +28 -0
  424. package/build/types-ts3.8/integrations/tracing/firebase/firebase.d.ts +6 -0
  425. package/build/types-ts3.8/integrations/tracing/firebase/index.d.ts +2 -0
  426. package/build/types-ts3.8/integrations/tracing/firebase/otel/firebaseInstrumentation.d.ts +19 -0
  427. package/build/types-ts3.8/integrations/tracing/firebase/otel/index.d.ts +3 -0
  428. package/build/types-ts3.8/integrations/tracing/firebase/otel/patches/firestore.d.ts +25 -0
  429. package/build/types-ts3.8/integrations/tracing/firebase/otel/patches/functions.d.ts +23 -0
  430. package/build/types-ts3.8/integrations/tracing/firebase/otel/types.d.ts +120 -0
  431. package/build/types-ts3.8/integrations/tracing/genericPool.d.ts +20 -0
  432. package/build/types-ts3.8/integrations/tracing/google-genai/index.d.ts +59 -0
  433. package/build/types-ts3.8/integrations/tracing/google-genai/instrumentation.d.ts +20 -0
  434. package/build/types-ts3.8/integrations/tracing/graphql.d.ts +48 -0
  435. package/build/types-ts3.8/integrations/tracing/hapi/index.d.ts +50 -0
  436. package/build/types-ts3.8/integrations/tracing/hapi/types.d.ts +166 -0
  437. package/build/types-ts3.8/integrations/tracing/hono/constants.d.ts +11 -0
  438. package/build/types-ts3.8/integrations/tracing/hono/index.d.ts +52 -0
  439. package/build/types-ts3.8/integrations/tracing/hono/instrumentation.d.ts +55 -0
  440. package/build/types-ts3.8/integrations/tracing/hono/types.d.ts +36 -0
  441. package/build/types-ts3.8/integrations/tracing/index.d.ts +12 -0
  442. package/build/types-ts3.8/integrations/tracing/kafka.d.ts +19 -0
  443. package/build/types-ts3.8/integrations/tracing/knex.d.ts +20 -0
  444. package/build/types-ts3.8/integrations/tracing/koa.d.ts +70 -0
  445. package/build/types-ts3.8/integrations/tracing/langchain/index.d.ts +97 -0
  446. package/build/types-ts3.8/integrations/tracing/langchain/instrumentation.d.ts +29 -0
  447. package/build/types-ts3.8/integrations/tracing/langgraph/index.d.ts +74 -0
  448. package/build/types-ts3.8/integrations/tracing/langgraph/instrumentation.d.ts +19 -0
  449. package/build/types-ts3.8/integrations/tracing/lrumemoizer.d.ts +19 -0
  450. package/build/types-ts3.8/integrations/tracing/mongo.d.ts +24 -0
  451. package/build/types-ts3.8/integrations/tracing/mongoose.d.ts +20 -0
  452. package/build/types-ts3.8/integrations/tracing/mysql.d.ts +20 -0
  453. package/build/types-ts3.8/integrations/tracing/mysql2.d.ts +20 -0
  454. package/build/types-ts3.8/integrations/tracing/openai/index.d.ts +59 -0
  455. package/build/types-ts3.8/integrations/tracing/openai/instrumentation.d.ts +26 -0
  456. package/build/types-ts3.8/integrations/tracing/postgres.d.ts +24 -0
  457. package/build/types-ts3.8/integrations/tracing/postgresjs.d.ts +101 -0
  458. package/build/types-ts3.8/integrations/tracing/prisma/vendor/v5-tracing-helper.d.ts +44 -0
  459. package/build/types-ts3.8/integrations/tracing/prisma/vendor/v6-tracing-helper.d.ts +34 -0
  460. package/build/types-ts3.8/integrations/tracing/prisma.d.ts +50 -0
  461. package/build/types-ts3.8/integrations/tracing/redis.d.ts +41 -0
  462. package/build/types-ts3.8/integrations/tracing/tedious.d.ts +20 -0
  463. package/build/types-ts3.8/integrations/tracing/vercelai/constants.d.ts +2 -0
  464. package/build/types-ts3.8/integrations/tracing/vercelai/index.d.ts +43 -0
  465. package/build/types-ts3.8/integrations/tracing/vercelai/instrumentation.d.ts +56 -0
  466. package/build/types-ts3.8/integrations/tracing/vercelai/types.d.ts +59 -0
  467. package/build/types-ts3.8/preload.d.ts +2 -0
  468. package/build/types-ts3.8/sdk/index.d.ts +18 -0
  469. package/build/types-ts3.8/sdk/initOtel.d.ts +31 -0
  470. package/build/types-ts3.8/types.d.ts +89 -0
  471. package/build/types-ts3.8/utils/redisCache.d.ts +16 -0
  472. package/changes.json +10 -0
  473. package/package.json +150 -0
@@ -0,0 +1,269 @@
1
+ import { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';
2
+ import { SDK_VERSION, getClient, handleCallbackErrors, addNonEnumerableProperty, getActiveSpan, _INTERNAL_getSpanContextForToolCallId, withScope, captureException, _INTERNAL_cleanupToolCallSpanContext } from '@sentry/core';
3
+ import { INTEGRATION_NAME } from './constants.js';
4
+
5
+ const SUPPORTED_VERSIONS = ['>=3.0.0 <7'];
6
+
7
+ // List of patched methods
8
+ // From: https://sdk.vercel.ai/docs/ai-sdk-core/telemetry#collected-data
9
+ const INSTRUMENTED_METHODS = [
10
+ 'generateText',
11
+ 'streamText',
12
+ 'generateObject',
13
+ 'streamObject',
14
+ 'embed',
15
+ 'embedMany',
16
+ 'rerank',
17
+ ] ;
18
+
19
+ function isToolError(obj) {
20
+ if (typeof obj !== 'object' || obj === null) {
21
+ return false;
22
+ }
23
+
24
+ const candidate = obj ;
25
+ return (
26
+ 'type' in candidate &&
27
+ 'error' in candidate &&
28
+ 'toolName' in candidate &&
29
+ 'toolCallId' in candidate &&
30
+ candidate.type === 'tool-error' &&
31
+ candidate.error instanceof Error
32
+ );
33
+ }
34
+
35
+ /**
36
+ * Process tool call results: capture tool errors and clean up span context mappings.
37
+ *
38
+ * Error checking runs first (needs span context for linking), then cleanup removes all entries.
39
+ * Tool errors are not rejected in Vercel AI V5 — they appear as metadata in the result content.
40
+ */
41
+ function processToolCallResults(result) {
42
+ if (typeof result !== 'object' || result === null || !('content' in result)) {
43
+ return;
44
+ }
45
+
46
+ const resultObj = result ;
47
+ if (!Array.isArray(resultObj.content)) {
48
+ return;
49
+ }
50
+
51
+ captureToolErrors(resultObj.content);
52
+ cleanupToolCallSpanContexts(resultObj.content);
53
+ }
54
+
55
+ function captureToolErrors(content) {
56
+ for (const item of content) {
57
+ if (!isToolError(item)) {
58
+ continue;
59
+ }
60
+
61
+ // Try to get the span context associated with this tool call ID
62
+ const spanContext = _INTERNAL_getSpanContextForToolCallId(item.toolCallId);
63
+
64
+ if (spanContext) {
65
+ // We have the span context, so link the error using span and trace IDs
66
+ withScope(scope => {
67
+ scope.setContext('trace', {
68
+ trace_id: spanContext.traceId,
69
+ span_id: spanContext.spanId,
70
+ });
71
+
72
+ scope.setTag('vercel.ai.tool.name', item.toolName);
73
+ scope.setTag('vercel.ai.tool.callId', item.toolCallId);
74
+ scope.setLevel('error');
75
+
76
+ captureException(item.error, {
77
+ mechanism: {
78
+ type: 'auto.vercelai.otel',
79
+ handled: false,
80
+ },
81
+ });
82
+ });
83
+ } else {
84
+ // Fallback: capture without span linking
85
+ withScope(scope => {
86
+ scope.setTag('vercel.ai.tool.name', item.toolName);
87
+ scope.setTag('vercel.ai.tool.callId', item.toolCallId);
88
+ scope.setLevel('error');
89
+
90
+ captureException(item.error, {
91
+ mechanism: {
92
+ type: 'auto.vercelai.otel',
93
+ handled: false,
94
+ },
95
+ });
96
+ });
97
+ }
98
+ }
99
+ }
100
+
101
+ /**
102
+ * Remove span context entries for all completed tool calls in the content array.
103
+ */
104
+ function cleanupToolCallSpanContexts(content) {
105
+ for (const item of content) {
106
+ if (
107
+ typeof item === 'object' &&
108
+ item !== null &&
109
+ 'toolCallId' in item &&
110
+ typeof (item ).toolCallId === 'string'
111
+ ) {
112
+ _INTERNAL_cleanupToolCallSpanContext((item ).toolCallId );
113
+ }
114
+ }
115
+ }
116
+
117
+ /**
118
+ * Determines whether to record inputs and outputs for Vercel AI telemetry based on the configuration hierarchy.
119
+ *
120
+ * The order of precedence is:
121
+ * 1. The vercel ai integration options
122
+ * 2. The experimental_telemetry options in the vercel ai method calls
123
+ * 3. When telemetry is explicitly enabled (isEnabled: true), default to recording
124
+ * 4. Otherwise, use the sendDefaultPii option from client options
125
+ */
126
+ function determineRecordingSettings(
127
+ integrationRecordingOptions,
128
+ methodTelemetryOptions,
129
+ telemetryExplicitlyEnabled,
130
+ defaultRecordingEnabled,
131
+ ) {
132
+ const recordInputs =
133
+ integrationRecordingOptions?.recordInputs !== undefined
134
+ ? integrationRecordingOptions.recordInputs
135
+ : methodTelemetryOptions.recordInputs !== undefined
136
+ ? methodTelemetryOptions.recordInputs
137
+ : telemetryExplicitlyEnabled === true
138
+ ? true // When telemetry is explicitly enabled, default to recording inputs
139
+ : defaultRecordingEnabled;
140
+
141
+ const recordOutputs =
142
+ integrationRecordingOptions?.recordOutputs !== undefined
143
+ ? integrationRecordingOptions.recordOutputs
144
+ : methodTelemetryOptions.recordOutputs !== undefined
145
+ ? methodTelemetryOptions.recordOutputs
146
+ : telemetryExplicitlyEnabled === true
147
+ ? true // When telemetry is explicitly enabled, default to recording inputs
148
+ : defaultRecordingEnabled;
149
+
150
+ return { recordInputs, recordOutputs };
151
+ }
152
+
153
+ /**
154
+ * This detects is added by the Sentry Vercel AI Integration to detect if the integration should
155
+ * be enabled.
156
+ *
157
+ * It also patches the `ai` module to enable Vercel AI telemetry automatically for all methods.
158
+ */
159
+ class SentryVercelAiInstrumentation extends InstrumentationBase {
160
+ __init() {this._isPatched = false;}
161
+ __init2() {this._callbacks = [];}
162
+
163
+ constructor(config = {}) {
164
+ super('@sentry/instrumentation-vercel-ai', SDK_VERSION, config);SentryVercelAiInstrumentation.prototype.__init.call(this);SentryVercelAiInstrumentation.prototype.__init2.call(this); }
165
+
166
+ /**
167
+ * Initializes the instrumentation by defining the modules to be patched.
168
+ */
169
+ init() {
170
+ const module = new InstrumentationNodeModuleDefinition('ai', SUPPORTED_VERSIONS, this._patch.bind(this));
171
+ return module;
172
+ }
173
+
174
+ /**
175
+ * Call the provided callback when the module is patched.
176
+ * If it has already been patched, the callback will be called immediately.
177
+ */
178
+ callWhenPatched(callback) {
179
+ if (this._isPatched) {
180
+ callback();
181
+ } else {
182
+ this._callbacks.push(callback);
183
+ }
184
+ }
185
+
186
+ /**
187
+ * Patches module exports to enable Vercel AI telemetry.
188
+ */
189
+ _patch(moduleExports) {
190
+ this._isPatched = true;
191
+
192
+ this._callbacks.forEach(callback => callback());
193
+ this._callbacks = [];
194
+
195
+ const generatePatch = (originalMethod) => {
196
+ return new Proxy(originalMethod, {
197
+ apply: (target, thisArg, args) => {
198
+ const existingExperimentalTelemetry = args[0].experimental_telemetry || {};
199
+ const isEnabled = existingExperimentalTelemetry.isEnabled;
200
+
201
+ const client = getClient();
202
+ const integration = client?.getIntegrationByName(INTEGRATION_NAME);
203
+ const integrationOptions = integration?.options;
204
+ const shouldRecordInputsAndOutputs = integration ? Boolean(client?.getOptions().sendDefaultPii) : false;
205
+
206
+ const { recordInputs, recordOutputs } = determineRecordingSettings(
207
+ integrationOptions,
208
+ existingExperimentalTelemetry,
209
+ isEnabled,
210
+ shouldRecordInputsAndOutputs,
211
+ );
212
+
213
+ args[0].experimental_telemetry = {
214
+ ...existingExperimentalTelemetry,
215
+ isEnabled: isEnabled !== undefined ? isEnabled : true,
216
+ recordInputs,
217
+ recordOutputs,
218
+ };
219
+
220
+ return handleCallbackErrors(
221
+ () => Reflect.apply(target, thisArg, args),
222
+ error => {
223
+ // This error bubbles up to unhandledrejection handler (if not handled before),
224
+ // where we do not know the active span anymore
225
+ // So to circumvent this, we set the active span on the error object
226
+ // which is picked up by the unhandledrejection handler
227
+ if (error && typeof error === 'object') {
228
+ addNonEnumerableProperty(error, '_sentry_active_span', getActiveSpan());
229
+ }
230
+ },
231
+ () => {},
232
+ result => {
233
+ processToolCallResults(result);
234
+ },
235
+ );
236
+ },
237
+ });
238
+ };
239
+
240
+ // Is this an ESM module?
241
+ // https://tc39.es/ecma262/#sec-module-namespace-objects
242
+ if (Object.prototype.toString.call(moduleExports) === '[object Module]') {
243
+ // In ESM we take the usual route and just replace the exports we want to instrument
244
+ for (const method of INSTRUMENTED_METHODS) {
245
+ // Skip methods that don't exist in this version of the AI SDK (e.g., rerank was added in v6)
246
+ if (moduleExports[method] != null) {
247
+ moduleExports[method] = generatePatch(moduleExports[method]);
248
+ }
249
+ }
250
+
251
+ return moduleExports;
252
+ } else {
253
+ // In CJS we can't replace the exports in the original module because they
254
+ // don't have setters, so we create a new object with the same properties
255
+ const patchedModuleExports = INSTRUMENTED_METHODS.reduce((acc, curr) => {
256
+ // Skip methods that don't exist in this version of the AI SDK (e.g., rerank was added in v6)
257
+ if (moduleExports[curr] != null) {
258
+ acc[curr] = generatePatch(moduleExports[curr]);
259
+ }
260
+ return acc;
261
+ }, {} );
262
+
263
+ return { ...moduleExports, ...patchedModuleExports };
264
+ }
265
+ }
266
+ }
267
+
268
+ export { SentryVercelAiInstrumentation, cleanupToolCallSpanContexts, determineRecordingSettings, processToolCallResults };
269
+ //# sourceMappingURL=instrumentation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instrumentation.js","sources":["../../../../../src/integrations/tracing/vercelai/instrumentation.ts"],"sourcesContent":["import type { InstrumentationConfig, InstrumentationModuleDefinition } from '@opentelemetry/instrumentation';\nimport { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';\nimport {\n _INTERNAL_cleanupToolCallSpanContext,\n _INTERNAL_getSpanContextForToolCallId,\n addNonEnumerableProperty,\n captureException,\n getActiveSpan,\n getClient,\n handleCallbackErrors,\n SDK_VERSION,\n withScope,\n} from '@sentry/core';\nimport { INTEGRATION_NAME } from './constants';\nimport type { TelemetrySettings, VercelAiIntegration } from './types';\n\nconst SUPPORTED_VERSIONS = ['>=3.0.0 <7'];\n\n// List of patched methods\n// From: https://sdk.vercel.ai/docs/ai-sdk-core/telemetry#collected-data\nconst INSTRUMENTED_METHODS = [\n 'generateText',\n 'streamText',\n 'generateObject',\n 'streamObject',\n 'embed',\n 'embedMany',\n 'rerank',\n] as const;\n\ninterface MethodFirstArg extends Record<string, unknown> {\n experimental_telemetry?: TelemetrySettings;\n}\n\ntype MethodArgs = [MethodFirstArg, ...unknown[]];\n\ntype PatchedModuleExports = Record<(typeof INSTRUMENTED_METHODS)[number], (...args: MethodArgs) => unknown> &\n Record<string, unknown>;\n\ninterface RecordingOptions {\n recordInputs?: boolean;\n recordOutputs?: boolean;\n}\n\ninterface ToolError {\n type: 'tool-error' | 'tool-result' | 'tool-call';\n toolCallId: string;\n toolName: string;\n input?: {\n [key: string]: unknown;\n };\n error: Error;\n dynamic?: boolean;\n}\n\nfunction isToolError(obj: unknown): obj is ToolError {\n if (typeof obj !== 'object' || obj === null) {\n return false;\n }\n\n const candidate = obj as Record<string, unknown>;\n return (\n 'type' in candidate &&\n 'error' in candidate &&\n 'toolName' in candidate &&\n 'toolCallId' in candidate &&\n candidate.type === 'tool-error' &&\n candidate.error instanceof Error\n );\n}\n\n/**\n * Process tool call results: capture tool errors and clean up span context mappings.\n *\n * Error checking runs first (needs span context for linking), then cleanup removes all entries.\n * Tool errors are not rejected in Vercel AI V5 — they appear as metadata in the result content.\n */\nexport function processToolCallResults(result: unknown): void {\n if (typeof result !== 'object' || result === null || !('content' in result)) {\n return;\n }\n\n const resultObj = result as { content: Array<object> };\n if (!Array.isArray(resultObj.content)) {\n return;\n }\n\n captureToolErrors(resultObj.content);\n cleanupToolCallSpanContexts(resultObj.content);\n}\n\nfunction captureToolErrors(content: Array<object>): void {\n for (const item of content) {\n if (!isToolError(item)) {\n continue;\n }\n\n // Try to get the span context associated with this tool call ID\n const spanContext = _INTERNAL_getSpanContextForToolCallId(item.toolCallId);\n\n if (spanContext) {\n // We have the span context, so link the error using span and trace IDs\n withScope(scope => {\n scope.setContext('trace', {\n trace_id: spanContext.traceId,\n span_id: spanContext.spanId,\n });\n\n scope.setTag('vercel.ai.tool.name', item.toolName);\n scope.setTag('vercel.ai.tool.callId', item.toolCallId);\n scope.setLevel('error');\n\n captureException(item.error, {\n mechanism: {\n type: 'auto.vercelai.otel',\n handled: false,\n },\n });\n });\n } else {\n // Fallback: capture without span linking\n withScope(scope => {\n scope.setTag('vercel.ai.tool.name', item.toolName);\n scope.setTag('vercel.ai.tool.callId', item.toolCallId);\n scope.setLevel('error');\n\n captureException(item.error, {\n mechanism: {\n type: 'auto.vercelai.otel',\n handled: false,\n },\n });\n });\n }\n }\n}\n\n/**\n * Remove span context entries for all completed tool calls in the content array.\n */\nexport function cleanupToolCallSpanContexts(content: Array<object>): void {\n for (const item of content) {\n if (\n typeof item === 'object' &&\n item !== null &&\n 'toolCallId' in item &&\n typeof (item as Record<string, unknown>).toolCallId === 'string'\n ) {\n _INTERNAL_cleanupToolCallSpanContext((item as Record<string, unknown>).toolCallId as string);\n }\n }\n}\n\n/**\n * Determines whether to record inputs and outputs for Vercel AI telemetry based on the configuration hierarchy.\n *\n * The order of precedence is:\n * 1. The vercel ai integration options\n * 2. The experimental_telemetry options in the vercel ai method calls\n * 3. When telemetry is explicitly enabled (isEnabled: true), default to recording\n * 4. Otherwise, use the sendDefaultPii option from client options\n */\nexport function determineRecordingSettings(\n integrationRecordingOptions: RecordingOptions | undefined,\n methodTelemetryOptions: RecordingOptions,\n telemetryExplicitlyEnabled: boolean | undefined,\n defaultRecordingEnabled: boolean,\n): { recordInputs: boolean; recordOutputs: boolean } {\n const recordInputs =\n integrationRecordingOptions?.recordInputs !== undefined\n ? integrationRecordingOptions.recordInputs\n : methodTelemetryOptions.recordInputs !== undefined\n ? methodTelemetryOptions.recordInputs\n : telemetryExplicitlyEnabled === true\n ? true // When telemetry is explicitly enabled, default to recording inputs\n : defaultRecordingEnabled;\n\n const recordOutputs =\n integrationRecordingOptions?.recordOutputs !== undefined\n ? integrationRecordingOptions.recordOutputs\n : methodTelemetryOptions.recordOutputs !== undefined\n ? methodTelemetryOptions.recordOutputs\n : telemetryExplicitlyEnabled === true\n ? true // When telemetry is explicitly enabled, default to recording inputs\n : defaultRecordingEnabled;\n\n return { recordInputs, recordOutputs };\n}\n\n/**\n * This detects is added by the Sentry Vercel AI Integration to detect if the integration should\n * be enabled.\n *\n * It also patches the `ai` module to enable Vercel AI telemetry automatically for all methods.\n */\nexport class SentryVercelAiInstrumentation extends InstrumentationBase {\n private _isPatched = false;\n private _callbacks: (() => void)[] = [];\n\n public constructor(config: InstrumentationConfig = {}) {\n super('@sentry/instrumentation-vercel-ai', SDK_VERSION, config);\n }\n\n /**\n * Initializes the instrumentation by defining the modules to be patched.\n */\n public init(): InstrumentationModuleDefinition {\n const module = new InstrumentationNodeModuleDefinition('ai', SUPPORTED_VERSIONS, this._patch.bind(this));\n return module;\n }\n\n /**\n * Call the provided callback when the module is patched.\n * If it has already been patched, the callback will be called immediately.\n */\n public callWhenPatched(callback: () => void): void {\n if (this._isPatched) {\n callback();\n } else {\n this._callbacks.push(callback);\n }\n }\n\n /**\n * Patches module exports to enable Vercel AI telemetry.\n */\n private _patch(moduleExports: PatchedModuleExports): unknown {\n this._isPatched = true;\n\n this._callbacks.forEach(callback => callback());\n this._callbacks = [];\n\n const generatePatch = <T extends (...args: MethodArgs) => unknown>(originalMethod: T): T => {\n return new Proxy(originalMethod, {\n apply: (target, thisArg, args: MethodArgs) => {\n const existingExperimentalTelemetry = args[0].experimental_telemetry || {};\n const isEnabled = existingExperimentalTelemetry.isEnabled;\n\n const client = getClient();\n const integration = client?.getIntegrationByName<VercelAiIntegration>(INTEGRATION_NAME);\n const integrationOptions = integration?.options;\n const shouldRecordInputsAndOutputs = integration ? Boolean(client?.getOptions().sendDefaultPii) : false;\n\n const { recordInputs, recordOutputs } = determineRecordingSettings(\n integrationOptions,\n existingExperimentalTelemetry,\n isEnabled,\n shouldRecordInputsAndOutputs,\n );\n\n args[0].experimental_telemetry = {\n ...existingExperimentalTelemetry,\n isEnabled: isEnabled !== undefined ? isEnabled : true,\n recordInputs,\n recordOutputs,\n };\n\n return handleCallbackErrors(\n () => Reflect.apply(target, thisArg, args),\n error => {\n // This error bubbles up to unhandledrejection handler (if not handled before),\n // where we do not know the active span anymore\n // So to circumvent this, we set the active span on the error object\n // which is picked up by the unhandledrejection handler\n if (error && typeof error === 'object') {\n addNonEnumerableProperty(error, '_sentry_active_span', getActiveSpan());\n }\n },\n () => {},\n result => {\n processToolCallResults(result);\n },\n );\n },\n });\n };\n\n // Is this an ESM module?\n // https://tc39.es/ecma262/#sec-module-namespace-objects\n if (Object.prototype.toString.call(moduleExports) === '[object Module]') {\n // In ESM we take the usual route and just replace the exports we want to instrument\n for (const method of INSTRUMENTED_METHODS) {\n // Skip methods that don't exist in this version of the AI SDK (e.g., rerank was added in v6)\n if (moduleExports[method] != null) {\n moduleExports[method] = generatePatch(moduleExports[method]);\n }\n }\n\n return moduleExports;\n } else {\n // In CJS we can't replace the exports in the original module because they\n // don't have setters, so we create a new object with the same properties\n const patchedModuleExports = INSTRUMENTED_METHODS.reduce((acc, curr) => {\n // Skip methods that don't exist in this version of the AI SDK (e.g., rerank was added in v6)\n if (moduleExports[curr] != null) {\n acc[curr] = generatePatch(moduleExports[curr]);\n }\n return acc;\n }, {} as PatchedModuleExports);\n\n return { ...moduleExports, ...patchedModuleExports };\n }\n }\n}\n"],"names":[],"mappings":";;;;AAgBA,MAAM,kBAAA,GAAqB,CAAC,YAAY,CAAC;;AAEzC;AACA;AACA,MAAM,uBAAuB;AAC7B,EAAE,cAAc;AAChB,EAAE,YAAY;AACd,EAAE,gBAAgB;AAClB,EAAE,cAAc;AAChB,EAAE,OAAO;AACT,EAAE,WAAW;AACb,EAAE,QAAQ;AACV,CAAA;;AA2BA,SAAS,WAAW,CAAC,GAAG,EAA6B;AACrD,EAAE,IAAI,OAAO,GAAA,KAAQ,YAAY,GAAA,KAAQ,IAAI,EAAE;AAC/C,IAAI,OAAO,KAAK;AAChB,EAAE;;AAEF,EAAE,MAAM,SAAA,GAAY,GAAA;AACpB,EAAE;AACF,IAAI,MAAA,IAAU,SAAA;AACd,IAAI,OAAA,IAAW,SAAA;AACf,IAAI,UAAA,IAAc,SAAA;AAClB,IAAI,YAAA,IAAgB,SAAA;AACpB,IAAI,SAAS,CAAC,IAAA,KAAS,YAAA;AACvB,IAAI,SAAS,CAAC,KAAA,YAAiB;AAC/B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,sBAAsB,CAAC,MAAM,EAAiB;AAC9D,EAAE,IAAI,OAAO,MAAA,KAAW,YAAY,MAAA,KAAW,IAAA,IAAQ,EAAE,aAAa,MAAM,CAAC,EAAE;AAC/E,IAAI;AACJ,EAAE;;AAEF,EAAE,MAAM,SAAA,GAAY,MAAA;AACpB,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE;AACzC,IAAI;AACJ,EAAE;;AAEF,EAAE,iBAAiB,CAAC,SAAS,CAAC,OAAO,CAAC;AACtC,EAAE,2BAA2B,CAAC,SAAS,CAAC,OAAO,CAAC;AAChD;;AAEA,SAAS,iBAAiB,CAAC,OAAO,EAAuB;A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E;AACA,MAAM,KAAK,MAAM,MAAA,IAAU,oBAAoB,EAAE;AACjD;AACA,QAAQ,IAAI,aAAa,CAAC,MAAM,CAAA,IAAK,IAAI,EAAE;AAC3C,UAAU,aAAa,CAAC,MAAM,CAAA,GAAI,aAAa,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;AACtE,QAAQ;AACR,MAAM;;AAEN,MAAM,OAAO,aAAa;AAC1B,IAAI,OAAO;AACX;AACA;AACA,MAAM,MAAM,oBAAA,GAAuB,oBAAoB,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,KAAK;AAC9E;AACA,QAAQ,IAAI,aAAa,CAAC,IAAI,CAAA,IAAK,IAAI,EAAE;AACzC,UAAU,GAAG,CAAC,IAAI,CAAA,GAAI,aAAa,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;AACxD,QAAQ;AACR,QAAQ,OAAO,GAAG;AAClB,MAAM,CAAC,EAAE,EAAC,EAA0B;;AAEpC,MAAM,OAAO,EAAE,GAAG,aAAa,EAAE,GAAG,sBAAsB;AAC1D,IAAI;AACJ,EAAE;AACF;;;;"}
@@ -0,0 +1 @@
1
+ {"type":"module","version":"10.44.0","sideEffects":false}
@@ -0,0 +1,21 @@
1
+ import { envToBool } from '@sentry/node-core';
2
+ import { preloadOpenTelemetry } from './sdk/initOtel.js';
3
+
4
+ const debug = envToBool(process.env.SENTRY_DEBUG);
5
+ const integrationsStr = process.env.SENTRY_PRELOAD_INTEGRATIONS;
6
+
7
+ const integrations = integrationsStr ? integrationsStr.split(',').map(integration => integration.trim()) : undefined;
8
+
9
+ /**
10
+ * The @sentry/node/preload export can be used with the node --import and --require args to preload the OTEL
11
+ * instrumentation, without initializing the Sentry SDK.
12
+ *
13
+ * This is useful if you cannot initialize the SDK immediately, but still want to preload the instrumentation,
14
+ * e.g. if you have to load the DSN from somewhere else.
15
+ *
16
+ * You can configure this in two ways via environment variables:
17
+ * - `SENTRY_DEBUG` to enable debug logging
18
+ * - `SENTRY_PRELOAD_INTEGRATIONS` to preload specific integrations - e.g. `SENTRY_PRELOAD_INTEGRATIONS="Http,Express"`
19
+ */
20
+ preloadOpenTelemetry({ debug, integrations });
21
+ //# sourceMappingURL=preload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preload.js","sources":["../../src/preload.ts"],"sourcesContent":["import { envToBool } from '@sentry/node-core';\nimport { preloadOpenTelemetry } from './sdk/initOtel';\n\nconst debug = envToBool(process.env.SENTRY_DEBUG);\nconst integrationsStr = process.env.SENTRY_PRELOAD_INTEGRATIONS;\n\nconst integrations = integrationsStr ? integrationsStr.split(',').map(integration => integration.trim()) : undefined;\n\n/**\n * The @sentry/node/preload export can be used with the node --import and --require args to preload the OTEL\n * instrumentation, without initializing the Sentry SDK.\n *\n * This is useful if you cannot initialize the SDK immediately, but still want to preload the instrumentation,\n * e.g. if you have to load the DSN from somewhere else.\n *\n * You can configure this in two ways via environment variables:\n * - `SENTRY_DEBUG` to enable debug logging\n * - `SENTRY_PRELOAD_INTEGRATIONS` to preload specific integrations - e.g. `SENTRY_PRELOAD_INTEGRATIONS=\"Http,Express\"`\n */\npreloadOpenTelemetry({ debug, integrations });\n"],"names":[],"mappings":";;;AAGA,MAAM,KAAA,GAAQ,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;AACjD,MAAM,kBAAkB,OAAO,CAAC,GAAG,CAAC,2BAA2B;;AAE/D,MAAM,YAAA,GAAe,eAAA,GAAkB,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,WAAA,IAAe,WAAW,CAAC,IAAI,EAAE,CAAA,GAAI,SAAS;;AAEpH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,CAAC,EAAE,KAAK,EAAE,YAAA,EAAc,CAAC"}
@@ -0,0 +1,73 @@
1
+ import { applySdkMetadata, hasSpansEnabled } from '@sentry/core';
2
+ import { init as init$1, validateOpenTelemetrySetup, getDefaultIntegrations as getDefaultIntegrations$1 } from '@sentry/node-core';
3
+ import { httpIntegration } from '../integrations/http.js';
4
+ import { nativeNodeFetchIntegration } from '../integrations/node-fetch.js';
5
+ import { getAutoPerformanceIntegrations } from '../integrations/tracing/index.js';
6
+ import { initOpenTelemetry } from './initOtel.js';
7
+
8
+ /**
9
+ * Get default integrations, excluding performance.
10
+ */
11
+ function getDefaultIntegrationsWithoutPerformance() {
12
+ const nodeCoreIntegrations = getDefaultIntegrations$1();
13
+
14
+ // Filter out the node-core HTTP and NodeFetch integrations and replace them with Node SDK's composite versions
15
+ return nodeCoreIntegrations
16
+ .filter(integration => integration.name !== 'Http' && integration.name !== 'NodeFetch')
17
+ .concat(httpIntegration(), nativeNodeFetchIntegration());
18
+ }
19
+
20
+ /** Get the default integrations for the Node SDK. */
21
+ function getDefaultIntegrations(options) {
22
+ return [
23
+ ...getDefaultIntegrationsWithoutPerformance(),
24
+ // We only add performance integrations if tracing is enabled
25
+ // Note that this means that without tracing enabled, e.g. `expressIntegration()` will not be added
26
+ // This means that generally request isolation will work (because that is done by httpIntegration)
27
+ // But `transactionName` will not be set automatically
28
+ ...(hasSpansEnabled(options) ? getAutoPerformanceIntegrations() : []),
29
+ ];
30
+ }
31
+
32
+ /**
33
+ * Initialize Sentry for Node.
34
+ */
35
+ function init(options = {}) {
36
+ return _init(options, getDefaultIntegrations);
37
+ }
38
+
39
+ /**
40
+ * Internal initialization function.
41
+ */
42
+ function _init(
43
+ options = {},
44
+ getDefaultIntegrationsImpl,
45
+ ) {
46
+ applySdkMetadata(options, 'node');
47
+
48
+ const client = init$1({
49
+ ...options,
50
+ // Only use Node SDK defaults if none provided
51
+ defaultIntegrations: options.defaultIntegrations ?? getDefaultIntegrationsImpl(options),
52
+ });
53
+
54
+ // Add Node SDK specific OpenTelemetry setup
55
+ if (client && !options.skipOpenTelemetrySetup) {
56
+ initOpenTelemetry(client, {
57
+ spanProcessors: options.openTelemetrySpanProcessors,
58
+ });
59
+ validateOpenTelemetrySetup();
60
+ }
61
+
62
+ return client;
63
+ }
64
+
65
+ /**
66
+ * Initialize Sentry for Node, without any integrations added by default.
67
+ */
68
+ function initWithoutDefaultIntegrations(options = {}) {
69
+ return _init(options, () => []);
70
+ }
71
+
72
+ export { getDefaultIntegrations, getDefaultIntegrationsWithoutPerformance, init, initWithoutDefaultIntegrations };
73
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/sdk/index.ts"],"sourcesContent":["import type { Integration, Options } from '@sentry/core';\nimport { applySdkMetadata, hasSpansEnabled } from '@sentry/core';\nimport type { NodeClient } from '@sentry/node-core';\nimport {\n getDefaultIntegrations as getNodeCoreDefaultIntegrations,\n init as initNodeCore,\n validateOpenTelemetrySetup,\n} from '@sentry/node-core';\nimport { httpIntegration } from '../integrations/http';\nimport { nativeNodeFetchIntegration } from '../integrations/node-fetch';\nimport { getAutoPerformanceIntegrations } from '../integrations/tracing';\nimport type { NodeOptions } from '../types';\nimport { initOpenTelemetry } from './initOtel';\n\n/**\n * Get default integrations, excluding performance.\n */\nexport function getDefaultIntegrationsWithoutPerformance(): Integration[] {\n const nodeCoreIntegrations = getNodeCoreDefaultIntegrations();\n\n // Filter out the node-core HTTP and NodeFetch integrations and replace them with Node SDK's composite versions\n return nodeCoreIntegrations\n .filter(integration => integration.name !== 'Http' && integration.name !== 'NodeFetch')\n .concat(httpIntegration(), nativeNodeFetchIntegration());\n}\n\n/** Get the default integrations for the Node SDK. */\nexport function getDefaultIntegrations(options: Options): Integration[] {\n return [\n ...getDefaultIntegrationsWithoutPerformance(),\n // We only add performance integrations if tracing is enabled\n // Note that this means that without tracing enabled, e.g. `expressIntegration()` will not be added\n // This means that generally request isolation will work (because that is done by httpIntegration)\n // But `transactionName` will not be set automatically\n ...(hasSpansEnabled(options) ? getAutoPerformanceIntegrations() : []),\n ];\n}\n\n/**\n * Initialize Sentry for Node.\n */\nexport function init(options: NodeOptions | undefined = {}): NodeClient | undefined {\n return _init(options, getDefaultIntegrations);\n}\n\n/**\n * Internal initialization function.\n */\nfunction _init(\n options: NodeOptions | undefined = {},\n getDefaultIntegrationsImpl: (options: Options) => Integration[],\n): NodeClient | undefined {\n applySdkMetadata(options, 'node');\n\n const client = initNodeCore({\n ...options,\n // Only use Node SDK defaults if none provided\n defaultIntegrations: options.defaultIntegrations ?? getDefaultIntegrationsImpl(options),\n });\n\n // Add Node SDK specific OpenTelemetry setup\n if (client && !options.skipOpenTelemetrySetup) {\n initOpenTelemetry(client, {\n spanProcessors: options.openTelemetrySpanProcessors,\n });\n validateOpenTelemetrySetup();\n }\n\n return client;\n}\n\n/**\n * Initialize Sentry for Node, without any integrations added by default.\n */\nexport function initWithoutDefaultIntegrations(options: NodeOptions | undefined = {}): NodeClient | undefined {\n return _init(options, () => []);\n}\n"],"names":["getNodeCoreDefaultIntegrations","initNodeCore"],"mappings":";;;;;;;AAcA;AACA;AACA;AACO,SAAS,wCAAwC,GAAkB;AAC1E,EAAE,MAAM,oBAAA,GAAuBA,wBAA8B,EAAE;;AAE/D;AACA,EAAE,OAAO;AACT,KAAK,MAAM,CAAC,WAAA,IAAe,WAAW,CAAC,IAAA,KAAS,UAAU,WAAW,CAAC,IAAA,KAAS,WAAW;AAC1F,KAAK,MAAM,CAAC,eAAe,EAAE,EAAE,0BAA0B,EAAE,CAAC;AAC5D;;AAEA;AACO,SAAS,sBAAsB,CAAC,OAAO,EAA0B;AACxE,EAAE,OAAO;AACT,IAAI,GAAG,wCAAwC,EAAE;AACjD;AACA;AACA;AACA;AACA,IAAI,IAAI,eAAe,CAAC,OAAO,CAAA,GAAI,8BAA8B,EAAC,GAAI,EAAE,CAAC;AACzE,GAAG;AACH;;AAEA;AACA;AACA;AACO,SAAS,IAAI,CAAC,OAAO,GAA4B,EAAE,EAA0B;AACpF,EAAE,OAAO,KAAK,CAAC,OAAO,EAAE,sBAAsB,CAAC;AAC/C;;AAEA;AACA;AACA;AACA,SAAS,KAAK;AACd,EAAE,OAAO,GAA4B,EAAE;AACvC,EAAE,0BAA0B;AAC5B,EAA0B;AAC1B,EAAE,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC;;AAEnC,EAAE,MAAM,MAAA,GAASC,MAAY,CAAC;AAC9B,IAAI,GAAG,OAAO;AACd;AACA,IAAI,mBAAmB,EAAE,OAAO,CAAC,uBAAuB,0BAA0B,CAAC,OAAO,CAAC;AAC3F,GAAG,CAAC;;AAEJ;AACA,EAAE,IAAI,MAAA,IAAU,CAAC,OAAO,CAAC,sBAAsB,EAAE;AACjD,IAAI,iBAAiB,CAAC,MAAM,EAAE;AAC9B,MAAM,cAAc,EAAE,OAAO,CAAC,2BAA2B;AACzD,KAAK,CAAC;AACN,IAAI,0BAA0B,EAAE;AAChC,EAAE;;AAEF,EAAE,OAAO,MAAM;AACf;;AAEA;AACA;AACA;AACO,SAAS,8BAA8B,CAAC,OAAO,GAA4B,EAAE,EAA0B;AAC9G,EAAE,OAAO,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC;AACjC;;;;"}
@@ -0,0 +1,121 @@
1
+ import { trace, propagation, context } from '@opentelemetry/api';
2
+ import { defaultResource, resourceFromAttributes } from '@opentelemetry/resources';
3
+ import { BasicTracerProvider } from '@opentelemetry/sdk-trace-base';
4
+ import { ATTR_SERVICE_VERSION, SEMRESATTRS_SERVICE_NAMESPACE, ATTR_SERVICE_NAME } from '@opentelemetry/semantic-conventions';
5
+ import { SDK_VERSION, debug } from '@sentry/core';
6
+ import { setupOpenTelemetryLogger, SentryContextManager, initializeEsmLoader } from '@sentry/node-core';
7
+ import { SentrySpanProcessor, SentrySampler, SentryPropagator } from '@sentry/opentelemetry';
8
+ import { DEBUG_BUILD } from '../debug-build.js';
9
+ import { getOpenTelemetryInstrumentationToPreload } from '../integrations/tracing/index.js';
10
+
11
+ // About 277h - this must fit into new Array(len)!
12
+ const MAX_MAX_SPAN_WAIT_DURATION = 1000000;
13
+
14
+ /**
15
+ * Initialize OpenTelemetry for Node.
16
+ */
17
+ function initOpenTelemetry(client, options = {}) {
18
+ if (client.getOptions().debug) {
19
+ setupOpenTelemetryLogger();
20
+ }
21
+
22
+ const [provider, asyncLocalStorageLookup] = setupOtel(client, options);
23
+ client.traceProvider = provider;
24
+ client.asyncLocalStorageLookup = asyncLocalStorageLookup;
25
+ }
26
+
27
+ /**
28
+ * Preload OpenTelemetry for Node.
29
+ * This can be used to preload instrumentation early, but set up Sentry later.
30
+ * By preloading the OTEL instrumentation wrapping still happens early enough that everything works.
31
+ */
32
+ function preloadOpenTelemetry(options = {}) {
33
+ const { debug: debug$1 } = options;
34
+
35
+ if (debug$1) {
36
+ debug.enable();
37
+ }
38
+
39
+ initializeEsmLoader();
40
+
41
+ // These are all integrations that we need to pre-load to ensure they are set up before any other code runs
42
+ getPreloadMethods(options.integrations).forEach(fn => {
43
+ fn();
44
+
45
+ if (debug$1) {
46
+ debug.log(`[Sentry] Preloaded ${fn.id} instrumentation`);
47
+ }
48
+ });
49
+ }
50
+
51
+ function getPreloadMethods(integrationNames) {
52
+ const instruments = getOpenTelemetryInstrumentationToPreload();
53
+
54
+ if (!integrationNames) {
55
+ return instruments;
56
+ }
57
+
58
+ // We match exact matches of instrumentation, but also match prefixes, e.g. "Fastify.v5" will match "Fastify"
59
+ return instruments.filter(instrumentation => {
60
+ const id = instrumentation.id;
61
+ return integrationNames.some(integrationName => id === integrationName || id.startsWith(`${integrationName}.`));
62
+ });
63
+ }
64
+
65
+ /** Just exported for tests. */
66
+ function setupOtel(
67
+ client,
68
+ options = {},
69
+ ) {
70
+ // Create and configure NodeTracerProvider
71
+ const provider = new BasicTracerProvider({
72
+ sampler: new SentrySampler(client),
73
+ resource: defaultResource().merge(
74
+ resourceFromAttributes({
75
+ [ATTR_SERVICE_NAME]: 'node',
76
+ // eslint-disable-next-line deprecation/deprecation
77
+ [SEMRESATTRS_SERVICE_NAMESPACE]: 'sentry',
78
+ [ATTR_SERVICE_VERSION]: SDK_VERSION,
79
+ }),
80
+ ),
81
+ forceFlushTimeoutMillis: 500,
82
+ spanProcessors: [
83
+ new SentrySpanProcessor({
84
+ timeout: _clampSpanProcessorTimeout(client.getOptions().maxSpanWaitDuration),
85
+ }),
86
+ ...(options.spanProcessors || []),
87
+ ],
88
+ });
89
+
90
+ // Register as globals
91
+ trace.setGlobalTracerProvider(provider);
92
+ propagation.setGlobalPropagator(new SentryPropagator());
93
+
94
+ const ctxManager = new SentryContextManager();
95
+ context.setGlobalContextManager(ctxManager);
96
+
97
+ return [provider, ctxManager.getAsyncLocalStorageLookup()];
98
+ }
99
+
100
+ /** Just exported for tests. */
101
+ function _clampSpanProcessorTimeout(maxSpanWaitDuration) {
102
+ if (maxSpanWaitDuration == null) {
103
+ return undefined;
104
+ }
105
+
106
+ // We guard for a max. value here, because we create an array with this length
107
+ // So if this value is too large, this would fail
108
+ if (maxSpanWaitDuration > MAX_MAX_SPAN_WAIT_DURATION) {
109
+ DEBUG_BUILD &&
110
+ debug.warn(`\`maxSpanWaitDuration\` is too high, using the maximum value of ${MAX_MAX_SPAN_WAIT_DURATION}`);
111
+ return MAX_MAX_SPAN_WAIT_DURATION;
112
+ } else if (maxSpanWaitDuration <= 0 || Number.isNaN(maxSpanWaitDuration)) {
113
+ DEBUG_BUILD && debug.warn('`maxSpanWaitDuration` must be a positive number, using default value instead.');
114
+ return undefined;
115
+ }
116
+
117
+ return maxSpanWaitDuration;
118
+ }
119
+
120
+ export { _clampSpanProcessorTimeout, initOpenTelemetry, preloadOpenTelemetry, setupOtel };
121
+ //# sourceMappingURL=initOtel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"initOtel.js","sources":["../../../src/sdk/initOtel.ts"],"sourcesContent":["import { context, propagation, trace } from '@opentelemetry/api';\nimport { defaultResource, resourceFromAttributes } from '@opentelemetry/resources';\nimport type { SpanProcessor } from '@opentelemetry/sdk-trace-base';\nimport { BasicTracerProvider } from '@opentelemetry/sdk-trace-base';\nimport {\n ATTR_SERVICE_NAME,\n ATTR_SERVICE_VERSION,\n SEMRESATTRS_SERVICE_NAMESPACE,\n} from '@opentelemetry/semantic-conventions';\nimport { debug as coreDebug, SDK_VERSION } from '@sentry/core';\nimport {\n initializeEsmLoader,\n type NodeClient,\n SentryContextManager,\n setupOpenTelemetryLogger,\n} from '@sentry/node-core';\nimport {\n type AsyncLocalStorageLookup,\n SentryPropagator,\n SentrySampler,\n SentrySpanProcessor,\n} from '@sentry/opentelemetry';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { getOpenTelemetryInstrumentationToPreload } from '../integrations/tracing';\n\n// About 277h - this must fit into new Array(len)!\nconst MAX_MAX_SPAN_WAIT_DURATION = 1_000_000;\n\ninterface AdditionalOpenTelemetryOptions {\n /** Additional SpanProcessor instances that should be used. */\n spanProcessors?: SpanProcessor[];\n}\n\n/**\n * Initialize OpenTelemetry for Node.\n */\nexport function initOpenTelemetry(client: NodeClient, options: AdditionalOpenTelemetryOptions = {}): void {\n if (client.getOptions().debug) {\n setupOpenTelemetryLogger();\n }\n\n const [provider, asyncLocalStorageLookup] = setupOtel(client, options);\n client.traceProvider = provider;\n client.asyncLocalStorageLookup = asyncLocalStorageLookup;\n}\n\ninterface NodePreloadOptions {\n debug?: boolean;\n integrations?: string[];\n}\n\n/**\n * Preload OpenTelemetry for Node.\n * This can be used to preload instrumentation early, but set up Sentry later.\n * By preloading the OTEL instrumentation wrapping still happens early enough that everything works.\n */\nexport function preloadOpenTelemetry(options: NodePreloadOptions = {}): void {\n const { debug } = options;\n\n if (debug) {\n coreDebug.enable();\n }\n\n initializeEsmLoader();\n\n // These are all integrations that we need to pre-load to ensure they are set up before any other code runs\n getPreloadMethods(options.integrations).forEach(fn => {\n fn();\n\n if (debug) {\n coreDebug.log(`[Sentry] Preloaded ${fn.id} instrumentation`);\n }\n });\n}\n\nfunction getPreloadMethods(integrationNames?: string[]): ((() => void) & { id: string })[] {\n const instruments = getOpenTelemetryInstrumentationToPreload();\n\n if (!integrationNames) {\n return instruments;\n }\n\n // We match exact matches of instrumentation, but also match prefixes, e.g. \"Fastify.v5\" will match \"Fastify\"\n return instruments.filter(instrumentation => {\n const id = instrumentation.id;\n return integrationNames.some(integrationName => id === integrationName || id.startsWith(`${integrationName}.`));\n });\n}\n\n/** Just exported for tests. */\nexport function setupOtel(\n client: NodeClient,\n options: AdditionalOpenTelemetryOptions = {},\n): [BasicTracerProvider, AsyncLocalStorageLookup] {\n // Create and configure NodeTracerProvider\n const provider = new BasicTracerProvider({\n sampler: new SentrySampler(client),\n resource: defaultResource().merge(\n resourceFromAttributes({\n [ATTR_SERVICE_NAME]: 'node',\n // eslint-disable-next-line deprecation/deprecation\n [SEMRESATTRS_SERVICE_NAMESPACE]: 'sentry',\n [ATTR_SERVICE_VERSION]: SDK_VERSION,\n }),\n ),\n forceFlushTimeoutMillis: 500,\n spanProcessors: [\n new SentrySpanProcessor({\n timeout: _clampSpanProcessorTimeout(client.getOptions().maxSpanWaitDuration),\n }),\n ...(options.spanProcessors || []),\n ],\n });\n\n // Register as globals\n trace.setGlobalTracerProvider(provider);\n propagation.setGlobalPropagator(new SentryPropagator());\n\n const ctxManager = new SentryContextManager();\n context.setGlobalContextManager(ctxManager);\n\n return [provider, ctxManager.getAsyncLocalStorageLookup()];\n}\n\n/** Just exported for tests. */\nexport function _clampSpanProcessorTimeout(maxSpanWaitDuration: number | undefined): number | undefined {\n if (maxSpanWaitDuration == null) {\n return undefined;\n }\n\n // We guard for a max. value here, because we create an array with this length\n // So if this value is too large, this would fail\n if (maxSpanWaitDuration > MAX_MAX_SPAN_WAIT_DURATION) {\n DEBUG_BUILD &&\n coreDebug.warn(`\\`maxSpanWaitDuration\\` is too high, using the maximum value of ${MAX_MAX_SPAN_WAIT_DURATION}`);\n return MAX_MAX_SPAN_WAIT_DURATION;\n } else if (maxSpanWaitDuration <= 0 || Number.isNaN(maxSpanWaitDuration)) {\n DEBUG_BUILD && coreDebug.warn('`maxSpanWaitDuration` must be a positive number, using default value instead.');\n return undefined;\n }\n\n return max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