@sentry/node 9.32.0 → 9.34.0-alpha.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 (524) hide show
  1. package/build/cjs/index.js +50 -56
  2. package/build/cjs/index.js.map +1 -1
  3. package/build/cjs/integrations/featureFlagShims/launchDarkly.js +43 -0
  4. package/build/cjs/integrations/featureFlagShims/launchDarkly.js.map +1 -0
  5. package/build/cjs/integrations/featureFlagShims/openFeature.js +55 -0
  6. package/build/cjs/integrations/featureFlagShims/openFeature.js.map +1 -0
  7. package/build/cjs/integrations/featureFlagShims/statsig.js +23 -0
  8. package/build/cjs/integrations/featureFlagShims/statsig.js.map +1 -0
  9. package/build/cjs/integrations/featureFlagShims/unleash.js +23 -0
  10. package/build/cjs/integrations/featureFlagShims/unleash.js.map +1 -0
  11. package/build/cjs/integrations/fs.js +2 -2
  12. package/build/cjs/integrations/fs.js.map +1 -1
  13. package/build/cjs/integrations/http/index.js +7 -11
  14. package/build/cjs/integrations/http/index.js.map +1 -1
  15. package/build/cjs/integrations/node-fetch/index.js +4 -5
  16. package/build/cjs/integrations/node-fetch/index.js.map +1 -1
  17. package/build/cjs/integrations/tracing/amqplib.js +4 -5
  18. package/build/cjs/integrations/tracing/amqplib.js.map +1 -1
  19. package/build/cjs/integrations/tracing/connect.js +3 -4
  20. package/build/cjs/integrations/tracing/connect.js.map +1 -1
  21. package/build/cjs/integrations/tracing/dataloader.js +3 -3
  22. package/build/cjs/integrations/tracing/dataloader.js.map +1 -1
  23. package/build/cjs/integrations/tracing/express.js +5 -7
  24. package/build/cjs/integrations/tracing/express.js.map +1 -1
  25. package/build/cjs/integrations/tracing/fastify/fastify-otel/index.js +5 -10
  26. package/build/cjs/integrations/tracing/fastify/fastify-otel/index.js.map +1 -1
  27. package/build/cjs/integrations/tracing/fastify/index.js +47 -10
  28. package/build/cjs/integrations/tracing/fastify/index.js.map +1 -1
  29. package/build/cjs/integrations/tracing/genericPool.js +3 -3
  30. package/build/cjs/integrations/tracing/genericPool.js.map +1 -1
  31. package/build/cjs/integrations/tracing/graphql.js +3 -4
  32. package/build/cjs/integrations/tracing/graphql.js.map +1 -1
  33. package/build/cjs/integrations/tracing/hapi/index.js +3 -4
  34. package/build/cjs/integrations/tracing/hapi/index.js.map +1 -1
  35. package/build/cjs/integrations/tracing/index.js +3 -0
  36. package/build/cjs/integrations/tracing/index.js.map +1 -1
  37. package/build/cjs/integrations/tracing/kafka.js +4 -5
  38. package/build/cjs/integrations/tracing/kafka.js.map +1 -1
  39. package/build/cjs/integrations/tracing/knex.js +3 -3
  40. package/build/cjs/integrations/tracing/knex.js.map +1 -1
  41. package/build/cjs/integrations/tracing/koa.js +4 -6
  42. package/build/cjs/integrations/tracing/koa.js.map +1 -1
  43. package/build/cjs/integrations/tracing/lrumemoizer.js +2 -2
  44. package/build/cjs/integrations/tracing/lrumemoizer.js.map +1 -1
  45. package/build/cjs/integrations/tracing/mongo.js +3 -4
  46. package/build/cjs/integrations/tracing/mongo.js.map +1 -1
  47. package/build/cjs/integrations/tracing/mongoose.js +3 -4
  48. package/build/cjs/integrations/tracing/mongoose.js.map +1 -1
  49. package/build/cjs/integrations/tracing/mysql.js +2 -2
  50. package/build/cjs/integrations/tracing/mysql.js.map +1 -1
  51. package/build/cjs/integrations/tracing/mysql2.js +3 -4
  52. package/build/cjs/integrations/tracing/mysql2.js.map +1 -1
  53. package/build/cjs/integrations/tracing/postgres.js +3 -4
  54. package/build/cjs/integrations/tracing/postgres.js.map +1 -1
  55. package/build/cjs/integrations/tracing/postgresjs.js +282 -0
  56. package/build/cjs/integrations/tracing/postgresjs.js.map +1 -0
  57. package/build/cjs/integrations/tracing/prisma.js +2 -2
  58. package/build/cjs/integrations/tracing/prisma.js.map +1 -1
  59. package/build/cjs/integrations/tracing/redis.js +3 -3
  60. package/build/cjs/integrations/tracing/redis.js.map +1 -1
  61. package/build/cjs/integrations/tracing/tedious.js +3 -3
  62. package/build/cjs/integrations/tracing/tedious.js.map +1 -1
  63. package/build/cjs/integrations/tracing/vercelai/index.js +9 -185
  64. package/build/cjs/integrations/tracing/vercelai/index.js.map +1 -1
  65. package/build/cjs/preload.js +2 -2
  66. package/build/cjs/preload.js.map +1 -1
  67. package/build/cjs/sdk/index.js +22 -203
  68. package/build/cjs/sdk/index.js.map +1 -1
  69. package/build/cjs/sdk/initOtel.js +4 -22
  70. package/build/cjs/sdk/initOtel.js.map +1 -1
  71. package/build/esm/index.js +7 -21
  72. package/build/esm/index.js.map +1 -1
  73. package/build/esm/integrations/featureFlagShims/launchDarkly.js +40 -0
  74. package/build/esm/integrations/featureFlagShims/launchDarkly.js.map +1 -0
  75. package/build/esm/integrations/featureFlagShims/openFeature.js +52 -0
  76. package/build/esm/integrations/featureFlagShims/openFeature.js.map +1 -0
  77. package/build/esm/integrations/featureFlagShims/statsig.js +21 -0
  78. package/build/esm/integrations/featureFlagShims/statsig.js.map +1 -0
  79. package/build/esm/integrations/featureFlagShims/unleash.js +21 -0
  80. package/build/esm/integrations/featureFlagShims/unleash.js.map +1 -0
  81. package/build/esm/integrations/fs.js +1 -1
  82. package/build/esm/integrations/fs.js.map +1 -1
  83. package/build/esm/integrations/http/index.js +1 -5
  84. package/build/esm/integrations/http/index.js.map +1 -1
  85. package/build/esm/integrations/node-fetch/index.js +2 -3
  86. package/build/esm/integrations/node-fetch/index.js.map +1 -1
  87. package/build/esm/integrations/tracing/amqplib.js +1 -2
  88. package/build/esm/integrations/tracing/amqplib.js.map +1 -1
  89. package/build/esm/integrations/tracing/connect.js +1 -2
  90. package/build/esm/integrations/tracing/connect.js.map +1 -1
  91. package/build/esm/integrations/tracing/dataloader.js +1 -1
  92. package/build/esm/integrations/tracing/dataloader.js.map +1 -1
  93. package/build/esm/integrations/tracing/express.js +2 -4
  94. package/build/esm/integrations/tracing/express.js.map +1 -1
  95. package/build/esm/integrations/tracing/fastify/fastify-otel/index.js +5 -10
  96. package/build/esm/integrations/tracing/fastify/fastify-otel/index.js.map +1 -1
  97. package/build/esm/integrations/tracing/fastify/index.js +46 -9
  98. package/build/esm/integrations/tracing/fastify/index.js.map +1 -1
  99. package/build/esm/integrations/tracing/genericPool.js +1 -1
  100. package/build/esm/integrations/tracing/genericPool.js.map +1 -1
  101. package/build/esm/integrations/tracing/graphql.js +2 -3
  102. package/build/esm/integrations/tracing/graphql.js.map +1 -1
  103. package/build/esm/integrations/tracing/hapi/index.js +1 -2
  104. package/build/esm/integrations/tracing/hapi/index.js.map +1 -1
  105. package/build/esm/integrations/tracing/index.js +3 -0
  106. package/build/esm/integrations/tracing/index.js.map +1 -1
  107. package/build/esm/integrations/tracing/kafka.js +1 -2
  108. package/build/esm/integrations/tracing/kafka.js.map +1 -1
  109. package/build/esm/integrations/tracing/knex.js +1 -1
  110. package/build/esm/integrations/tracing/knex.js.map +1 -1
  111. package/build/esm/integrations/tracing/koa.js +2 -4
  112. package/build/esm/integrations/tracing/koa.js.map +1 -1
  113. package/build/esm/integrations/tracing/lrumemoizer.js +1 -1
  114. package/build/esm/integrations/tracing/lrumemoizer.js.map +1 -1
  115. package/build/esm/integrations/tracing/mongo.js +1 -2
  116. package/build/esm/integrations/tracing/mongo.js.map +1 -1
  117. package/build/esm/integrations/tracing/mongoose.js +1 -2
  118. package/build/esm/integrations/tracing/mongoose.js.map +1 -1
  119. package/build/esm/integrations/tracing/mysql.js +1 -1
  120. package/build/esm/integrations/tracing/mysql.js.map +1 -1
  121. package/build/esm/integrations/tracing/mysql2.js +1 -2
  122. package/build/esm/integrations/tracing/mysql2.js.map +1 -1
  123. package/build/esm/integrations/tracing/postgres.js +1 -2
  124. package/build/esm/integrations/tracing/postgres.js.map +1 -1
  125. package/build/esm/integrations/tracing/postgresjs.js +278 -0
  126. package/build/esm/integrations/tracing/postgresjs.js.map +1 -0
  127. package/build/esm/integrations/tracing/prisma.js +1 -1
  128. package/build/esm/integrations/tracing/prisma.js.map +1 -1
  129. package/build/esm/integrations/tracing/redis.js +1 -1
  130. package/build/esm/integrations/tracing/redis.js.map +1 -1
  131. package/build/esm/integrations/tracing/tedious.js +1 -1
  132. package/build/esm/integrations/tracing/tedious.js.map +1 -1
  133. package/build/esm/integrations/tracing/vercelai/index.js +9 -185
  134. package/build/esm/integrations/tracing/vercelai/index.js.map +1 -1
  135. package/build/esm/package.json +1 -1
  136. package/build/esm/preload.js +1 -1
  137. package/build/esm/preload.js.map +1 -1
  138. package/build/esm/sdk/index.js +22 -202
  139. package/build/esm/sdk/index.js.map +1 -1
  140. package/build/esm/sdk/initOtel.js +3 -21
  141. package/build/esm/sdk/initOtel.js.map +1 -1
  142. package/build/types/index.d.ts +4 -21
  143. package/build/types/index.d.ts.map +1 -1
  144. package/build/types/integrations/featureFlagShims/index.d.ts +5 -0
  145. package/build/types/integrations/featureFlagShims/index.d.ts.map +1 -0
  146. package/build/types/integrations/featureFlagShims/launchDarkly.d.ts +10 -0
  147. package/build/types/integrations/featureFlagShims/launchDarkly.d.ts.map +1 -0
  148. package/build/types/integrations/featureFlagShims/openFeature.d.ts +23 -0
  149. package/build/types/integrations/featureFlagShims/openFeature.d.ts.map +1 -0
  150. package/build/types/integrations/featureFlagShims/statsig.d.ts +6 -0
  151. package/build/types/integrations/featureFlagShims/statsig.d.ts.map +1 -0
  152. package/build/types/integrations/featureFlagShims/unleash.d.ts +6 -0
  153. package/build/types/integrations/featureFlagShims/unleash.d.ts.map +1 -0
  154. package/build/types/integrations/http/index.d.ts +1 -1
  155. package/build/types/integrations/http/index.d.ts.map +1 -1
  156. package/build/types/integrations/node-fetch/index.d.ts.map +1 -1
  157. package/build/types/integrations/tracing/amqplib.d.ts.map +1 -1
  158. package/build/types/integrations/tracing/connect.d.ts.map +1 -1
  159. package/build/types/integrations/tracing/express.d.ts.map +1 -1
  160. package/build/types/integrations/tracing/fastify/index.d.ts +1 -1
  161. package/build/types/integrations/tracing/fastify/index.d.ts.map +1 -1
  162. package/build/types/integrations/tracing/graphql.d.ts.map +1 -1
  163. package/build/types/integrations/tracing/hapi/index.d.ts.map +1 -1
  164. package/build/types/integrations/tracing/index.d.ts.map +1 -1
  165. package/build/types/integrations/tracing/kafka.d.ts.map +1 -1
  166. package/build/types/integrations/tracing/koa.d.ts.map +1 -1
  167. package/build/types/integrations/tracing/mongo.d.ts.map +1 -1
  168. package/build/types/integrations/tracing/mongoose.d.ts.map +1 -1
  169. package/build/types/integrations/tracing/mysql2.d.ts.map +1 -1
  170. package/build/types/integrations/tracing/postgres.d.ts.map +1 -1
  171. package/build/types/integrations/tracing/postgresjs.d.ts +81 -0
  172. package/build/types/integrations/tracing/postgresjs.d.ts.map +1 -0
  173. package/build/types/integrations/tracing/vercelai/index.d.ts +5 -7
  174. package/build/types/integrations/tracing/vercelai/index.d.ts.map +1 -1
  175. package/build/types/sdk/index.d.ts +2 -6
  176. package/build/types/sdk/index.d.ts.map +1 -1
  177. package/build/types/sdk/initOtel.d.ts +1 -1
  178. package/build/types/sdk/initOtel.d.ts.map +1 -1
  179. package/build/types/types.d.ts +1 -1
  180. package/build/types/types.d.ts.map +1 -1
  181. package/build/types-ts3.8/index.d.ts +4 -21
  182. package/build/types-ts3.8/integrations/featureFlagShims/index.d.ts +5 -0
  183. package/build/types-ts3.8/integrations/featureFlagShims/launchDarkly.d.ts +10 -0
  184. package/build/types-ts3.8/integrations/featureFlagShims/openFeature.d.ts +23 -0
  185. package/build/types-ts3.8/integrations/featureFlagShims/statsig.d.ts +6 -0
  186. package/build/types-ts3.8/integrations/featureFlagShims/unleash.d.ts +6 -0
  187. package/build/types-ts3.8/integrations/http/index.d.ts +1 -1
  188. package/build/types-ts3.8/integrations/tracing/fastify/index.d.ts +1 -1
  189. package/build/types-ts3.8/integrations/tracing/postgresjs.d.ts +81 -0
  190. package/build/types-ts3.8/integrations/tracing/vercelai/index.d.ts +5 -7
  191. package/build/types-ts3.8/sdk/index.d.ts +2 -6
  192. package/build/types-ts3.8/sdk/initOtel.d.ts +1 -1
  193. package/build/types-ts3.8/types.d.ts +1 -1
  194. package/package.json +4 -3
  195. package/build/cjs/cron/common.js +0 -56
  196. package/build/cjs/cron/common.js.map +0 -1
  197. package/build/cjs/cron/cron.js +0 -112
  198. package/build/cjs/cron/cron.js.map +0 -1
  199. package/build/cjs/cron/index.js +0 -15
  200. package/build/cjs/cron/index.js.map +0 -1
  201. package/build/cjs/cron/node-cron.js +0 -71
  202. package/build/cjs/cron/node-cron.js.map +0 -1
  203. package/build/cjs/cron/node-schedule.js +0 -65
  204. package/build/cjs/cron/node-schedule.js.map +0 -1
  205. package/build/cjs/integrations/anr/index.js +0 -238
  206. package/build/cjs/integrations/anr/index.js.map +0 -1
  207. package/build/cjs/integrations/childProcess.js +0 -100
  208. package/build/cjs/integrations/childProcess.js.map +0 -1
  209. package/build/cjs/integrations/context.js +0 -457
  210. package/build/cjs/integrations/context.js.map +0 -1
  211. package/build/cjs/integrations/contextlines.js +0 -405
  212. package/build/cjs/integrations/contextlines.js.map +0 -1
  213. package/build/cjs/integrations/http/SentryHttpInstrumentation.js +0 -558
  214. package/build/cjs/integrations/http/SentryHttpInstrumentation.js.map +0 -1
  215. package/build/cjs/integrations/local-variables/common.js +0 -69
  216. package/build/cjs/integrations/local-variables/common.js.map +0 -1
  217. package/build/cjs/integrations/local-variables/index.js +0 -12
  218. package/build/cjs/integrations/local-variables/index.js.map +0 -1
  219. package/build/cjs/integrations/local-variables/local-variables-async.js +0 -143
  220. package/build/cjs/integrations/local-variables/local-variables-async.js.map +0 -1
  221. package/build/cjs/integrations/local-variables/local-variables-sync.js +0 -410
  222. package/build/cjs/integrations/local-variables/local-variables-sync.js.map +0 -1
  223. package/build/cjs/integrations/modules.js +0 -135
  224. package/build/cjs/integrations/modules.js.map +0 -1
  225. package/build/cjs/integrations/node-fetch/SentryNodeFetchInstrumentation.js +0 -291
  226. package/build/cjs/integrations/node-fetch/SentryNodeFetchInstrumentation.js.map +0 -1
  227. package/build/cjs/integrations/onuncaughtexception.js +0 -134
  228. package/build/cjs/integrations/onuncaughtexception.js.map +0 -1
  229. package/build/cjs/integrations/onunhandledrejection.js +0 -89
  230. package/build/cjs/integrations/onunhandledrejection.js.map +0 -1
  231. package/build/cjs/integrations/processSession.js +0 -36
  232. package/build/cjs/integrations/processSession.js.map +0 -1
  233. package/build/cjs/integrations/spotlight.js +0 -101
  234. package/build/cjs/integrations/spotlight.js.map +0 -1
  235. package/build/cjs/integrations/tracing/vercelai/ai_sdk_attributes.js +0 -168
  236. package/build/cjs/integrations/tracing/vercelai/ai_sdk_attributes.js.map +0 -1
  237. package/build/cjs/integrations/winston.js +0 -151
  238. package/build/cjs/integrations/winston.js.map +0 -1
  239. package/build/cjs/logs/capture.js +0 -29
  240. package/build/cjs/logs/capture.js.map +0 -1
  241. package/build/cjs/logs/exports.js +0 -178
  242. package/build/cjs/logs/exports.js.map +0 -1
  243. package/build/cjs/nodeVersion.js +0 -12
  244. package/build/cjs/nodeVersion.js.map +0 -1
  245. package/build/cjs/otel/contextManager.js +0 -16
  246. package/build/cjs/otel/contextManager.js.map +0 -1
  247. package/build/cjs/otel/instrument.js +0 -139
  248. package/build/cjs/otel/instrument.js.map +0 -1
  249. package/build/cjs/proxy/base.js +0 -122
  250. package/build/cjs/proxy/base.js.map +0 -1
  251. package/build/cjs/proxy/index.js +0 -173
  252. package/build/cjs/proxy/index.js.map +0 -1
  253. package/build/cjs/proxy/parse-proxy-response.js +0 -104
  254. package/build/cjs/proxy/parse-proxy-response.js.map +0 -1
  255. package/build/cjs/sdk/api.js +0 -117
  256. package/build/cjs/sdk/api.js.map +0 -1
  257. package/build/cjs/sdk/client.js +0 -156
  258. package/build/cjs/sdk/client.js.map +0 -1
  259. package/build/cjs/transports/http.js +0 -158
  260. package/build/cjs/transports/http.js.map +0 -1
  261. package/build/cjs/utils/addOriginToSpan.js +0 -11
  262. package/build/cjs/utils/addOriginToSpan.js.map +0 -1
  263. package/build/cjs/utils/baggage.js +0 -36
  264. package/build/cjs/utils/baggage.js.map +0 -1
  265. package/build/cjs/utils/commonjs.js +0 -13
  266. package/build/cjs/utils/commonjs.js.map +0 -1
  267. package/build/cjs/utils/createMissingInstrumentationContext.js +0 -11
  268. package/build/cjs/utils/createMissingInstrumentationContext.js.map +0 -1
  269. package/build/cjs/utils/debug.js +0 -23
  270. package/build/cjs/utils/debug.js.map +0 -1
  271. package/build/cjs/utils/ensureIsWrapped.js +0 -41
  272. package/build/cjs/utils/ensureIsWrapped.js.map +0 -1
  273. package/build/cjs/utils/envToBool.js +0 -32
  274. package/build/cjs/utils/envToBool.js.map +0 -1
  275. package/build/cjs/utils/errorhandling.js +0 -42
  276. package/build/cjs/utils/errorhandling.js.map +0 -1
  277. package/build/cjs/utils/getRequestUrl.js +0 -18
  278. package/build/cjs/utils/getRequestUrl.js.map +0 -1
  279. package/build/cjs/utils/module.js +0 -60
  280. package/build/cjs/utils/module.js.map +0 -1
  281. package/build/esm/cron/common.js +0 -54
  282. package/build/esm/cron/common.js.map +0 -1
  283. package/build/esm/cron/cron.js +0 -110
  284. package/build/esm/cron/cron.js.map +0 -1
  285. package/build/esm/cron/index.js +0 -13
  286. package/build/esm/cron/index.js.map +0 -1
  287. package/build/esm/cron/node-cron.js +0 -69
  288. package/build/esm/cron/node-cron.js.map +0 -1
  289. package/build/esm/cron/node-schedule.js +0 -63
  290. package/build/esm/cron/node-schedule.js.map +0 -1
  291. package/build/esm/integrations/anr/index.js +0 -234
  292. package/build/esm/integrations/anr/index.js.map +0 -1
  293. package/build/esm/integrations/anr/worker-script.js +0 -2
  294. package/build/esm/integrations/childProcess.js +0 -98
  295. package/build/esm/integrations/childProcess.js.map +0 -1
  296. package/build/esm/integrations/context.js +0 -451
  297. package/build/esm/integrations/context.js.map +0 -1
  298. package/build/esm/integrations/contextlines.js +0 -399
  299. package/build/esm/integrations/contextlines.js.map +0 -1
  300. package/build/esm/integrations/http/SentryHttpInstrumentation.js +0 -555
  301. package/build/esm/integrations/http/SentryHttpInstrumentation.js.map +0 -1
  302. package/build/esm/integrations/local-variables/common.js +0 -64
  303. package/build/esm/integrations/local-variables/common.js.map +0 -1
  304. package/build/esm/integrations/local-variables/index.js +0 -10
  305. package/build/esm/integrations/local-variables/index.js.map +0 -1
  306. package/build/esm/integrations/local-variables/local-variables-async.js +0 -140
  307. package/build/esm/integrations/local-variables/local-variables-async.js.map +0 -1
  308. package/build/esm/integrations/local-variables/local-variables-sync.js +0 -405
  309. package/build/esm/integrations/local-variables/local-variables-sync.js.map +0 -1
  310. package/build/esm/integrations/local-variables/worker-script.js +0 -2
  311. package/build/esm/integrations/modules.js +0 -133
  312. package/build/esm/integrations/modules.js.map +0 -1
  313. package/build/esm/integrations/node-fetch/SentryNodeFetchInstrumentation.js +0 -289
  314. package/build/esm/integrations/node-fetch/SentryNodeFetchInstrumentation.js.map +0 -1
  315. package/build/esm/integrations/onuncaughtexception.js +0 -131
  316. package/build/esm/integrations/onuncaughtexception.js.map +0 -1
  317. package/build/esm/integrations/onunhandledrejection.js +0 -86
  318. package/build/esm/integrations/onunhandledrejection.js.map +0 -1
  319. package/build/esm/integrations/processSession.js +0 -34
  320. package/build/esm/integrations/processSession.js.map +0 -1
  321. package/build/esm/integrations/spotlight.js +0 -98
  322. package/build/esm/integrations/spotlight.js.map +0 -1
  323. package/build/esm/integrations/tracing/vercelai/ai_sdk_attributes.js +0 -152
  324. package/build/esm/integrations/tracing/vercelai/ai_sdk_attributes.js.map +0 -1
  325. package/build/esm/integrations/winston.js +0 -149
  326. package/build/esm/integrations/winston.js.map +0 -1
  327. package/build/esm/logs/capture.js +0 -27
  328. package/build/esm/logs/capture.js.map +0 -1
  329. package/build/esm/logs/exports.js +0 -170
  330. package/build/esm/logs/exports.js.map +0 -1
  331. package/build/esm/nodeVersion.js +0 -8
  332. package/build/esm/nodeVersion.js.map +0 -1
  333. package/build/esm/otel/contextManager.js +0 -14
  334. package/build/esm/otel/contextManager.js.map +0 -1
  335. package/build/esm/otel/instrument.js +0 -135
  336. package/build/esm/otel/instrument.js.map +0 -1
  337. package/build/esm/proxy/base.js +0 -120
  338. package/build/esm/proxy/base.js.map +0 -1
  339. package/build/esm/proxy/index.js +0 -171
  340. package/build/esm/proxy/index.js.map +0 -1
  341. package/build/esm/proxy/parse-proxy-response.js +0 -102
  342. package/build/esm/proxy/parse-proxy-response.js.map +0 -1
  343. package/build/esm/sdk/api.js +0 -114
  344. package/build/esm/sdk/api.js.map +0 -1
  345. package/build/esm/sdk/client.js +0 -154
  346. package/build/esm/sdk/client.js.map +0 -1
  347. package/build/esm/transports/http.js +0 -156
  348. package/build/esm/transports/http.js.map +0 -1
  349. package/build/esm/utils/addOriginToSpan.js +0 -9
  350. package/build/esm/utils/addOriginToSpan.js.map +0 -1
  351. package/build/esm/utils/baggage.js +0 -34
  352. package/build/esm/utils/baggage.js.map +0 -1
  353. package/build/esm/utils/commonjs.js +0 -11
  354. package/build/esm/utils/commonjs.js.map +0 -1
  355. package/build/esm/utils/createMissingInstrumentationContext.js +0 -9
  356. package/build/esm/utils/createMissingInstrumentationContext.js.map +0 -1
  357. package/build/esm/utils/debug.js +0 -21
  358. package/build/esm/utils/debug.js.map +0 -1
  359. package/build/esm/utils/ensureIsWrapped.js +0 -39
  360. package/build/esm/utils/ensureIsWrapped.js.map +0 -1
  361. package/build/esm/utils/envToBool.js +0 -28
  362. package/build/esm/utils/envToBool.js.map +0 -1
  363. package/build/esm/utils/errorhandling.js +0 -40
  364. package/build/esm/utils/errorhandling.js.map +0 -1
  365. package/build/esm/utils/getRequestUrl.js +0 -16
  366. package/build/esm/utils/getRequestUrl.js.map +0 -1
  367. package/build/esm/utils/module.js +0 -58
  368. package/build/esm/utils/module.js.map +0 -1
  369. package/build/types/cron/common.d.ts +0 -5
  370. package/build/types/cron/common.d.ts.map +0 -1
  371. package/build/types/cron/cron.d.ts +0 -43
  372. package/build/types/cron/cron.d.ts.map +0 -1
  373. package/build/types/cron/index.d.ts +0 -10
  374. package/build/types/cron/index.d.ts.map +0 -1
  375. package/build/types/cron/node-cron.d.ts +0 -27
  376. package/build/types/cron/node-cron.d.ts.map +0 -1
  377. package/build/types/cron/node-schedule.d.ts +0 -19
  378. package/build/types/cron/node-schedule.d.ts.map +0 -1
  379. package/build/types/integrations/anr/common.d.ts +0 -52
  380. package/build/types/integrations/anr/common.d.ts.map +0 -1
  381. package/build/types/integrations/anr/index.d.ts +0 -13
  382. package/build/types/integrations/anr/index.d.ts.map +0 -1
  383. package/build/types/integrations/anr/worker.d.ts +0 -2
  384. package/build/types/integrations/anr/worker.d.ts.map +0 -1
  385. package/build/types/integrations/childProcess.d.ts +0 -20
  386. package/build/types/integrations/childProcess.d.ts.map +0 -1
  387. package/build/types/integrations/context.d.ts +0 -30
  388. package/build/types/integrations/context.d.ts.map +0 -1
  389. package/build/types/integrations/contextlines.d.ts +0 -31
  390. package/build/types/integrations/contextlines.d.ts.map +0 -1
  391. package/build/types/integrations/http/SentryHttpInstrumentation.d.ts +0 -131
  392. package/build/types/integrations/http/SentryHttpInstrumentation.d.ts.map +0 -1
  393. package/build/types/integrations/local-variables/common.d.ts +0 -66
  394. package/build/types/integrations/local-variables/common.d.ts.map +0 -1
  395. package/build/types/integrations/local-variables/index.d.ts +0 -4
  396. package/build/types/integrations/local-variables/index.d.ts.map +0 -1
  397. package/build/types/integrations/local-variables/local-variables-async.d.ts +0 -7
  398. package/build/types/integrations/local-variables/local-variables-async.d.ts.map +0 -1
  399. package/build/types/integrations/local-variables/local-variables-sync.d.ts +0 -34
  400. package/build/types/integrations/local-variables/local-variables-sync.d.ts.map +0 -1
  401. package/build/types/integrations/local-variables/worker.d.ts +0 -2
  402. package/build/types/integrations/local-variables/worker.d.ts.map +0 -1
  403. package/build/types/integrations/modules.d.ts +0 -17
  404. package/build/types/integrations/modules.d.ts.map +0 -1
  405. package/build/types/integrations/node-fetch/SentryNodeFetchInstrumentation.d.ts +0 -56
  406. package/build/types/integrations/node-fetch/SentryNodeFetchInstrumentation.d.ts.map +0 -1
  407. package/build/types/integrations/onuncaughtexception.d.ts +0 -31
  408. package/build/types/integrations/onuncaughtexception.d.ts.map +0 -1
  409. package/build/types/integrations/onunhandledrejection.d.ts +0 -23
  410. package/build/types/integrations/onunhandledrejection.d.ts.map +0 -1
  411. package/build/types/integrations/processSession.d.ts +0 -5
  412. package/build/types/integrations/processSession.d.ts.map +0 -1
  413. package/build/types/integrations/spotlight.d.ts +0 -18
  414. package/build/types/integrations/spotlight.d.ts.map +0 -1
  415. package/build/types/integrations/tracing/vercelai/ai_sdk_attributes.d.ts +0 -669
  416. package/build/types/integrations/tracing/vercelai/ai_sdk_attributes.d.ts.map +0 -1
  417. package/build/types/integrations/winston.d.ts +0 -44
  418. package/build/types/integrations/winston.d.ts.map +0 -1
  419. package/build/types/logs/capture.d.ts +0 -11
  420. package/build/types/logs/capture.d.ts.map +0 -1
  421. package/build/types/logs/exports.d.ts +0 -150
  422. package/build/types/logs/exports.d.ts.map +0 -1
  423. package/build/types/nodeVersion.d.ts +0 -8
  424. package/build/types/nodeVersion.d.ts.map +0 -1
  425. package/build/types/otel/contextManager.d.ts +0 -10
  426. package/build/types/otel/contextManager.d.ts.map +0 -1
  427. package/build/types/otel/instrument.d.ts +0 -23
  428. package/build/types/otel/instrument.d.ts.map +0 -1
  429. package/build/types/proxy/base.d.ts +0 -65
  430. package/build/types/proxy/base.d.ts.map +0 -1
  431. package/build/types/proxy/helpers.d.ts +0 -42
  432. package/build/types/proxy/helpers.d.ts.map +0 -1
  433. package/build/types/proxy/index.d.ts +0 -73
  434. package/build/types/proxy/index.d.ts.map +0 -1
  435. package/build/types/proxy/parse-proxy-response.d.ts +0 -43
  436. package/build/types/proxy/parse-proxy-response.d.ts.map +0 -1
  437. package/build/types/sdk/api.d.ts +0 -8
  438. package/build/types/sdk/api.d.ts.map +0 -1
  439. package/build/types/sdk/client.d.ts +0 -29
  440. package/build/types/sdk/client.d.ts.map +0 -1
  441. package/build/types/sdk/scope.d.ts +0 -7
  442. package/build/types/sdk/scope.d.ts.map +0 -1
  443. package/build/types/transports/http-module.d.ts +0 -31
  444. package/build/types/transports/http-module.d.ts.map +0 -1
  445. package/build/types/transports/http.d.ts +0 -21
  446. package/build/types/transports/http.d.ts.map +0 -1
  447. package/build/types/transports/index.d.ts +0 -3
  448. package/build/types/transports/index.d.ts.map +0 -1
  449. package/build/types/utils/addOriginToSpan.d.ts +0 -5
  450. package/build/types/utils/addOriginToSpan.d.ts.map +0 -1
  451. package/build/types/utils/baggage.d.ts +0 -6
  452. package/build/types/utils/baggage.d.ts.map +0 -1
  453. package/build/types/utils/commonjs.d.ts +0 -3
  454. package/build/types/utils/commonjs.d.ts.map +0 -1
  455. package/build/types/utils/createMissingInstrumentationContext.d.ts +0 -3
  456. package/build/types/utils/createMissingInstrumentationContext.d.ts.map +0 -1
  457. package/build/types/utils/debug.d.ts +0 -5
  458. package/build/types/utils/debug.d.ts.map +0 -1
  459. package/build/types/utils/ensureIsWrapped.d.ts +0 -5
  460. package/build/types/utils/ensureIsWrapped.d.ts.map +0 -1
  461. package/build/types/utils/entry-point.d.ts +0 -24
  462. package/build/types/utils/entry-point.d.ts.map +0 -1
  463. package/build/types/utils/envToBool.d.ts +0 -13
  464. package/build/types/utils/envToBool.d.ts.map +0 -1
  465. package/build/types/utils/errorhandling.d.ts +0 -5
  466. package/build/types/utils/errorhandling.d.ts.map +0 -1
  467. package/build/types/utils/getRequestUrl.d.ts +0 -5
  468. package/build/types/utils/getRequestUrl.d.ts.map +0 -1
  469. package/build/types/utils/module.d.ts +0 -3
  470. package/build/types/utils/module.d.ts.map +0 -1
  471. package/build/types/utils/prepareEvent.d.ts +0 -17
  472. package/build/types/utils/prepareEvent.d.ts.map +0 -1
  473. package/build/types-ts3.8/cron/common.d.ts +0 -5
  474. package/build/types-ts3.8/cron/cron.d.ts +0 -43
  475. package/build/types-ts3.8/cron/index.d.ts +0 -10
  476. package/build/types-ts3.8/cron/node-cron.d.ts +0 -27
  477. package/build/types-ts3.8/cron/node-schedule.d.ts +0 -19
  478. package/build/types-ts3.8/integrations/anr/common.d.ts +0 -52
  479. package/build/types-ts3.8/integrations/anr/index.d.ts +0 -13
  480. package/build/types-ts3.8/integrations/anr/worker.d.ts +0 -2
  481. package/build/types-ts3.8/integrations/childProcess.d.ts +0 -20
  482. package/build/types-ts3.8/integrations/context.d.ts +0 -30
  483. package/build/types-ts3.8/integrations/contextlines.d.ts +0 -31
  484. package/build/types-ts3.8/integrations/http/SentryHttpInstrumentation.d.ts +0 -133
  485. package/build/types-ts3.8/integrations/local-variables/common.d.ts +0 -66
  486. package/build/types-ts3.8/integrations/local-variables/index.d.ts +0 -4
  487. package/build/types-ts3.8/integrations/local-variables/local-variables-async.d.ts +0 -7
  488. package/build/types-ts3.8/integrations/local-variables/local-variables-sync.d.ts +0 -34
  489. package/build/types-ts3.8/integrations/local-variables/worker.d.ts +0 -2
  490. package/build/types-ts3.8/integrations/modules.d.ts +0 -17
  491. package/build/types-ts3.8/integrations/node-fetch/SentryNodeFetchInstrumentation.d.ts +0 -56
  492. package/build/types-ts3.8/integrations/onuncaughtexception.d.ts +0 -31
  493. package/build/types-ts3.8/integrations/onunhandledrejection.d.ts +0 -23
  494. package/build/types-ts3.8/integrations/processSession.d.ts +0 -5
  495. package/build/types-ts3.8/integrations/spotlight.d.ts +0 -18
  496. package/build/types-ts3.8/integrations/tracing/vercelai/ai_sdk_attributes.d.ts +0 -669
  497. package/build/types-ts3.8/integrations/winston.d.ts +0 -44
  498. package/build/types-ts3.8/logs/capture.d.ts +0 -18
  499. package/build/types-ts3.8/logs/exports.d.ts +0 -150
  500. package/build/types-ts3.8/nodeVersion.d.ts +0 -8
  501. package/build/types-ts3.8/otel/contextManager.d.ts +0 -10
  502. package/build/types-ts3.8/otel/instrument.d.ts +0 -23
  503. package/build/types-ts3.8/proxy/base.d.ts +0 -60
  504. package/build/types-ts3.8/proxy/helpers.d.ts +0 -38
  505. package/build/types-ts3.8/proxy/index.d.ts +0 -74
  506. package/build/types-ts3.8/proxy/parse-proxy-response.d.ts +0 -40
  507. package/build/types-ts3.8/sdk/api.d.ts +0 -8
  508. package/build/types-ts3.8/sdk/client.d.ts +0 -32
  509. package/build/types-ts3.8/sdk/scope.d.ts +0 -7
  510. package/build/types-ts3.8/transports/http-module.d.ts +0 -28
  511. package/build/types-ts3.8/transports/http.d.ts +0 -20
  512. package/build/types-ts3.8/transports/index.d.ts +0 -3
  513. package/build/types-ts3.8/utils/addOriginToSpan.d.ts +0 -5
  514. package/build/types-ts3.8/utils/baggage.d.ts +0 -6
  515. package/build/types-ts3.8/utils/commonjs.d.ts +0 -3
  516. package/build/types-ts3.8/utils/createMissingInstrumentationContext.d.ts +0 -3
  517. package/build/types-ts3.8/utils/debug.d.ts +0 -5
  518. package/build/types-ts3.8/utils/ensureIsWrapped.d.ts +0 -5
  519. package/build/types-ts3.8/utils/entry-point.d.ts +0 -24
  520. package/build/types-ts3.8/utils/envToBool.d.ts +0 -13
  521. package/build/types-ts3.8/utils/errorhandling.d.ts +0 -5
  522. package/build/types-ts3.8/utils/getRequestUrl.d.ts +0 -5
  523. package/build/types-ts3.8/utils/module.d.ts +0 -3
  524. package/build/types-ts3.8/utils/prepareEvent.d.ts +0 -17
@@ -1,131 +0,0 @@
1
- import { defineIntegration, getClient, captureException, logger } from '@sentry/core';
2
- import { DEBUG_BUILD } from '../debug-build.js';
3
- import { logAndExitProcess } from '../utils/errorhandling.js';
4
-
5
- const INTEGRATION_NAME = 'OnUncaughtException';
6
-
7
- /**
8
- * Add a global exception handler.
9
- */
10
- const onUncaughtExceptionIntegration = defineIntegration((options = {}) => {
11
- const optionsWithDefaults = {
12
- exitEvenIfOtherHandlersAreRegistered: false,
13
- ...options,
14
- };
15
-
16
- return {
17
- name: INTEGRATION_NAME,
18
- setup(client) {
19
- global.process.on('uncaughtException', makeErrorHandler(client, optionsWithDefaults));
20
- },
21
- };
22
- });
23
-
24
- /** Exported only for tests */
25
- function makeErrorHandler(client, options) {
26
- const timeout = 2000;
27
- let caughtFirstError = false;
28
- let caughtSecondError = false;
29
- let calledFatalError = false;
30
- let firstError;
31
-
32
- const clientOptions = client.getOptions();
33
-
34
- return Object.assign(
35
- (error) => {
36
- let onFatalError = logAndExitProcess;
37
-
38
- if (options.onFatalError) {
39
- onFatalError = options.onFatalError;
40
- } else if (clientOptions.onFatalError) {
41
- onFatalError = clientOptions.onFatalError ;
42
- }
43
-
44
- // Attaching a listener to `uncaughtException` will prevent the node process from exiting. We generally do not
45
- // want to alter this behaviour so we check for other listeners that users may have attached themselves and adjust
46
- // exit behaviour of the SDK accordingly:
47
- // - If other listeners are attached, do not exit.
48
- // - If the only listener attached is ours, exit.
49
- const userProvidedListenersCount = (global.process.listeners('uncaughtException') ).filter(
50
- listener => {
51
- // There are 3 listeners we ignore:
52
- return (
53
- // as soon as we're using domains this listener is attached by node itself
54
- listener.name !== 'domainUncaughtExceptionClear' &&
55
- // the handler we register for tracing
56
- listener.tag !== 'sentry_tracingErrorCallback' &&
57
- // the handler we register in this integration
58
- (listener )._errorHandler !== true
59
- );
60
- },
61
- ).length;
62
-
63
- const processWouldExit = userProvidedListenersCount === 0;
64
- const shouldApplyFatalHandlingLogic = options.exitEvenIfOtherHandlersAreRegistered || processWouldExit;
65
-
66
- if (!caughtFirstError) {
67
- // this is the first uncaught error and the ultimate reason for shutting down
68
- // we want to do absolutely everything possible to ensure it gets captured
69
- // also we want to make sure we don't go recursion crazy if more errors happen after this one
70
- firstError = error;
71
- caughtFirstError = true;
72
-
73
- if (getClient() === client) {
74
- captureException(error, {
75
- originalException: error,
76
- captureContext: {
77
- level: 'fatal',
78
- },
79
- mechanism: {
80
- handled: false,
81
- type: 'onuncaughtexception',
82
- },
83
- });
84
- }
85
-
86
- if (!calledFatalError && shouldApplyFatalHandlingLogic) {
87
- calledFatalError = true;
88
- onFatalError(error);
89
- }
90
- } else {
91
- if (shouldApplyFatalHandlingLogic) {
92
- if (calledFatalError) {
93
- // we hit an error *after* calling onFatalError - pretty boned at this point, just shut it down
94
- DEBUG_BUILD &&
95
- logger.warn(
96
- 'uncaught exception after calling fatal error shutdown callback - this is bad! forcing shutdown',
97
- );
98
- logAndExitProcess(error);
99
- } else if (!caughtSecondError) {
100
- // two cases for how we can hit this branch:
101
- // - capturing of first error blew up and we just caught the exception from that
102
- // - quit trying to capture, proceed with shutdown
103
- // - a second independent error happened while waiting for first error to capture
104
- // - want to avoid causing premature shutdown before first error capture finishes
105
- // it's hard to immediately tell case 1 from case 2 without doing some fancy/questionable domain stuff
106
- // so let's instead just delay a bit before we proceed with our action here
107
- // in case 1, we just wait a bit unnecessarily but ultimately do the same thing
108
- // in case 2, the delay hopefully made us wait long enough for the capture to finish
109
- // two potential nonideal outcomes:
110
- // nonideal case 1: capturing fails fast, we sit around for a few seconds unnecessarily before proceeding correctly by calling onFatalError
111
- // nonideal case 2: case 2 happens, 1st error is captured but slowly, timeout completes before capture and we treat second error as the sendErr of (nonexistent) failure from trying to capture first error
112
- // note that after hitting this branch, we might catch more errors where (caughtSecondError && !calledFatalError)
113
- // we ignore them - they don't matter to us, we're just waiting for the second error timeout to finish
114
- caughtSecondError = true;
115
- setTimeout(() => {
116
- if (!calledFatalError) {
117
- // it was probably case 1, let's treat err as the sendErr and call onFatalError
118
- calledFatalError = true;
119
- onFatalError(firstError, error);
120
- }
121
- }, timeout); // capturing could take at least sendTimeout to fail, plus an arbitrary second for how long it takes to collect surrounding source etc
122
- }
123
- }
124
- }
125
- },
126
- { _errorHandler: true },
127
- );
128
- }
129
-
130
- export { makeErrorHandler, onUncaughtExceptionIntegration };
131
- //# sourceMappingURL=onuncaughtexception.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"onuncaughtexception.js","sources":["../../../src/integrations/onuncaughtexception.ts"],"sourcesContent":["import { captureException, defineIntegration, getClient, logger } from '@sentry/core';\nimport { DEBUG_BUILD } from '../debug-build';\nimport type { NodeClient } from '../sdk/client';\nimport { logAndExitProcess } from '../utils/errorhandling';\n\ntype OnFatalErrorHandler = (firstError: Error, secondError?: Error) => void;\n\ntype TaggedListener = NodeJS.UncaughtExceptionListener & {\n tag?: string;\n};\n\ninterface OnUncaughtExceptionOptions {\n /**\n * Controls if the SDK should register a handler to exit the process on uncaught errors:\n * - `true`: The SDK will exit the process on all uncaught errors.\n * - `false`: The SDK will only exit the process when there are no other `uncaughtException` handlers attached.\n *\n * Default: `false`\n */\n exitEvenIfOtherHandlersAreRegistered: boolean;\n\n /**\n * This is called when an uncaught error would cause the process to exit.\n *\n * @param firstError Uncaught error causing the process to exit\n * @param secondError Will be set if the handler was called multiple times. This can happen either because\n * `onFatalError` itself threw, or because an independent error happened somewhere else while `onFatalError`\n * was running.\n */\n onFatalError?(this: void, firstError: Error, secondError?: Error): void;\n}\n\nconst INTEGRATION_NAME = 'OnUncaughtException';\n\n/**\n * Add a global exception handler.\n */\nexport const onUncaughtExceptionIntegration = defineIntegration((options: Partial<OnUncaughtExceptionOptions> = {}) => {\n const optionsWithDefaults = {\n exitEvenIfOtherHandlersAreRegistered: false,\n ...options,\n };\n\n return {\n name: INTEGRATION_NAME,\n setup(client: NodeClient) {\n global.process.on('uncaughtException', makeErrorHandler(client, optionsWithDefaults));\n },\n };\n});\n\ntype ErrorHandler = { _errorHandler: boolean } & ((error: Error) => void);\n\n/** Exported only for tests */\nexport function makeErrorHandler(client: NodeClient, options: OnUncaughtExceptionOptions): ErrorHandler {\n const timeout = 2000;\n let caughtFirstError: boolean = false;\n let caughtSecondError: boolean = false;\n let calledFatalError: boolean = false;\n let firstError: Error;\n\n const clientOptions = client.getOptions();\n\n return Object.assign(\n (error: Error): void => {\n let onFatalError: OnFatalErrorHandler = logAndExitProcess;\n\n if (options.onFatalError) {\n onFatalError = options.onFatalError;\n } else if (clientOptions.onFatalError) {\n onFatalError = clientOptions.onFatalError as OnFatalErrorHandler;\n }\n\n // Attaching a listener to `uncaughtException` will prevent the node process from exiting. We generally do not\n // want to alter this behaviour so we check for other listeners that users may have attached themselves and adjust\n // exit behaviour of the SDK accordingly:\n // - If other listeners are attached, do not exit.\n // - If the only listener attached is ours, exit.\n const userProvidedListenersCount = (global.process.listeners('uncaughtException') as TaggedListener[]).filter(\n listener => {\n // There are 3 listeners we ignore:\n return (\n // as soon as we're using domains this listener is attached by node itself\n listener.name !== 'domainUncaughtExceptionClear' &&\n // the handler we register for tracing\n listener.tag !== 'sentry_tracingErrorCallback' &&\n // the handler we register in this integration\n (listener as ErrorHandler)._errorHandler !== true\n );\n },\n ).length;\n\n const processWouldExit = userProvidedListenersCount === 0;\n const shouldApplyFatalHandlingLogic = options.exitEvenIfOtherHandlersAreRegistered || processWouldExit;\n\n if (!caughtFirstError) {\n // this is the first uncaught error and the ultimate reason for shutting down\n // we want to do absolutely everything possible to ensure it gets captured\n // also we want to make sure we don't go recursion crazy if more errors happen after this one\n firstError = error;\n caughtFirstError = true;\n\n if (getClient() === client) {\n captureException(error, {\n originalException: error,\n captureContext: {\n level: 'fatal',\n },\n mechanism: {\n handled: false,\n type: 'onuncaughtexception',\n },\n });\n }\n\n if (!calledFatalError && shouldApplyFatalHandlingLogic) {\n calledFatalError = true;\n onFatalError(error);\n }\n } else {\n if (shouldApplyFatalHandlingLogic) {\n if (calledFatalError) {\n // we hit an error *after* calling onFatalError - pretty boned at this point, just shut it down\n DEBUG_BUILD &&\n logger.warn(\n 'uncaught exception after calling fatal error shutdown callback - this is bad! forcing shutdown',\n );\n logAndExitProcess(error);\n } else if (!caughtSecondError) {\n // two cases for how we can hit this branch:\n // - capturing of first error blew up and we just caught the exception from that\n // - quit trying to capture, proceed with shutdown\n // - a second independent error happened while waiting for first error to capture\n // - want to avoid causing premature shutdown before first error capture finishes\n // it's hard to immediately tell case 1 from case 2 without doing some fancy/questionable domain stuff\n // so let's instead just delay a bit before we proceed with our action here\n // in case 1, we just wait a bit unnecessarily but ultimately do the same thing\n // in case 2, the delay hopefully made us wait long enough for the capture to finish\n // two potential nonideal outcomes:\n // nonideal case 1: capturing fails fast, we sit around for a few seconds unnecessarily before proceeding correctly by calling onFatalError\n // nonideal case 2: case 2 happens, 1st error is captured but slowly, timeout completes before capture and we treat second error as the sendErr of (nonexistent) failure from trying to capture first error\n // note that after hitting this branch, we might catch more errors where (caughtSecondError && !calledFatalError)\n // we ignore them - they don't matter to us, we're just waiting for the second error timeout to finish\n caughtSecondError = true;\n setTimeout(() => {\n if (!calledFatalError) {\n // it was probably case 1, let's treat err as the sendErr and call onFatalError\n calledFatalError = true;\n onFatalError(firstError, error);\n } else {\n // it was probably case 2, our first error finished capturing while we waited, cool, do nothing\n }\n }, timeout); // capturing could take at least sendTimeout to fail, plus an arbitrary second for how long it takes to collect surrounding source etc\n }\n }\n }\n },\n { _errorHandler: true },\n );\n}\n"],"names":[],"mappings":"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"}
@@ -1,86 +0,0 @@
1
- import { defineIntegration, getClient, captureException, consoleSandbox } from '@sentry/core';
2
- import { logAndExitProcess } from '../utils/errorhandling.js';
3
-
4
- const INTEGRATION_NAME = 'OnUnhandledRejection';
5
-
6
- const _onUnhandledRejectionIntegration = ((options = {}) => {
7
- const opts = {
8
- mode: 'warn',
9
- ...options,
10
- } ;
11
-
12
- return {
13
- name: INTEGRATION_NAME,
14
- setup(client) {
15
- global.process.on('unhandledRejection', makeUnhandledPromiseHandler(client, opts));
16
- },
17
- };
18
- }) ;
19
-
20
- /**
21
- * Add a global promise rejection handler.
22
- */
23
- const onUnhandledRejectionIntegration = defineIntegration(_onUnhandledRejectionIntegration);
24
-
25
- /**
26
- * Send an exception with reason
27
- * @param reason string
28
- * @param promise promise
29
- *
30
- * Exported only for tests.
31
- */
32
- function makeUnhandledPromiseHandler(
33
- client,
34
- options,
35
- ) {
36
- return function sendUnhandledPromise(reason, promise) {
37
- if (getClient() !== client) {
38
- return;
39
- }
40
-
41
- const level = options.mode === 'strict' ? 'fatal' : 'error';
42
-
43
- captureException(reason, {
44
- originalException: promise,
45
- captureContext: {
46
- extra: { unhandledPromiseRejection: true },
47
- level,
48
- },
49
- mechanism: {
50
- handled: false,
51
- type: 'onunhandledrejection',
52
- },
53
- });
54
-
55
- handleRejection(reason, options.mode);
56
- };
57
- }
58
-
59
- /**
60
- * Handler for `mode` option
61
- */
62
- function handleRejection(reason, mode) {
63
- // https://github.com/nodejs/node/blob/7cf6f9e964aa00772965391c23acda6d71972a9a/lib/internal/process/promises.js#L234-L240
64
- const rejectionWarning =
65
- 'This error originated either by ' +
66
- 'throwing inside of an async function without a catch block, ' +
67
- 'or by rejecting a promise which was not handled with .catch().' +
68
- ' The promise rejected with the reason:';
69
-
70
- /* eslint-disable no-console */
71
- if (mode === 'warn') {
72
- consoleSandbox(() => {
73
- console.warn(rejectionWarning);
74
- console.error(reason && typeof reason === 'object' && 'stack' in reason ? reason.stack : reason);
75
- });
76
- } else if (mode === 'strict') {
77
- consoleSandbox(() => {
78
- console.warn(rejectionWarning);
79
- });
80
- logAndExitProcess(reason);
81
- }
82
- /* eslint-enable no-console */
83
- }
84
-
85
- export { makeUnhandledPromiseHandler, onUnhandledRejectionIntegration };
86
- //# sourceMappingURL=onunhandledrejection.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"onunhandledrejection.js","sources":["../../../src/integrations/onunhandledrejection.ts"],"sourcesContent":["import type { Client, IntegrationFn, SeverityLevel } from '@sentry/core';\nimport { captureException, consoleSandbox, defineIntegration, getClient } from '@sentry/core';\nimport { logAndExitProcess } from '../utils/errorhandling';\n\ntype UnhandledRejectionMode = 'none' | 'warn' | 'strict';\n\ninterface OnUnhandledRejectionOptions {\n /**\n * Option deciding what to do after capturing unhandledRejection,\n * that mimicks behavior of node's --unhandled-rejection flag.\n */\n mode: UnhandledRejectionMode;\n}\n\nconst INTEGRATION_NAME = 'OnUnhandledRejection';\n\nconst _onUnhandledRejectionIntegration = ((options: Partial<OnUnhandledRejectionOptions> = {}) => {\n const opts = {\n mode: 'warn',\n ...options,\n } satisfies OnUnhandledRejectionOptions;\n\n return {\n name: INTEGRATION_NAME,\n setup(client) {\n global.process.on('unhandledRejection', makeUnhandledPromiseHandler(client, opts));\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Add a global promise rejection handler.\n */\nexport const onUnhandledRejectionIntegration = defineIntegration(_onUnhandledRejectionIntegration);\n\n/**\n * Send an exception with reason\n * @param reason string\n * @param promise promise\n *\n * Exported only for tests.\n */\nexport function makeUnhandledPromiseHandler(\n client: Client,\n options: OnUnhandledRejectionOptions,\n): (reason: unknown, promise: unknown) => void {\n return function sendUnhandledPromise(reason: unknown, promise: unknown): void {\n if (getClient() !== client) {\n return;\n }\n\n const level: SeverityLevel = options.mode === 'strict' ? 'fatal' : 'error';\n\n captureException(reason, {\n originalException: promise,\n captureContext: {\n extra: { unhandledPromiseRejection: true },\n level,\n },\n mechanism: {\n handled: false,\n type: 'onunhandledrejection',\n },\n });\n\n handleRejection(reason, options.mode);\n };\n}\n\n/**\n * Handler for `mode` option\n */\nfunction handleRejection(reason: unknown, mode: UnhandledRejectionMode): void {\n // https://github.com/nodejs/node/blob/7cf6f9e964aa00772965391c23acda6d71972a9a/lib/internal/process/promises.js#L234-L240\n const rejectionWarning =\n 'This error originated either by ' +\n 'throwing inside of an async function without a catch block, ' +\n 'or by rejecting a promise which was not handled with .catch().' +\n ' The promise rejected with the reason:';\n\n /* eslint-disable no-console */\n if (mode === 'warn') {\n consoleSandbox(() => {\n console.warn(rejectionWarning);\n console.error(reason && typeof reason === 'object' && 'stack' in reason ? reason.stack : reason);\n });\n } else if (mode === 'strict') {\n consoleSandbox(() => {\n console.warn(rejectionWarning);\n });\n logAndExitProcess(reason);\n }\n /* eslint-enable no-console */\n}\n"],"names":[],"mappings":";;;AAcA,MAAM,gBAAA,GAAmB,sBAAsB;;AAE/C,MAAM,gCAAA,IAAoC,CAAC,OAAO,GAAyC,EAAE,KAAK;AAClG,EAAE,MAAM,OAAO;AACf,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,GAAG,OAAO;AACd,GAAI;;AAEJ,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,KAAK,CAAC,MAAM,EAAE;AAClB,MAAM,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,oBAAoB,EAAE,2BAA2B,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AACxF,KAAK;AACL,GAAG;AACH,CAAC,CAAE;;AAEH;AACA;AACA;MACa,+BAAgC,GAAE,iBAAiB,CAAC,gCAAgC;;AAEjG;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,2BAA2B;AAC3C,EAAE,MAAM;AACR,EAAE,OAAO;AACT,EAA+C;AAC/C,EAAE,OAAO,SAAS,oBAAoB,CAAC,MAAM,EAAW,OAAO,EAAiB;AAChF,IAAI,IAAI,SAAS,EAAG,KAAI,MAAM,EAAE;AAChC,MAAM;AACN;;AAEA,IAAI,MAAM,KAAK,GAAkB,OAAO,CAAC,IAAK,KAAI,QAAS,GAAE,OAAQ,GAAE,OAAO;;AAE9E,IAAI,gBAAgB,CAAC,MAAM,EAAE;AAC7B,MAAM,iBAAiB,EAAE,OAAO;AAChC,MAAM,cAAc,EAAE;AACtB,QAAQ,KAAK,EAAE,EAAE,yBAAyB,EAAE,MAAM;AAClD,QAAQ,KAAK;AACb,OAAO;AACP,MAAM,SAAS,EAAE;AACjB,QAAQ,OAAO,EAAE,KAAK;AACtB,QAAQ,IAAI,EAAE,sBAAsB;AACpC,OAAO;AACP,KAAK,CAAC;;AAEN,IAAI,eAAe,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC;AACzC,GAAG;AACH;;AAEA;AACA;AACA;AACA,SAAS,eAAe,CAAC,MAAM,EAAW,IAAI,EAAgC;AAC9E;AACA,EAAE,MAAM,gBAAiB;AACzB,IAAI,kCAAmC;AACvC,IAAI,8DAA+D;AACnE,IAAI,gEAAiE;AACrE,IAAI,wCAAwC;;AAE5C;AACA,EAAE,IAAI,IAAK,KAAI,MAAM,EAAE;AACvB,IAAI,cAAc,CAAC,MAAM;AACzB,MAAM,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC;AACpC,MAAM,OAAO,CAAC,KAAK,CAAC,UAAU,OAAO,WAAW,QAAA,IAAY,OAAQ,IAAG,SAAS,MAAM,CAAC,KAAM,GAAE,MAAM,CAAC;AACtG,KAAK,CAAC;AACN,SAAS,IAAI,IAAK,KAAI,QAAQ,EAAE;AAChC,IAAI,cAAc,CAAC,MAAM;AACzB,MAAM,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC;AACpC,KAAK,CAAC;AACN,IAAI,iBAAiB,CAAC,MAAM,CAAC;AAC7B;AACA;AACA;;;;"}
@@ -1,34 +0,0 @@
1
- import { defineIntegration, startSession, getIsolationScope, endSession } from '@sentry/core';
2
-
3
- const INTEGRATION_NAME = 'ProcessSession';
4
-
5
- /**
6
- * Records a Session for the current process to track release health.
7
- */
8
- const processSessionIntegration = defineIntegration(() => {
9
- return {
10
- name: INTEGRATION_NAME,
11
- setupOnce() {
12
- startSession();
13
-
14
- // Emitted in the case of healthy sessions, error of `mechanism.handled: true` and unhandledrejections because
15
- // The 'beforeExit' event is not emitted for conditions causing explicit termination,
16
- // such as calling process.exit() or uncaught exceptions.
17
- // Ref: https://nodejs.org/api/process.html#process_event_beforeexit
18
- process.on('beforeExit', () => {
19
- const session = getIsolationScope().getSession();
20
-
21
- // Only call endSession, if the Session exists on Scope and SessionStatus is not a
22
- // Terminal Status i.e. Exited or Crashed because
23
- // "When a session is moved away from ok it must not be updated anymore."
24
- // Ref: https://develop.sentry.dev/sdk/sessions/
25
- if (session?.status !== 'ok') {
26
- endSession();
27
- }
28
- });
29
- },
30
- };
31
- });
32
-
33
- export { processSessionIntegration };
34
- //# sourceMappingURL=processSession.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"processSession.js","sources":["../../../src/integrations/processSession.ts"],"sourcesContent":["import { defineIntegration, endSession, getIsolationScope, startSession } from '@sentry/core';\n\nconst INTEGRATION_NAME = 'ProcessSession';\n\n/**\n * Records a Session for the current process to track release health.\n */\nexport const processSessionIntegration = defineIntegration(() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n startSession();\n\n // Emitted in the case of healthy sessions, error of `mechanism.handled: true` and unhandledrejections because\n // The 'beforeExit' event is not emitted for conditions causing explicit termination,\n // such as calling process.exit() or uncaught exceptions.\n // Ref: https://nodejs.org/api/process.html#process_event_beforeexit\n process.on('beforeExit', () => {\n const session = getIsolationScope().getSession();\n\n // Only call endSession, if the Session exists on Scope and SessionStatus is not a\n // Terminal Status i.e. Exited or Crashed because\n // \"When a session is moved away from ok it must not be updated anymore.\"\n // Ref: https://develop.sentry.dev/sdk/sessions/\n if (session?.status !== 'ok') {\n endSession();\n }\n });\n },\n };\n});\n"],"names":[],"mappings":";;AAEA,MAAM,gBAAA,GAAmB,gBAAgB;;AAEzC;AACA;AACA;MACa,yBAA0B,GAAE,iBAAiB,CAAC,MAAM;AACjE,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,GAAG;AAChB,MAAM,YAAY,EAAE;;AAEpB;AACA;AACA;AACA;AACA,MAAM,OAAO,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM;AACrC,QAAQ,MAAM,UAAU,iBAAiB,EAAE,CAAC,UAAU,EAAE;;AAExD;AACA;AACA;AACA;AACA,QAAQ,IAAI,OAAO,EAAE,MAAO,KAAI,IAAI,EAAE;AACtC,UAAU,UAAU,EAAE;AACtB;AACA,OAAO,CAAC;AACR,KAAK;AACL,GAAG;AACH,CAAC;;;;"}
@@ -1,98 +0,0 @@
1
- import * as http from 'node:http';
2
- import { defineIntegration, logger, serializeEnvelope, suppressTracing } from '@sentry/core';
3
-
4
- const INTEGRATION_NAME = 'Spotlight';
5
-
6
- const _spotlightIntegration = ((options = {}) => {
7
- const _options = {
8
- sidecarUrl: options.sidecarUrl || 'http://localhost:8969/stream',
9
- };
10
-
11
- return {
12
- name: INTEGRATION_NAME,
13
- setup(client) {
14
- if (
15
- typeof process === 'object' &&
16
- process.env &&
17
- process.env.NODE_ENV &&
18
- process.env.NODE_ENV !== 'development'
19
- ) {
20
- logger.warn("[Spotlight] It seems you're not in dev mode. Do you really want to have Spotlight enabled?");
21
- }
22
- connectToSpotlight(client, _options);
23
- },
24
- };
25
- }) ;
26
-
27
- /**
28
- * Use this integration to send errors and transactions to Spotlight.
29
- *
30
- * Learn more about spotlight at https://spotlightjs.com
31
- *
32
- * Important: This integration only works with Node 18 or newer.
33
- */
34
- const spotlightIntegration = defineIntegration(_spotlightIntegration);
35
-
36
- function connectToSpotlight(client, options) {
37
- const spotlightUrl = parseSidecarUrl(options.sidecarUrl);
38
- if (!spotlightUrl) {
39
- return;
40
- }
41
-
42
- let failedRequests = 0;
43
-
44
- client.on('beforeEnvelope', (envelope) => {
45
- if (failedRequests > 3) {
46
- logger.warn('[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests');
47
- return;
48
- }
49
-
50
- const serializedEnvelope = serializeEnvelope(envelope);
51
- suppressTracing(() => {
52
- const req = http.request(
53
- {
54
- method: 'POST',
55
- path: spotlightUrl.pathname,
56
- hostname: spotlightUrl.hostname,
57
- port: spotlightUrl.port,
58
- headers: {
59
- 'Content-Type': 'application/x-sentry-envelope',
60
- },
61
- },
62
- res => {
63
- if (res.statusCode && res.statusCode >= 200 && res.statusCode < 400) {
64
- // Reset failed requests counter on success
65
- failedRequests = 0;
66
- }
67
- res.on('data', () => {
68
- // Drain socket
69
- });
70
-
71
- res.on('end', () => {
72
- // Drain socket
73
- });
74
- res.setEncoding('utf8');
75
- },
76
- );
77
-
78
- req.on('error', () => {
79
- failedRequests++;
80
- logger.warn('[Spotlight] Failed to send envelope to Spotlight Sidecar');
81
- });
82
- req.write(serializedEnvelope);
83
- req.end();
84
- });
85
- });
86
- }
87
-
88
- function parseSidecarUrl(url) {
89
- try {
90
- return new URL(`${url}`);
91
- } catch {
92
- logger.warn(`[Spotlight] Invalid sidecar URL: ${url}`);
93
- return undefined;
94
- }
95
- }
96
-
97
- export { INTEGRATION_NAME, spotlightIntegration };
98
- //# sourceMappingURL=spotlight.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"spotlight.js","sources":["../../../src/integrations/spotlight.ts"],"sourcesContent":["import * as http from 'node:http';\nimport type { Client, Envelope, IntegrationFn } from '@sentry/core';\nimport { defineIntegration, logger, serializeEnvelope, suppressTracing } from '@sentry/core';\n\ntype SpotlightConnectionOptions = {\n /**\n * Set this if the Spotlight Sidecar is not running on localhost:8969\n * By default, the Url is set to http://localhost:8969/stream\n */\n sidecarUrl?: string;\n};\n\nexport const INTEGRATION_NAME = 'Spotlight';\n\nconst _spotlightIntegration = ((options: Partial<SpotlightConnectionOptions> = {}) => {\n const _options = {\n sidecarUrl: options.sidecarUrl || 'http://localhost:8969/stream',\n };\n\n return {\n name: INTEGRATION_NAME,\n setup(client) {\n if (\n typeof process === 'object' &&\n process.env &&\n process.env.NODE_ENV &&\n process.env.NODE_ENV !== 'development'\n ) {\n logger.warn(\"[Spotlight] It seems you're not in dev mode. Do you really want to have Spotlight enabled?\");\n }\n connectToSpotlight(client, _options);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Use this integration to send errors and transactions to Spotlight.\n *\n * Learn more about spotlight at https://spotlightjs.com\n *\n * Important: This integration only works with Node 18 or newer.\n */\nexport const spotlightIntegration = defineIntegration(_spotlightIntegration);\n\nfunction connectToSpotlight(client: Client, options: Required<SpotlightConnectionOptions>): void {\n const spotlightUrl = parseSidecarUrl(options.sidecarUrl);\n if (!spotlightUrl) {\n return;\n }\n\n let failedRequests = 0;\n\n client.on('beforeEnvelope', (envelope: Envelope) => {\n if (failedRequests > 3) {\n logger.warn('[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests');\n return;\n }\n\n const serializedEnvelope = serializeEnvelope(envelope);\n suppressTracing(() => {\n const req = http.request(\n {\n method: 'POST',\n path: spotlightUrl.pathname,\n hostname: spotlightUrl.hostname,\n port: spotlightUrl.port,\n headers: {\n 'Content-Type': 'application/x-sentry-envelope',\n },\n },\n res => {\n if (res.statusCode && res.statusCode >= 200 && res.statusCode < 400) {\n // Reset failed requests counter on success\n failedRequests = 0;\n }\n res.on('data', () => {\n // Drain socket\n });\n\n res.on('end', () => {\n // Drain socket\n });\n res.setEncoding('utf8');\n },\n );\n\n req.on('error', () => {\n failedRequests++;\n logger.warn('[Spotlight] Failed to send envelope to Spotlight Sidecar');\n });\n req.write(serializedEnvelope);\n req.end();\n });\n });\n}\n\nfunction parseSidecarUrl(url: string): URL | undefined {\n try {\n return new URL(`${url}`);\n } catch {\n logger.warn(`[Spotlight] Invalid sidecar URL: ${url}`);\n return undefined;\n }\n}\n"],"names":[],"mappings":"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"}
@@ -1,152 +0,0 @@
1
- /**
2
- * AI SDK Telemetry Attributes
3
- * Based on https://ai-sdk.dev/docs/ai-sdk-core/telemetry#collected-data
4
- */
5
-
6
-
7
- // =============================================================================
8
- // SHARED ATTRIBUTES
9
- // =============================================================================
10
-
11
- /**
12
- * `generateText` function - `ai.generateText` span
13
- * `streamText` function - `ai.streamText` span
14
- *
15
- * The prompt that was used when calling the function
16
- * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#generatetext-function
17
- * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#streamtext-function
18
- */
19
- const AI_PROMPT_ATTRIBUTE = 'ai.prompt';
20
-
21
- // =============================================================================
22
- // GENERATETEXT FUNCTION - UNIQUE ATTRIBUTES
23
- // =============================================================================
24
-
25
- /**
26
- * `generateText` function - `ai.generateText` span
27
- *
28
- * The text that was generated
29
- * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#generatetext-function
30
- */
31
- const AI_RESPONSE_TEXT_ATTRIBUTE = 'ai.response.text';
32
-
33
- /**
34
- * `generateText` function - `ai.generateText` span
35
- *
36
- * The tool calls that were made as part of the generation (stringified JSON)
37
- * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#generatetext-function
38
- */
39
- const AI_RESPONSE_TOOL_CALLS_ATTRIBUTE = 'ai.response.toolCalls';
40
-
41
- /**
42
- * `generateText` function - `ai.generateText.doGenerate` span
43
- *
44
- * The messages that were passed into the provider
45
- * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#generatetext-function
46
- */
47
- const AI_PROMPT_MESSAGES_ATTRIBUTE = 'ai.prompt.messages';
48
-
49
- /**
50
- * `generateText` function - `ai.generateText.doGenerate` span
51
- *
52
- * Array of stringified tool definitions
53
- * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#generatetext-function
54
- */
55
- const AI_PROMPT_TOOLS_ATTRIBUTE = 'ai.prompt.tools';
56
-
57
- /**
58
- * Basic LLM span information
59
- * Multiple spans
60
- *
61
- * The id of the model
62
- * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#basic-llm-span-information
63
- */
64
- const AI_MODEL_ID_ATTRIBUTE = 'ai.model.id';
65
-
66
- /**
67
- * Basic LLM span information
68
- * Multiple spans
69
- *
70
- * The provider of the model
71
- * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#basic-llm-span-information
72
- */
73
- const AI_MODEL_PROVIDER_ATTRIBUTE = 'ai.model.provider';
74
-
75
- /**
76
- * Basic LLM span information
77
- * Multiple spans
78
- *
79
- * The functionId that was set through `telemetry.functionId`
80
- * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#basic-llm-span-information
81
- */
82
- const AI_TELEMETRY_FUNCTION_ID_ATTRIBUTE = 'ai.telemetry.functionId';
83
-
84
- /**
85
- * Basic LLM span information
86
- * Multiple spans
87
- *
88
- * The number of completion tokens that were used
89
- * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#basic-llm-span-information
90
- */
91
- const AI_USAGE_COMPLETION_TOKENS_ATTRIBUTE = 'ai.usage.completionTokens';
92
-
93
- /**
94
- * Basic LLM span information
95
- * Multiple spans
96
- *
97
- * The number of prompt tokens that were used
98
- * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#basic-llm-span-information
99
- */
100
- const AI_USAGE_PROMPT_TOKENS_ATTRIBUTE = 'ai.usage.promptTokens';
101
-
102
- /**
103
- * Semantic Conventions for GenAI operations
104
- * Individual LLM call spans
105
- *
106
- * The model that was used to generate the response
107
- * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#call-llm-span-information
108
- */
109
- const GEN_AI_RESPONSE_MODEL_ATTRIBUTE = 'gen_ai.response.model';
110
-
111
- /**
112
- * Semantic Conventions for GenAI operations
113
- * Individual LLM call spans
114
- *
115
- * The number of prompt tokens that were used
116
- * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#call-llm-span-information
117
- */
118
- const GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE = 'gen_ai.usage.input_tokens';
119
-
120
- /**
121
- * Semantic Conventions for GenAI operations
122
- * Individual LLM call spans
123
- *
124
- * The number of completion tokens that were used
125
- * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#call-llm-span-information
126
- */
127
- const GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE = 'gen_ai.usage.output_tokens';
128
-
129
- // =============================================================================
130
- // TOOL CALL SPANS
131
- // =============================================================================
132
-
133
- /**
134
- * Tool call spans
135
- * `ai.toolCall` span
136
- *
137
- * The name of the tool
138
- * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#tool-call-spans
139
- */
140
- const AI_TOOL_CALL_NAME_ATTRIBUTE = 'ai.toolCall.name';
141
-
142
- /**
143
- * Tool call spans
144
- * `ai.toolCall` span
145
- *
146
- * The id of the tool call
147
- * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#tool-call-spans
148
- */
149
- const AI_TOOL_CALL_ID_ATTRIBUTE = 'ai.toolCall.id';
150
-
151
- export { AI_MODEL_ID_ATTRIBUTE, AI_MODEL_PROVIDER_ATTRIBUTE, AI_PROMPT_ATTRIBUTE, AI_PROMPT_MESSAGES_ATTRIBUTE, AI_PROMPT_TOOLS_ATTRIBUTE, AI_RESPONSE_TEXT_ATTRIBUTE, AI_RESPONSE_TOOL_CALLS_ATTRIBUTE, AI_TELEMETRY_FUNCTION_ID_ATTRIBUTE, AI_TOOL_CALL_ID_ATTRIBUTE, AI_TOOL_CALL_NAME_ATTRIBUTE, AI_USAGE_COMPLETION_TOKENS_ATTRIBUTE, AI_USAGE_PROMPT_TOKENS_ATTRIBUTE, GEN_AI_RESPONSE_MODEL_ATTRIBUTE, GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE, GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE };
152
- //# sourceMappingURL=ai_sdk_attributes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ai_sdk_attributes.js","sources":["../../../../../src/integrations/tracing/vercelai/ai_sdk_attributes.ts"],"sourcesContent":["/**\n * AI SDK Telemetry Attributes\n * Based on https://ai-sdk.dev/docs/ai-sdk-core/telemetry#collected-data\n */\n\n// =============================================================================\n// COMMON ATTRIBUTES\n// =============================================================================\n\n/**\n * Common attribute for operation name across all functions and spans\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#collected-data\n */\nexport const OPERATION_NAME_ATTRIBUTE = 'operation.name';\n\n/**\n * Common attribute for AI operation ID across all functions and spans\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#collected-data\n */\nexport const AI_OPERATION_ID_ATTRIBUTE = 'ai.operationId';\n\n// =============================================================================\n// SHARED ATTRIBUTES\n// =============================================================================\n\n/**\n * `generateText` function - `ai.generateText` span\n * `streamText` function - `ai.streamText` span\n *\n * The prompt that was used when calling the function\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#generatetext-function\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#streamtext-function\n */\nexport const AI_PROMPT_ATTRIBUTE = 'ai.prompt';\n\n/**\n * `generateObject` function - `ai.generateObject` span\n * `streamObject` function - `ai.streamObject` span\n *\n * The JSON schema version of the schema that was passed into the function\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#generateobject-function\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#streamobject-function\n */\nexport const AI_SCHEMA_ATTRIBUTE = 'ai.schema';\n\n/**\n * `generateObject` function - `ai.generateObject` span\n * `streamObject` function - `ai.streamObject` span\n *\n * The name of the schema that was passed into the function\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#generateobject-function\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#streamobject-function\n */\nexport const AI_SCHEMA_NAME_ATTRIBUTE = 'ai.schema.name';\n\n/**\n * `generateObject` function - `ai.generateObject` span\n * `streamObject` function - `ai.streamObject` span\n *\n * The description of the schema that was passed into the function\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#generateobject-function\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#streamobject-function\n */\nexport const AI_SCHEMA_DESCRIPTION_ATTRIBUTE = 'ai.schema.description';\n\n/**\n * `generateObject` function - `ai.generateObject` span\n * `streamObject` function - `ai.streamObject` span\n *\n * The object that was generated (stringified JSON)\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#generateobject-function\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#streamobject-function\n */\nexport const AI_RESPONSE_OBJECT_ATTRIBUTE = 'ai.response.object';\n\n/**\n * `generateObject` function - `ai.generateObject` span\n * `streamObject` function - `ai.streamObject` span\n *\n * The object generation mode, e.g. `json`\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#generateobject-function\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#streamobject-function\n */\nexport const AI_SETTINGS_MODE_ATTRIBUTE = 'ai.settings.mode';\n\n/**\n * `generateObject` function - `ai.generateObject` span\n * `streamObject` function - `ai.streamObject` span\n *\n * The output type that was used, e.g. `object` or `no-schema`\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#generateobject-function\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#streamobject-function\n */\nexport const AI_SETTINGS_OUTPUT_ATTRIBUTE = 'ai.settings.output';\n\n/**\n * `embed` function - `ai.embed.doEmbed` span\n * `embedMany` function - `ai.embedMany` span\n *\n * The values that were passed into the function (array)\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#embed-function\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#embedmany-function\n */\nexport const AI_VALUES_ATTRIBUTE = 'ai.values';\n\n/**\n * `embed` function - `ai.embed.doEmbed` span\n * `embedMany` function - `ai.embedMany` span\n *\n * An array of JSON-stringified embeddings\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#embed-function\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#embedmany-function\n */\nexport const AI_EMBEDDINGS_ATTRIBUTE = 'ai.embeddings';\n\n// =============================================================================\n// GENERATETEXT FUNCTION - UNIQUE ATTRIBUTES\n// =============================================================================\n\n/**\n * `generateText` function - `ai.generateText` span\n *\n * The text that was generated\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#generatetext-function\n */\nexport const AI_RESPONSE_TEXT_ATTRIBUTE = 'ai.response.text';\n\n/**\n * `generateText` function - `ai.generateText` span\n *\n * The tool calls that were made as part of the generation (stringified JSON)\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#generatetext-function\n */\nexport const AI_RESPONSE_TOOL_CALLS_ATTRIBUTE = 'ai.response.toolCalls';\n\n/**\n * `generateText` function - `ai.generateText` span\n *\n * The reason why the generation finished\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#generatetext-function\n */\nexport const AI_RESPONSE_FINISH_REASON_ATTRIBUTE = 'ai.response.finishReason';\n\n/**\n * `generateText` function - `ai.generateText` span\n *\n * The maximum number of steps that were set\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#generatetext-function\n */\nexport const AI_SETTINGS_MAX_STEPS_ATTRIBUTE = 'ai.settings.maxSteps';\n\n/**\n * `generateText` function - `ai.generateText.doGenerate` span\n *\n * The format of the prompt\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#generatetext-function\n */\nexport const AI_PROMPT_FORMAT_ATTRIBUTE = 'ai.prompt.format';\n\n/**\n * `generateText` function - `ai.generateText.doGenerate` span\n *\n * The messages that were passed into the provider\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#generatetext-function\n */\nexport const AI_PROMPT_MESSAGES_ATTRIBUTE = 'ai.prompt.messages';\n\n/**\n * `generateText` function - `ai.generateText.doGenerate` span\n *\n * Array of stringified tool definitions\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#generatetext-function\n */\nexport const AI_PROMPT_TOOLS_ATTRIBUTE = 'ai.prompt.tools';\n\n/**\n * `generateText` function - `ai.generateText.doGenerate` span\n *\n * The stringified tool choice setting (JSON)\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#generatetext-function\n */\nexport const AI_PROMPT_TOOL_CHOICE_ATTRIBUTE = 'ai.prompt.toolChoice';\n\n// =============================================================================\n// STREAMTEXT FUNCTION - UNIQUE ATTRIBUTES\n// =============================================================================\n\n/**\n * `streamText` function - `ai.streamText.doStream` span\n *\n * The time it took to receive the first chunk in milliseconds\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#streamtext-function\n */\nexport const AI_RESPONSE_MS_TO_FIRST_CHUNK_ATTRIBUTE = 'ai.response.msToFirstChunk';\n\n/**\n * `streamText` function - `ai.streamText.doStream` span\n *\n * The time it took to receive the finish part of the LLM stream in milliseconds\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#streamtext-function\n */\nexport const AI_RESPONSE_MS_TO_FINISH_ATTRIBUTE = 'ai.response.msToFinish';\n\n/**\n * `streamText` function - `ai.streamText.doStream` span\n *\n * The average completion tokens per second\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#streamtext-function\n */\nexport const AI_RESPONSE_AVG_COMPLETION_TOKENS_PER_SECOND_ATTRIBUTE = 'ai.response.avgCompletionTokensPerSecond';\n\n// =============================================================================\n// EMBED FUNCTION - UNIQUE ATTRIBUTES\n// =============================================================================\n\n/**\n * `embed` function - `ai.embed` span\n *\n * The value that was passed into the `embed` function\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#embed-function\n */\nexport const AI_VALUE_ATTRIBUTE = 'ai.value';\n\n/**\n * `embed` function - `ai.embed` span\n *\n * A JSON-stringified embedding\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#embed-function\n */\nexport const AI_EMBEDDING_ATTRIBUTE = 'ai.embedding';\n\n// =============================================================================\n// BASIC LLM SPAN INFORMATION\n// =============================================================================\n\n/**\n * Basic LLM span information\n * Multiple spans\n *\n * The functionId that was set through `telemetry.functionId`\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#basic-llm-span-information\n */\nexport const RESOURCE_NAME_ATTRIBUTE = 'resource.name';\n\n/**\n * Basic LLM span information\n * Multiple spans\n *\n * The id of the model\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#basic-llm-span-information\n */\nexport const AI_MODEL_ID_ATTRIBUTE = 'ai.model.id';\n\n/**\n * Basic LLM span information\n * Multiple spans\n *\n * The provider of the model\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#basic-llm-span-information\n */\nexport const AI_MODEL_PROVIDER_ATTRIBUTE = 'ai.model.provider';\n\n/**\n * Basic LLM span information\n * Multiple spans\n *\n * The request headers that were passed in through `headers`\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#basic-llm-span-information\n */\nexport const AI_REQUEST_HEADERS_ATTRIBUTE = 'ai.request.headers';\n\n/**\n * Basic LLM span information\n * Multiple spans\n *\n * The maximum number of retries that were set\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#basic-llm-span-information\n */\nexport const AI_SETTINGS_MAX_RETRIES_ATTRIBUTE = 'ai.settings.maxRetries';\n\n/**\n * Basic LLM span information\n * Multiple spans\n *\n * The functionId that was set through `telemetry.functionId`\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#basic-llm-span-information\n */\nexport const AI_TELEMETRY_FUNCTION_ID_ATTRIBUTE = 'ai.telemetry.functionId';\n\n/**\n * Basic LLM span information\n * Multiple spans\n *\n * The metadata that was passed in through `telemetry.metadata`\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#basic-llm-span-information\n */\nexport const AI_TELEMETRY_METADATA_ATTRIBUTE = 'ai.telemetry.metadata';\n\n/**\n * Basic LLM span information\n * Multiple spans\n *\n * The number of completion tokens that were used\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#basic-llm-span-information\n */\nexport const AI_USAGE_COMPLETION_TOKENS_ATTRIBUTE = 'ai.usage.completionTokens';\n\n/**\n * Basic LLM span information\n * Multiple spans\n *\n * The number of prompt tokens that were used\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#basic-llm-span-information\n */\nexport const AI_USAGE_PROMPT_TOKENS_ATTRIBUTE = 'ai.usage.promptTokens';\n\n// =============================================================================\n// CALL LLM SPAN INFORMATION\n// =============================================================================\n\n/**\n * Call LLM span information\n * Individual LLM call spans\n *\n * The model that was used to generate the response\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#call-llm-span-information\n */\nexport const AI_RESPONSE_MODEL_ATTRIBUTE = 'ai.response.model';\n\n/**\n * Call LLM span information\n * Individual LLM call spans\n *\n * The id of the response\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#call-llm-span-information\n */\nexport const AI_RESPONSE_ID_ATTRIBUTE = 'ai.response.id';\n\n/**\n * Call LLM span information\n * Individual LLM call spans\n *\n * The timestamp of the response\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#call-llm-span-information\n */\nexport const AI_RESPONSE_TIMESTAMP_ATTRIBUTE = 'ai.response.timestamp';\n\n// =============================================================================\n// SEMANTIC CONVENTIONS FOR GENAI OPERATIONS\n// =============================================================================\n\n/**\n * Semantic Conventions for GenAI operations\n * Individual LLM call spans\n *\n * The provider that was used\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#call-llm-span-information\n */\nexport const GEN_AI_SYSTEM_ATTRIBUTE = 'gen_ai.system';\n\n/**\n * Semantic Conventions for GenAI operations\n * Individual LLM call spans\n *\n * The model that was requested\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#call-llm-span-information\n */\nexport const GEN_AI_REQUEST_MODEL_ATTRIBUTE = 'gen_ai.request.model';\n\n/**\n * Semantic Conventions for GenAI operations\n * Individual LLM call spans\n *\n * The temperature that was set\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#call-llm-span-information\n */\nexport const GEN_AI_REQUEST_TEMPERATURE_ATTRIBUTE = 'gen_ai.request.temperature';\n\n/**\n * Semantic Conventions for GenAI operations\n * Individual LLM call spans\n *\n * The maximum number of tokens that were set\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#call-llm-span-information\n */\nexport const GEN_AI_REQUEST_MAX_TOKENS_ATTRIBUTE = 'gen_ai.request.max_tokens';\n\n/**\n * Semantic Conventions for GenAI operations\n * Individual LLM call spans\n *\n * The frequency penalty that was set\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#call-llm-span-information\n */\nexport const GEN_AI_REQUEST_FREQUENCY_PENALTY_ATTRIBUTE = 'gen_ai.request.frequency_penalty';\n\n/**\n * Semantic Conventions for GenAI operations\n * Individual LLM call spans\n *\n * The presence penalty that was set\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#call-llm-span-information\n */\nexport const GEN_AI_REQUEST_PRESENCE_PENALTY_ATTRIBUTE = 'gen_ai.request.presence_penalty';\n\n/**\n * Semantic Conventions for GenAI operations\n * Individual LLM call spans\n *\n * The topK parameter value that was set\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#call-llm-span-information\n */\nexport const GEN_AI_REQUEST_TOP_K_ATTRIBUTE = 'gen_ai.request.top_k';\n\n/**\n * Semantic Conventions for GenAI operations\n * Individual LLM call spans\n *\n * The topP parameter value that was set\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#call-llm-span-information\n */\nexport const GEN_AI_REQUEST_TOP_P_ATTRIBUTE = 'gen_ai.request.top_p';\n\n/**\n * Semantic Conventions for GenAI operations\n * Individual LLM call spans\n *\n * The stop sequences\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#call-llm-span-information\n */\nexport const GEN_AI_REQUEST_STOP_SEQUENCES_ATTRIBUTE = 'gen_ai.request.stop_sequences';\n\n/**\n * Semantic Conventions for GenAI operations\n * Individual LLM call spans\n *\n * The finish reasons that were returned by the provider\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#call-llm-span-information\n */\nexport const GEN_AI_RESPONSE_FINISH_REASONS_ATTRIBUTE = 'gen_ai.response.finish_reasons';\n\n/**\n * Semantic Conventions for GenAI operations\n * Individual LLM call spans\n *\n * The model that was used to generate the response\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#call-llm-span-information\n */\nexport const GEN_AI_RESPONSE_MODEL_ATTRIBUTE = 'gen_ai.response.model';\n\n/**\n * Semantic Conventions for GenAI operations\n * Individual LLM call spans\n *\n * The id of the response\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#call-llm-span-information\n */\nexport const GEN_AI_RESPONSE_ID_ATTRIBUTE = 'gen_ai.response.id';\n\n/**\n * Semantic Conventions for GenAI operations\n * Individual LLM call spans\n *\n * The number of prompt tokens that were used\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#call-llm-span-information\n */\nexport const GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE = 'gen_ai.usage.input_tokens';\n\n/**\n * Semantic Conventions for GenAI operations\n * Individual LLM call spans\n *\n * The number of completion tokens that were used\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#call-llm-span-information\n */\nexport const GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE = 'gen_ai.usage.output_tokens';\n\n// =============================================================================\n// BASIC EMBEDDING SPAN INFORMATION\n// =============================================================================\n\n/**\n * Basic embedding span information\n * Embedding spans\n *\n * The number of tokens that were used\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#basic-embedding-span-information\n */\nexport const AI_USAGE_TOKENS_ATTRIBUTE = 'ai.usage.tokens';\n\n// =============================================================================\n// TOOL CALL SPANS\n// =============================================================================\n\n/**\n * Tool call spans\n * `ai.toolCall` span\n *\n * The name of the tool\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#tool-call-spans\n */\nexport const AI_TOOL_CALL_NAME_ATTRIBUTE = 'ai.toolCall.name';\n\n/**\n * Tool call spans\n * `ai.toolCall` span\n *\n * The id of the tool call\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#tool-call-spans\n */\nexport const AI_TOOL_CALL_ID_ATTRIBUTE = 'ai.toolCall.id';\n\n/**\n * Tool call spans\n * `ai.toolCall` span\n *\n * The parameters of the tool call\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#tool-call-spans\n */\nexport const AI_TOOL_CALL_ARGS_ATTRIBUTE = 'ai.toolCall.args';\n\n/**\n * Tool call spans\n * `ai.toolCall` span\n *\n * The result of the tool call\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#tool-call-spans\n */\nexport const AI_TOOL_CALL_RESULT_ATTRIBUTE = 'ai.toolCall.result';\n\n// =============================================================================\n// SPAN ATTRIBUTE OBJECTS\n// =============================================================================\n\n/**\n * Attributes collected for `ai.generateText` span\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#generatetext-function\n */\nexport const AI_GENERATE_TEXT_SPAN_ATTRIBUTES = {\n OPERATION_NAME: OPERATION_NAME_ATTRIBUTE,\n AI_OPERATION_ID: AI_OPERATION_ID_ATTRIBUTE,\n AI_PROMPT: AI_PROMPT_ATTRIBUTE,\n AI_RESPONSE_TEXT: AI_RESPONSE_TEXT_ATTRIBUTE,\n AI_RESPONSE_TOOL_CALLS: AI_RESPONSE_TOOL_CALLS_ATTRIBUTE,\n AI_RESPONSE_FINISH_REASON: AI_RESPONSE_FINISH_REASON_ATTRIBUTE,\n AI_SETTINGS_MAX_STEPS: AI_SETTINGS_MAX_STEPS_ATTRIBUTE,\n // Basic LLM span information\n RESOURCE_NAME: RESOURCE_NAME_ATTRIBUTE,\n AI_MODEL_ID: AI_MODEL_ID_ATTRIBUTE,\n AI_MODEL_PROVIDER: AI_MODEL_PROVIDER_ATTRIBUTE,\n AI_REQUEST_HEADERS: AI_REQUEST_HEADERS_ATTRIBUTE,\n AI_SETTINGS_MAX_RETRIES: AI_SETTINGS_MAX_RETRIES_ATTRIBUTE,\n AI_TELEMETRY_FUNCTION_ID: AI_TELEMETRY_FUNCTION_ID_ATTRIBUTE,\n AI_TELEMETRY_METADATA: AI_TELEMETRY_METADATA_ATTRIBUTE,\n AI_USAGE_COMPLETION_TOKENS: AI_USAGE_COMPLETION_TOKENS_ATTRIBUTE,\n AI_USAGE_PROMPT_TOKENS: AI_USAGE_PROMPT_TOKENS_ATTRIBUTE,\n} as const;\n\n/**\n * Attributes collected for `ai.generateText.doGenerate` span\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#generatetext-function\n */\nexport const AI_GENERATE_TEXT_DO_GENERATE_SPAN_ATTRIBUTES = {\n OPERATION_NAME: OPERATION_NAME_ATTRIBUTE,\n AI_OPERATION_ID: AI_OPERATION_ID_ATTRIBUTE,\n AI_PROMPT_FORMAT: AI_PROMPT_FORMAT_ATTRIBUTE,\n AI_PROMPT_MESSAGES: AI_PROMPT_MESSAGES_ATTRIBUTE,\n AI_PROMPT_TOOLS: AI_PROMPT_TOOLS_ATTRIBUTE,\n AI_PROMPT_TOOL_CHOICE: AI_PROMPT_TOOL_CHOICE_ATTRIBUTE,\n // Basic LLM span information\n RESOURCE_NAME: RESOURCE_NAME_ATTRIBUTE,\n AI_MODEL_ID: AI_MODEL_ID_ATTRIBUTE,\n AI_MODEL_PROVIDER: AI_MODEL_PROVIDER_ATTRIBUTE,\n AI_REQUEST_HEADERS: AI_REQUEST_HEADERS_ATTRIBUTE,\n AI_SETTINGS_MAX_RETRIES: AI_SETTINGS_MAX_RETRIES_ATTRIBUTE,\n AI_TELEMETRY_FUNCTION_ID: AI_TELEMETRY_FUNCTION_ID_ATTRIBUTE,\n AI_TELEMETRY_METADATA: AI_TELEMETRY_METADATA_ATTRIBUTE,\n AI_USAGE_COMPLETION_TOKENS: AI_USAGE_COMPLETION_TOKENS_ATTRIBUTE,\n AI_USAGE_PROMPT_TOKENS: AI_USAGE_PROMPT_TOKENS_ATTRIBUTE,\n // Call LLM span information\n AI_RESPONSE_MODEL: AI_RESPONSE_MODEL_ATTRIBUTE,\n AI_RESPONSE_ID: AI_RESPONSE_ID_ATTRIBUTE,\n AI_RESPONSE_TIMESTAMP: AI_RESPONSE_TIMESTAMP_ATTRIBUTE,\n // Semantic Conventions for GenAI operations\n GEN_AI_SYSTEM: GEN_AI_SYSTEM_ATTRIBUTE,\n GEN_AI_REQUEST_MODEL: GEN_AI_REQUEST_MODEL_ATTRIBUTE,\n GEN_AI_REQUEST_TEMPERATURE: GEN_AI_REQUEST_TEMPERATURE_ATTRIBUTE,\n GEN_AI_REQUEST_MAX_TOKENS: GEN_AI_REQUEST_MAX_TOKENS_ATTRIBUTE,\n GEN_AI_REQUEST_FREQUENCY_PENALTY: GEN_AI_REQUEST_FREQUENCY_PENALTY_ATTRIBUTE,\n GEN_AI_REQUEST_PRESENCE_PENALTY: GEN_AI_REQUEST_PRESENCE_PENALTY_ATTRIBUTE,\n GEN_AI_REQUEST_TOP_K: GEN_AI_REQUEST_TOP_K_ATTRIBUTE,\n GEN_AI_REQUEST_TOP_P: GEN_AI_REQUEST_TOP_P_ATTRIBUTE,\n GEN_AI_REQUEST_STOP_SEQUENCES: GEN_AI_REQUEST_STOP_SEQUENCES_ATTRIBUTE,\n GEN_AI_RESPONSE_FINISH_REASONS: GEN_AI_RESPONSE_FINISH_REASONS_ATTRIBUTE,\n GEN_AI_RESPONSE_MODEL: GEN_AI_RESPONSE_MODEL_ATTRIBUTE,\n GEN_AI_RESPONSE_ID: GEN_AI_RESPONSE_ID_ATTRIBUTE,\n GEN_AI_USAGE_INPUT_TOKENS: GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE,\n GEN_AI_USAGE_OUTPUT_TOKENS: GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE,\n} as const;\n\n/**\n * Attributes collected for `ai.streamText` span\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#streamtext-function\n */\nexport const AI_STREAM_TEXT_SPAN_ATTRIBUTES = {\n OPERATION_NAME: OPERATION_NAME_ATTRIBUTE,\n AI_OPERATION_ID: AI_OPERATION_ID_ATTRIBUTE,\n AI_PROMPT: AI_PROMPT_ATTRIBUTE,\n // Basic LLM span information\n RESOURCE_NAME: RESOURCE_NAME_ATTRIBUTE,\n AI_MODEL_ID: AI_MODEL_ID_ATTRIBUTE,\n AI_MODEL_PROVIDER: AI_MODEL_PROVIDER_ATTRIBUTE,\n AI_REQUEST_HEADERS: AI_REQUEST_HEADERS_ATTRIBUTE,\n AI_SETTINGS_MAX_RETRIES: AI_SETTINGS_MAX_RETRIES_ATTRIBUTE,\n AI_TELEMETRY_FUNCTION_ID: AI_TELEMETRY_FUNCTION_ID_ATTRIBUTE,\n AI_TELEMETRY_METADATA: AI_TELEMETRY_METADATA_ATTRIBUTE,\n AI_USAGE_COMPLETION_TOKENS: AI_USAGE_COMPLETION_TOKENS_ATTRIBUTE,\n AI_USAGE_PROMPT_TOKENS: AI_USAGE_PROMPT_TOKENS_ATTRIBUTE,\n} as const;\n\n/**\n * Attributes collected for `ai.streamText.doStream` span\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#streamtext-function\n */\nexport const AI_STREAM_TEXT_DO_STREAM_SPAN_ATTRIBUTES = {\n OPERATION_NAME: OPERATION_NAME_ATTRIBUTE,\n AI_OPERATION_ID: AI_OPERATION_ID_ATTRIBUTE,\n AI_RESPONSE_MS_TO_FIRST_CHUNK: AI_RESPONSE_MS_TO_FIRST_CHUNK_ATTRIBUTE,\n AI_RESPONSE_MS_TO_FINISH: AI_RESPONSE_MS_TO_FINISH_ATTRIBUTE,\n AI_RESPONSE_AVG_COMPLETION_TOKENS_PER_SECOND: AI_RESPONSE_AVG_COMPLETION_TOKENS_PER_SECOND_ATTRIBUTE,\n // Basic LLM span information\n RESOURCE_NAME: RESOURCE_NAME_ATTRIBUTE,\n AI_MODEL_ID: AI_MODEL_ID_ATTRIBUTE,\n AI_MODEL_PROVIDER: AI_MODEL_PROVIDER_ATTRIBUTE,\n AI_REQUEST_HEADERS: AI_REQUEST_HEADERS_ATTRIBUTE,\n AI_SETTINGS_MAX_RETRIES: AI_SETTINGS_MAX_RETRIES_ATTRIBUTE,\n AI_TELEMETRY_FUNCTION_ID: AI_TELEMETRY_FUNCTION_ID_ATTRIBUTE,\n AI_TELEMETRY_METADATA: AI_TELEMETRY_METADATA_ATTRIBUTE,\n AI_USAGE_COMPLETION_TOKENS: AI_USAGE_COMPLETION_TOKENS_ATTRIBUTE,\n AI_USAGE_PROMPT_TOKENS: AI_USAGE_PROMPT_TOKENS_ATTRIBUTE,\n // Call LLM span information\n AI_RESPONSE_MODEL: AI_RESPONSE_MODEL_ATTRIBUTE,\n AI_RESPONSE_ID: AI_RESPONSE_ID_ATTRIBUTE,\n AI_RESPONSE_TIMESTAMP: AI_RESPONSE_TIMESTAMP_ATTRIBUTE,\n // Semantic Conventions for GenAI operations\n GEN_AI_SYSTEM: GEN_AI_SYSTEM_ATTRIBUTE,\n GEN_AI_REQUEST_MODEL: GEN_AI_REQUEST_MODEL_ATTRIBUTE,\n GEN_AI_REQUEST_TEMPERATURE: GEN_AI_REQUEST_TEMPERATURE_ATTRIBUTE,\n GEN_AI_REQUEST_MAX_TOKENS: GEN_AI_REQUEST_MAX_TOKENS_ATTRIBUTE,\n GEN_AI_REQUEST_FREQUENCY_PENALTY: GEN_AI_REQUEST_FREQUENCY_PENALTY_ATTRIBUTE,\n GEN_AI_REQUEST_PRESENCE_PENALTY: GEN_AI_REQUEST_PRESENCE_PENALTY_ATTRIBUTE,\n GEN_AI_REQUEST_TOP_K: GEN_AI_REQUEST_TOP_K_ATTRIBUTE,\n GEN_AI_REQUEST_TOP_P: GEN_AI_REQUEST_TOP_P_ATTRIBUTE,\n GEN_AI_REQUEST_STOP_SEQUENCES: GEN_AI_REQUEST_STOP_SEQUENCES_ATTRIBUTE,\n GEN_AI_RESPONSE_FINISH_REASONS: GEN_AI_RESPONSE_FINISH_REASONS_ATTRIBUTE,\n GEN_AI_RESPONSE_MODEL: GEN_AI_RESPONSE_MODEL_ATTRIBUTE,\n GEN_AI_RESPONSE_ID: GEN_AI_RESPONSE_ID_ATTRIBUTE,\n GEN_AI_USAGE_INPUT_TOKENS: GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE,\n GEN_AI_USAGE_OUTPUT_TOKENS: GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE,\n} as const;\n\n/**\n * Attributes collected for `ai.generateObject` span\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#generateobject-function\n */\nexport const AI_GENERATE_OBJECT_SPAN_ATTRIBUTES = {\n OPERATION_NAME: OPERATION_NAME_ATTRIBUTE,\n AI_OPERATION_ID: AI_OPERATION_ID_ATTRIBUTE,\n AI_SCHEMA: AI_SCHEMA_ATTRIBUTE,\n AI_SCHEMA_NAME: AI_SCHEMA_NAME_ATTRIBUTE,\n AI_SCHEMA_DESCRIPTION: AI_SCHEMA_DESCRIPTION_ATTRIBUTE,\n AI_RESPONSE_OBJECT: AI_RESPONSE_OBJECT_ATTRIBUTE,\n AI_SETTINGS_MODE: AI_SETTINGS_MODE_ATTRIBUTE,\n AI_SETTINGS_OUTPUT: AI_SETTINGS_OUTPUT_ATTRIBUTE,\n // Basic LLM span information\n RESOURCE_NAME: RESOURCE_NAME_ATTRIBUTE,\n AI_MODEL_ID: AI_MODEL_ID_ATTRIBUTE,\n AI_MODEL_PROVIDER: AI_MODEL_PROVIDER_ATTRIBUTE,\n AI_REQUEST_HEADERS: AI_REQUEST_HEADERS_ATTRIBUTE,\n AI_SETTINGS_MAX_RETRIES: AI_SETTINGS_MAX_RETRIES_ATTRIBUTE,\n AI_TELEMETRY_FUNCTION_ID: AI_TELEMETRY_FUNCTION_ID_ATTRIBUTE,\n AI_TELEMETRY_METADATA: AI_TELEMETRY_METADATA_ATTRIBUTE,\n AI_USAGE_COMPLETION_TOKENS: AI_USAGE_COMPLETION_TOKENS_ATTRIBUTE,\n AI_USAGE_PROMPT_TOKENS: AI_USAGE_PROMPT_TOKENS_ATTRIBUTE,\n} as const;\n\n/**\n * Attributes collected for `ai.streamObject` span\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#streamobject-function\n */\nexport const AI_STREAM_OBJECT_SPAN_ATTRIBUTES = {\n OPERATION_NAME: OPERATION_NAME_ATTRIBUTE,\n AI_OPERATION_ID: AI_OPERATION_ID_ATTRIBUTE,\n AI_SCHEMA: AI_SCHEMA_ATTRIBUTE,\n AI_SCHEMA_NAME: AI_SCHEMA_NAME_ATTRIBUTE,\n AI_SCHEMA_DESCRIPTION: AI_SCHEMA_DESCRIPTION_ATTRIBUTE,\n AI_RESPONSE_OBJECT: AI_RESPONSE_OBJECT_ATTRIBUTE,\n AI_SETTINGS_MODE: AI_SETTINGS_MODE_ATTRIBUTE,\n AI_SETTINGS_OUTPUT: AI_SETTINGS_OUTPUT_ATTRIBUTE,\n // Basic LLM span information\n RESOURCE_NAME: RESOURCE_NAME_ATTRIBUTE,\n AI_MODEL_ID: AI_MODEL_ID_ATTRIBUTE,\n AI_MODEL_PROVIDER: AI_MODEL_PROVIDER_ATTRIBUTE,\n AI_REQUEST_HEADERS: AI_REQUEST_HEADERS_ATTRIBUTE,\n AI_SETTINGS_MAX_RETRIES: AI_SETTINGS_MAX_RETRIES_ATTRIBUTE,\n AI_TELEMETRY_FUNCTION_ID: AI_TELEMETRY_FUNCTION_ID_ATTRIBUTE,\n AI_TELEMETRY_METADATA: AI_TELEMETRY_METADATA_ATTRIBUTE,\n AI_USAGE_COMPLETION_TOKENS: AI_USAGE_COMPLETION_TOKENS_ATTRIBUTE,\n AI_USAGE_PROMPT_TOKENS: AI_USAGE_PROMPT_TOKENS_ATTRIBUTE,\n} as const;\n\n/**\n * Attributes collected for `ai.embed` span\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#embed-function\n */\nexport const AI_EMBED_SPAN_ATTRIBUTES = {\n OPERATION_NAME: OPERATION_NAME_ATTRIBUTE,\n AI_OPERATION_ID: AI_OPERATION_ID_ATTRIBUTE,\n AI_VALUE: AI_VALUE_ATTRIBUTE,\n AI_EMBEDDING: AI_EMBEDDING_ATTRIBUTE,\n // Basic LLM span information\n RESOURCE_NAME: RESOURCE_NAME_ATTRIBUTE,\n AI_MODEL_ID: AI_MODEL_ID_ATTRIBUTE,\n AI_MODEL_PROVIDER: AI_MODEL_PROVIDER_ATTRIBUTE,\n AI_REQUEST_HEADERS: AI_REQUEST_HEADERS_ATTRIBUTE,\n AI_SETTINGS_MAX_RETRIES: AI_SETTINGS_MAX_RETRIES_ATTRIBUTE,\n AI_TELEMETRY_FUNCTION_ID: AI_TELEMETRY_FUNCTION_ID_ATTRIBUTE,\n AI_TELEMETRY_METADATA: AI_TELEMETRY_METADATA_ATTRIBUTE,\n // Basic embedding span information\n AI_USAGE_TOKENS: AI_USAGE_TOKENS_ATTRIBUTE,\n} as const;\n\n/**\n * Attributes collected for `ai.embed.doEmbed` span\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#embed-function\n */\nexport const AI_EMBED_DO_EMBED_SPAN_ATTRIBUTES = {\n OPERATION_NAME: OPERATION_NAME_ATTRIBUTE,\n AI_OPERATION_ID: AI_OPERATION_ID_ATTRIBUTE,\n AI_VALUES: AI_VALUES_ATTRIBUTE,\n AI_EMBEDDINGS: AI_EMBEDDINGS_ATTRIBUTE,\n // Basic LLM span information\n RESOURCE_NAME: RESOURCE_NAME_ATTRIBUTE,\n AI_MODEL_ID: AI_MODEL_ID_ATTRIBUTE,\n AI_MODEL_PROVIDER: AI_MODEL_PROVIDER_ATTRIBUTE,\n AI_REQUEST_HEADERS: AI_REQUEST_HEADERS_ATTRIBUTE,\n AI_SETTINGS_MAX_RETRIES: AI_SETTINGS_MAX_RETRIES_ATTRIBUTE,\n AI_TELEMETRY_FUNCTION_ID: AI_TELEMETRY_FUNCTION_ID_ATTRIBUTE,\n AI_TELEMETRY_METADATA: AI_TELEMETRY_METADATA_ATTRIBUTE,\n // Basic embedding span information\n AI_USAGE_TOKENS: AI_USAGE_TOKENS_ATTRIBUTE,\n} as const;\n\n/**\n * Attributes collected for `ai.embedMany` span\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#embedmany-function\n */\nexport const AI_EMBED_MANY_SPAN_ATTRIBUTES = {\n OPERATION_NAME: OPERATION_NAME_ATTRIBUTE,\n AI_OPERATION_ID: AI_OPERATION_ID_ATTRIBUTE,\n AI_VALUES: AI_VALUES_ATTRIBUTE,\n AI_EMBEDDINGS: AI_EMBEDDINGS_ATTRIBUTE,\n // Basic LLM span information\n RESOURCE_NAME: RESOURCE_NAME_ATTRIBUTE,\n AI_MODEL_ID: AI_MODEL_ID_ATTRIBUTE,\n AI_MODEL_PROVIDER: AI_MODEL_PROVIDER_ATTRIBUTE,\n AI_REQUEST_HEADERS: AI_REQUEST_HEADERS_ATTRIBUTE,\n AI_SETTINGS_MAX_RETRIES: AI_SETTINGS_MAX_RETRIES_ATTRIBUTE,\n AI_TELEMETRY_FUNCTION_ID: AI_TELEMETRY_FUNCTION_ID_ATTRIBUTE,\n AI_TELEMETRY_METADATA: AI_TELEMETRY_METADATA_ATTRIBUTE,\n // Basic embedding span information\n AI_USAGE_TOKENS: AI_USAGE_TOKENS_ATTRIBUTE,\n} as const;\n\n/**\n * Attributes collected for `ai.toolCall` span\n * @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#tool-call-spans\n */\nexport const AI_TOOL_CALL_SPAN_ATTRIBUTES = {\n OPERATION_NAME: OPERATION_NAME_ATTRIBUTE,\n AI_OPERATION_ID: AI_OPERATION_ID_ATTRIBUTE,\n AI_TOOL_CALL_NAME: AI_TOOL_CALL_NAME_ATTRIBUTE,\n AI_TOOL_CALL_ID: AI_TOOL_CALL_ID_ATTRIBUTE,\n AI_TOOL_CALL_ARGS: AI_TOOL_CALL_ARGS_ATTRIBUTE,\n AI_TOOL_CALL_RESULT: AI_TOOL_CALL_RESULT_ATTRIBUTE,\n // Basic LLM span information\n RESOURCE_NAME: RESOURCE_NAME_ATTRIBUTE,\n AI_MODEL_ID: AI_MODEL_ID_ATTRIBUTE,\n AI_MODEL_PROVIDER: AI_MODEL_PROVIDER_ATTRIBUTE,\n AI_REQUEST_HEADERS: AI_REQUEST_HEADERS_ATTRIBUTE,\n AI_SETTINGS_MAX_RETRIES: AI_SETTINGS_MAX_RETRIES_ATTRIBUTE,\n AI_TELEMETRY_FUNCTION_ID: AI_TELEMETRY_FUNCTION_ID_ATTRIBUTE,\n AI_TELEMETRY_METADATA: AI_TELEMETRY_METADATA_ATTRIBUTE,\n} as const;\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;;;AAkBA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,mBAAoB,GAAE;;AAkFnC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,0BAA2B,GAAE;;AAE1C;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,gCAAiC,GAAE;;AA0BhD;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,4BAA6B,GAAE;;AAE5C;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,yBAA0B,GAAE;;AAuEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,qBAAsB,GAAE;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,2BAA4B,GAAE;;AAoB3C;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,kCAAmC,GAAE;;AAWlD;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,oCAAqC,GAAE;;AAEpD;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,gCAAiC,GAAE;;AA+HhD;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,+BAAgC,GAAE;;AAW/C;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,mCAAoC,GAAE;;AAEnD;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,oCAAqC,GAAE;;AAepD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,2BAA4B,GAAE;;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,yBAA0B,GAAE;;;;"}