@sentry/core 10.50.0 → 10.52.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (347) hide show
  1. package/build/cjs/client.js +33 -5
  2. package/build/cjs/client.js.map +1 -1
  3. package/build/cjs/envelope.js +4 -1
  4. package/build/cjs/envelope.js.map +1 -1
  5. package/build/cjs/fetch.js +7 -4
  6. package/build/cjs/fetch.js.map +1 -1
  7. package/build/cjs/index.js +37 -13
  8. package/build/cjs/index.js.map +1 -1
  9. package/build/cjs/instrument/console.js +3 -1
  10. package/build/cjs/instrument/console.js.map +1 -1
  11. package/build/cjs/instrument/fetch.js +6 -2
  12. package/build/cjs/instrument/fetch.js.map +1 -1
  13. package/build/cjs/instrument/handlers.js +11 -1
  14. package/build/cjs/instrument/handlers.js.map +1 -1
  15. package/build/cjs/integrations/console.js +3 -1
  16. package/build/cjs/integrations/console.js.map +1 -1
  17. package/build/cjs/integrations/express/index.js +2 -4
  18. package/build/cjs/integrations/express/index.js.map +1 -1
  19. package/build/cjs/integrations/express/utils.js +0 -7
  20. package/build/cjs/integrations/express/utils.js.map +1 -1
  21. package/build/cjs/integrations/extraerrordata.js +2 -2
  22. package/build/cjs/integrations/extraerrordata.js.map +1 -1
  23. package/build/cjs/integrations/http/add-outgoing-request-breadcrumb.js +43 -0
  24. package/build/cjs/integrations/http/add-outgoing-request-breadcrumb.js.map +1 -0
  25. package/build/cjs/integrations/http/client-patch.js +113 -0
  26. package/build/cjs/integrations/http/client-patch.js.map +1 -0
  27. package/build/cjs/integrations/http/client-subscriptions.js +166 -0
  28. package/build/cjs/integrations/http/client-subscriptions.js.map +1 -0
  29. package/build/cjs/integrations/http/constants.js +10 -0
  30. package/build/cjs/integrations/http/constants.js.map +1 -0
  31. package/build/cjs/integrations/http/double-wrap-warning.js +29 -0
  32. package/build/cjs/integrations/http/double-wrap-warning.js.map +1 -0
  33. package/build/cjs/integrations/http/get-outgoing-span-data.js +88 -0
  34. package/build/cjs/integrations/http/get-outgoing-span-data.js.map +1 -0
  35. package/build/cjs/integrations/http/get-request-url.js +54 -0
  36. package/build/cjs/integrations/http/get-request-url.js.map +1 -0
  37. package/build/cjs/integrations/http/inject-trace-propagation-headers.js +81 -0
  38. package/build/cjs/integrations/http/inject-trace-propagation-headers.js.map +1 -0
  39. package/build/cjs/integrations/postgresjs.js +10 -1
  40. package/build/cjs/integrations/postgresjs.js.map +1 -1
  41. package/build/cjs/integrations/requestdata.js +92 -6
  42. package/build/cjs/integrations/requestdata.js.map +1 -1
  43. package/build/cjs/integrations/supabase.js +39 -12
  44. package/build/cjs/integrations/supabase.js.map +1 -1
  45. package/build/cjs/logs/console-integration.js +3 -1
  46. package/build/cjs/logs/console-integration.js.map +1 -1
  47. package/build/cjs/logs/envelope.js +12 -2
  48. package/build/cjs/logs/envelope.js.map +1 -1
  49. package/build/cjs/logs/internal.js +7 -1
  50. package/build/cjs/logs/internal.js.map +1 -1
  51. package/build/cjs/metrics/envelope.js +15 -2
  52. package/build/cjs/metrics/envelope.js.map +1 -1
  53. package/build/cjs/metrics/internal.js +7 -1
  54. package/build/cjs/metrics/internal.js.map +1 -1
  55. package/build/cjs/server-runtime-client.js +20 -2
  56. package/build/cjs/server-runtime-client.js.map +1 -1
  57. package/build/cjs/tracing/ai/gen-ai-attributes.js +6 -0
  58. package/build/cjs/tracing/ai/gen-ai-attributes.js.map +1 -1
  59. package/build/cjs/tracing/idleSpan.js +7 -1
  60. package/build/cjs/tracing/idleSpan.js.map +1 -1
  61. package/build/cjs/tracing/langchain/index.js +43 -8
  62. package/build/cjs/tracing/langchain/index.js.map +1 -1
  63. package/build/cjs/tracing/langchain/utils.js +44 -10
  64. package/build/cjs/tracing/langchain/utils.js.map +1 -1
  65. package/build/cjs/tracing/langgraph/index.js +105 -2
  66. package/build/cjs/tracing/langgraph/index.js.map +1 -1
  67. package/build/cjs/tracing/langgraph/utils.js +168 -0
  68. package/build/cjs/tracing/langgraph/utils.js.map +1 -1
  69. package/build/cjs/tracing/spans/captureSpan.js +169 -9
  70. package/build/cjs/tracing/spans/captureSpan.js.map +1 -1
  71. package/build/cjs/tracing/spans/envelope.js +13 -3
  72. package/build/cjs/tracing/spans/envelope.js.map +1 -1
  73. package/build/cjs/tracing/trace.js +2 -0
  74. package/build/cjs/tracing/trace.js.map +1 -1
  75. package/build/cjs/tracing/vercel-ai/constants.js +8 -0
  76. package/build/cjs/tracing/vercel-ai/constants.js.map +1 -1
  77. package/build/cjs/tracing/vercel-ai/index.js +93 -14
  78. package/build/cjs/tracing/vercel-ai/index.js.map +1 -1
  79. package/build/cjs/trpc.js +2 -3
  80. package/build/cjs/trpc.js.map +1 -1
  81. package/build/cjs/utils/baggage.js +73 -0
  82. package/build/cjs/utils/baggage.js.map +1 -1
  83. package/build/cjs/utils/chain-and-copy-promiselike.js +1 -0
  84. package/build/cjs/utils/chain-and-copy-promiselike.js.map +1 -1
  85. package/build/cjs/utils/get-default-export.js +32 -0
  86. package/build/cjs/utils/get-default-export.js.map +1 -0
  87. package/build/cjs/utils/isSentryRequestUrl.js +9 -1
  88. package/build/cjs/utils/isSentryRequestUrl.js.map +1 -1
  89. package/build/cjs/utils/normalizationHints.js +38 -0
  90. package/build/cjs/utils/normalizationHints.js.map +1 -0
  91. package/build/cjs/utils/normalize.js +7 -11
  92. package/build/cjs/utils/normalize.js.map +1 -1
  93. package/build/cjs/utils/object.js +1 -1
  94. package/build/cjs/utils/object.js.map +1 -1
  95. package/build/cjs/utils/request.js +192 -12
  96. package/build/cjs/utils/request.js.map +1 -1
  97. package/build/cjs/utils/should-ignore-span.js +27 -8
  98. package/build/cjs/utils/should-ignore-span.js.map +1 -1
  99. package/build/cjs/utils/spanUtils.js +1 -1
  100. package/build/cjs/utils/spanUtils.js.map +1 -1
  101. package/build/cjs/utils/version.js +1 -1
  102. package/build/esm/client.js +33 -5
  103. package/build/esm/client.js.map +1 -1
  104. package/build/esm/envelope.js +4 -1
  105. package/build/esm/envelope.js.map +1 -1
  106. package/build/esm/fetch.js +7 -4
  107. package/build/esm/fetch.js.map +1 -1
  108. package/build/esm/index.js +11 -5
  109. package/build/esm/index.js.map +1 -1
  110. package/build/esm/instrument/console.js +3 -1
  111. package/build/esm/instrument/console.js.map +1 -1
  112. package/build/esm/instrument/fetch.js +6 -2
  113. package/build/esm/instrument/fetch.js.map +1 -1
  114. package/build/esm/instrument/handlers.js +11 -1
  115. package/build/esm/instrument/handlers.js.map +1 -1
  116. package/build/esm/integrations/console.js +3 -1
  117. package/build/esm/integrations/console.js.map +1 -1
  118. package/build/esm/integrations/express/index.js +3 -5
  119. package/build/esm/integrations/express/index.js.map +1 -1
  120. package/build/esm/integrations/express/utils.js +1 -7
  121. package/build/esm/integrations/express/utils.js.map +1 -1
  122. package/build/esm/integrations/extraerrordata.js +2 -2
  123. package/build/esm/integrations/extraerrordata.js.map +1 -1
  124. package/build/esm/integrations/http/add-outgoing-request-breadcrumb.js +41 -0
  125. package/build/esm/integrations/http/add-outgoing-request-breadcrumb.js.map +1 -0
  126. package/build/esm/integrations/http/client-patch.js +111 -0
  127. package/build/esm/integrations/http/client-patch.js.map +1 -0
  128. package/build/esm/integrations/http/client-subscriptions.js +164 -0
  129. package/build/esm/integrations/http/client-subscriptions.js.map +1 -0
  130. package/build/esm/integrations/http/constants.js +6 -0
  131. package/build/esm/integrations/http/constants.js.map +1 -0
  132. package/build/esm/integrations/http/double-wrap-warning.js +26 -0
  133. package/build/esm/integrations/http/double-wrap-warning.js.map +1 -0
  134. package/build/esm/integrations/http/get-outgoing-span-data.js +85 -0
  135. package/build/esm/integrations/http/get-outgoing-span-data.js.map +1 -0
  136. package/build/esm/integrations/http/get-request-url.js +49 -0
  137. package/build/esm/integrations/http/get-request-url.js.map +1 -0
  138. package/build/esm/integrations/http/inject-trace-propagation-headers.js +79 -0
  139. package/build/esm/integrations/http/inject-trace-propagation-headers.js.map +1 -0
  140. package/build/esm/integrations/postgresjs.js +10 -1
  141. package/build/esm/integrations/postgresjs.js.map +1 -1
  142. package/build/esm/integrations/requestdata.js +92 -6
  143. package/build/esm/integrations/requestdata.js.map +1 -1
  144. package/build/esm/integrations/supabase.js +39 -12
  145. package/build/esm/integrations/supabase.js.map +1 -1
  146. package/build/esm/logs/console-integration.js +3 -1
  147. package/build/esm/logs/console-integration.js.map +1 -1
  148. package/build/esm/logs/envelope.js +12 -2
  149. package/build/esm/logs/envelope.js.map +1 -1
  150. package/build/esm/logs/internal.js +7 -1
  151. package/build/esm/logs/internal.js.map +1 -1
  152. package/build/esm/metrics/envelope.js +15 -2
  153. package/build/esm/metrics/envelope.js.map +1 -1
  154. package/build/esm/metrics/internal.js +7 -1
  155. package/build/esm/metrics/internal.js.map +1 -1
  156. package/build/esm/package.json +1 -1
  157. package/build/esm/server-runtime-client.js +20 -2
  158. package/build/esm/server-runtime-client.js.map +1 -1
  159. package/build/esm/tracing/ai/gen-ai-attributes.js +6 -1
  160. package/build/esm/tracing/ai/gen-ai-attributes.js.map +1 -1
  161. package/build/esm/tracing/idleSpan.js +7 -1
  162. package/build/esm/tracing/idleSpan.js.map +1 -1
  163. package/build/esm/tracing/langchain/index.js +45 -10
  164. package/build/esm/tracing/langchain/index.js.map +1 -1
  165. package/build/esm/tracing/langchain/utils.js +44 -12
  166. package/build/esm/tracing/langchain/utils.js.map +1 -1
  167. package/build/esm/tracing/langgraph/index.js +107 -5
  168. package/build/esm/tracing/langgraph/index.js.map +1 -1
  169. package/build/esm/tracing/langgraph/utils.js +166 -2
  170. package/build/esm/tracing/langgraph/utils.js.map +1 -1
  171. package/build/esm/tracing/spans/captureSpan.js +170 -11
  172. package/build/esm/tracing/spans/captureSpan.js.map +1 -1
  173. package/build/esm/tracing/spans/envelope.js +13 -3
  174. package/build/esm/tracing/spans/envelope.js.map +1 -1
  175. package/build/esm/tracing/trace.js +2 -1
  176. package/build/esm/tracing/trace.js.map +1 -1
  177. package/build/esm/tracing/vercel-ai/constants.js +8 -1
  178. package/build/esm/tracing/vercel-ai/constants.js.map +1 -1
  179. package/build/esm/tracing/vercel-ai/index.js +95 -17
  180. package/build/esm/tracing/vercel-ai/index.js.map +1 -1
  181. package/build/esm/trpc.js +2 -3
  182. package/build/esm/trpc.js.map +1 -1
  183. package/build/esm/utils/baggage.js +73 -1
  184. package/build/esm/utils/baggage.js.map +1 -1
  185. package/build/esm/utils/chain-and-copy-promiselike.js +1 -0
  186. package/build/esm/utils/chain-and-copy-promiselike.js.map +1 -1
  187. package/build/esm/utils/get-default-export.js +30 -0
  188. package/build/esm/utils/get-default-export.js.map +1 -0
  189. package/build/esm/utils/isSentryRequestUrl.js +9 -1
  190. package/build/esm/utils/isSentryRequestUrl.js.map +1 -1
  191. package/build/esm/utils/normalizationHints.js +33 -0
  192. package/build/esm/utils/normalizationHints.js.map +1 -0
  193. package/build/esm/utils/normalize.js +7 -11
  194. package/build/esm/utils/normalize.js.map +1 -1
  195. package/build/esm/utils/object.js +1 -1
  196. package/build/esm/utils/object.js.map +1 -1
  197. package/build/esm/utils/request.js +190 -13
  198. package/build/esm/utils/request.js.map +1 -1
  199. package/build/esm/utils/should-ignore-span.js +27 -8
  200. package/build/esm/utils/should-ignore-span.js.map +1 -1
  201. package/build/esm/utils/spanUtils.js +1 -1
  202. package/build/esm/utils/spanUtils.js.map +1 -1
  203. package/build/esm/utils/version.js +1 -1
  204. package/build/types/client.d.ts +12 -1
  205. package/build/types/client.d.ts.map +1 -1
  206. package/build/types/envelope.d.ts.map +1 -1
  207. package/build/types/fetch.d.ts.map +1 -1
  208. package/build/types/index.d.ts +17 -6
  209. package/build/types/index.d.ts.map +1 -1
  210. package/build/types/instrument/console.d.ts +2 -1
  211. package/build/types/instrument/console.d.ts.map +1 -1
  212. package/build/types/instrument/fetch.d.ts +4 -2
  213. package/build/types/instrument/fetch.d.ts.map +1 -1
  214. package/build/types/instrument/handlers.d.ts +2 -2
  215. package/build/types/instrument/handlers.d.ts.map +1 -1
  216. package/build/types/integrations/console.d.ts.map +1 -1
  217. package/build/types/integrations/express/index.d.ts.map +1 -1
  218. package/build/types/integrations/express/utils.d.ts +1 -5
  219. package/build/types/integrations/express/utils.d.ts.map +1 -1
  220. package/build/types/integrations/http/add-outgoing-request-breadcrumb.d.ts +6 -0
  221. package/build/types/integrations/http/add-outgoing-request-breadcrumb.d.ts.map +1 -0
  222. package/build/types/integrations/http/client-patch.d.ts +46 -0
  223. package/build/types/integrations/http/client-patch.d.ts.map +1 -0
  224. package/build/types/integrations/http/client-subscriptions.d.ts +21 -0
  225. package/build/types/integrations/http/client-subscriptions.d.ts.map +1 -0
  226. package/build/types/integrations/http/constants.d.ts +6 -0
  227. package/build/types/integrations/http/constants.d.ts.map +1 -0
  228. package/build/types/integrations/http/double-wrap-warning.d.ts +4 -0
  229. package/build/types/integrations/http/double-wrap-warning.d.ts.map +1 -0
  230. package/build/types/integrations/http/get-outgoing-span-data.d.ts +13 -0
  231. package/build/types/integrations/http/get-outgoing-span-data.d.ts.map +1 -0
  232. package/build/types/integrations/http/get-request-url.d.ts +10 -0
  233. package/build/types/integrations/http/get-request-url.d.ts.map +1 -0
  234. package/build/types/integrations/http/index.d.ts +4 -0
  235. package/build/types/integrations/http/index.d.ts.map +1 -0
  236. package/build/types/integrations/http/inject-trace-propagation-headers.d.ts +12 -0
  237. package/build/types/integrations/http/inject-trace-propagation-headers.d.ts.map +1 -0
  238. package/build/types/integrations/http/types.d.ts +249 -0
  239. package/build/types/integrations/http/types.d.ts.map +1 -0
  240. package/build/types/integrations/postgresjs.d.ts.map +1 -1
  241. package/build/types/integrations/requestdata.d.ts.map +1 -1
  242. package/build/types/integrations/supabase.d.ts.map +1 -1
  243. package/build/types/logs/console-integration.d.ts.map +1 -1
  244. package/build/types/logs/envelope.d.ts +5 -2
  245. package/build/types/logs/envelope.d.ts.map +1 -1
  246. package/build/types/logs/internal.d.ts.map +1 -1
  247. package/build/types/metrics/envelope.d.ts +5 -2
  248. package/build/types/metrics/envelope.d.ts.map +1 -1
  249. package/build/types/metrics/internal.d.ts.map +1 -1
  250. package/build/types/server-runtime-client.d.ts +5 -0
  251. package/build/types/server-runtime-client.d.ts.map +1 -1
  252. package/build/types/tracing/idleSpan.d.ts.map +1 -1
  253. package/build/types/tracing/index.d.ts +1 -1
  254. package/build/types/tracing/index.d.ts.map +1 -1
  255. package/build/types/tracing/langchain/index.d.ts.map +1 -1
  256. package/build/types/tracing/langchain/types.d.ts +8 -0
  257. package/build/types/tracing/langchain/types.d.ts.map +1 -1
  258. package/build/types/tracing/langchain/utils.d.ts +2 -0
  259. package/build/types/tracing/langchain/utils.d.ts.map +1 -1
  260. package/build/types/tracing/langgraph/index.d.ts +4 -0
  261. package/build/types/tracing/langgraph/index.d.ts.map +1 -1
  262. package/build/types/tracing/langgraph/utils.d.ts +18 -2
  263. package/build/types/tracing/langgraph/utils.d.ts.map +1 -1
  264. package/build/types/tracing/spans/captureSpan.d.ts +13 -3
  265. package/build/types/tracing/spans/captureSpan.d.ts.map +1 -1
  266. package/build/types/tracing/spans/envelope.d.ts.map +1 -1
  267. package/build/types/tracing/trace.d.ts +1 -0
  268. package/build/types/tracing/trace.d.ts.map +1 -1
  269. package/build/types/tracing/vercel-ai/constants.d.ts +1 -0
  270. package/build/types/tracing/vercel-ai/constants.d.ts.map +1 -1
  271. package/build/types/tracing/vercel-ai/index.d.ts +9 -0
  272. package/build/types/tracing/vercel-ai/index.d.ts.map +1 -1
  273. package/build/types/trpc.d.ts.map +1 -1
  274. package/build/types/types-hoist/feedback/config.d.ts +20 -0
  275. package/build/types/types-hoist/feedback/config.d.ts.map +1 -1
  276. package/build/types/types-hoist/feedback/index.d.ts +2 -2
  277. package/build/types/types-hoist/feedback/index.d.ts.map +1 -1
  278. package/build/types/types-hoist/feedback/sendFeedback.d.ts +3 -0
  279. package/build/types/types-hoist/feedback/sendFeedback.d.ts.map +1 -1
  280. package/build/types/types-hoist/log.d.ts +5 -0
  281. package/build/types/types-hoist/log.d.ts.map +1 -1
  282. package/build/types/types-hoist/metric.d.ts +5 -0
  283. package/build/types/types-hoist/metric.d.ts.map +1 -1
  284. package/build/types/types-hoist/options.d.ts +37 -2
  285. package/build/types/types-hoist/options.d.ts.map +1 -1
  286. package/build/types/types-hoist/span.d.ts +5 -0
  287. package/build/types/types-hoist/span.d.ts.map +1 -1
  288. package/build/types/types-hoist/webfetchapi.d.ts +2 -0
  289. package/build/types/types-hoist/webfetchapi.d.ts.map +1 -1
  290. package/build/types/utils/baggage.d.ts +13 -0
  291. package/build/types/utils/baggage.d.ts.map +1 -1
  292. package/build/types/utils/get-default-export.d.ts +22 -0
  293. package/build/types/utils/get-default-export.d.ts.map +1 -0
  294. package/build/types/utils/normalizationHints.d.ts +9 -0
  295. package/build/types/utils/normalizationHints.d.ts.map +1 -0
  296. package/build/types/utils/normalize.d.ts.map +1 -1
  297. package/build/types/utils/object.d.ts +1 -1
  298. package/build/types/utils/object.d.ts.map +1 -1
  299. package/build/types/utils/request.d.ts +30 -0
  300. package/build/types/utils/request.d.ts.map +1 -1
  301. package/build/types/utils/should-ignore-span.d.ts +3 -1
  302. package/build/types/utils/should-ignore-span.d.ts.map +1 -1
  303. package/build/types/utils/spanUtils.d.ts +1 -1
  304. package/build/types-ts3.8/client.d.ts +12 -1
  305. package/build/types-ts3.8/index.d.ts +17 -6
  306. package/build/types-ts3.8/instrument/console.d.ts +2 -1
  307. package/build/types-ts3.8/instrument/fetch.d.ts +4 -2
  308. package/build/types-ts3.8/instrument/handlers.d.ts +2 -2
  309. package/build/types-ts3.8/integrations/express/utils.d.ts +1 -5
  310. package/build/types-ts3.8/integrations/http/add-outgoing-request-breadcrumb.d.ts +6 -0
  311. package/build/types-ts3.8/integrations/http/client-patch.d.ts +46 -0
  312. package/build/types-ts3.8/integrations/http/client-subscriptions.d.ts +21 -0
  313. package/build/types-ts3.8/integrations/http/constants.d.ts +6 -0
  314. package/build/types-ts3.8/integrations/http/double-wrap-warning.d.ts +4 -0
  315. package/build/types-ts3.8/integrations/http/get-outgoing-span-data.d.ts +13 -0
  316. package/build/types-ts3.8/integrations/http/get-request-url.d.ts +10 -0
  317. package/build/types-ts3.8/integrations/http/index.d.ts +4 -0
  318. package/build/types-ts3.8/integrations/http/inject-trace-propagation-headers.d.ts +12 -0
  319. package/build/types-ts3.8/integrations/http/types.d.ts +252 -0
  320. package/build/types-ts3.8/logs/envelope.d.ts +5 -2
  321. package/build/types-ts3.8/metrics/envelope.d.ts +5 -2
  322. package/build/types-ts3.8/server-runtime-client.d.ts +5 -0
  323. package/build/types-ts3.8/tracing/index.d.ts +1 -1
  324. package/build/types-ts3.8/tracing/langchain/types.d.ts +8 -0
  325. package/build/types-ts3.8/tracing/langchain/utils.d.ts +2 -0
  326. package/build/types-ts3.8/tracing/langgraph/index.d.ts +4 -0
  327. package/build/types-ts3.8/tracing/langgraph/utils.d.ts +18 -2
  328. package/build/types-ts3.8/tracing/spans/captureSpan.d.ts +13 -3
  329. package/build/types-ts3.8/tracing/trace.d.ts +1 -0
  330. package/build/types-ts3.8/tracing/vercel-ai/constants.d.ts +1 -0
  331. package/build/types-ts3.8/tracing/vercel-ai/index.d.ts +9 -0
  332. package/build/types-ts3.8/types-hoist/feedback/config.d.ts +20 -0
  333. package/build/types-ts3.8/types-hoist/feedback/index.d.ts +2 -2
  334. package/build/types-ts3.8/types-hoist/feedback/sendFeedback.d.ts +3 -0
  335. package/build/types-ts3.8/types-hoist/log.d.ts +5 -0
  336. package/build/types-ts3.8/types-hoist/metric.d.ts +5 -0
  337. package/build/types-ts3.8/types-hoist/options.d.ts +37 -2
  338. package/build/types-ts3.8/types-hoist/span.d.ts +5 -0
  339. package/build/types-ts3.8/types-hoist/webfetchapi.d.ts +2 -0
  340. package/build/types-ts3.8/utils/baggage.d.ts +13 -0
  341. package/build/types-ts3.8/utils/get-default-export.d.ts +22 -0
  342. package/build/types-ts3.8/utils/normalizationHints.d.ts +9 -0
  343. package/build/types-ts3.8/utils/object.d.ts +1 -1
  344. package/build/types-ts3.8/utils/request.d.ts +30 -0
  345. package/build/types-ts3.8/utils/should-ignore-span.d.ts +3 -1
  346. package/build/types-ts3.8/utils/spanUtils.d.ts +1 -1
  347. package/package.json +1 -1
@@ -0,0 +1,252 @@
1
+ /**
2
+ * Platform-portable HTTP(S) outgoing-request integration – type definitions.
3
+ *
4
+ * @module
5
+ *
6
+ * This Sentry integration is a derivative work based on the OpenTelemetry
7
+ * HTTP instrumentation.
8
+ *
9
+ * <https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-instrumentation-http>
10
+ *
11
+ * Extended under the terms of the Apache 2.0 license linked below:
12
+ *
13
+ * ----
14
+ *
15
+ * Copyright The OpenTelemetry Authors
16
+ *
17
+ * Licensed under the Apache License, Version 2.0 (the "License");
18
+ * you may not use this file except in compliance with the License.
19
+ * You may obtain a copy of the License at
20
+ *
21
+ * https://www.apache.org/licenses/LICENSE-2.0
22
+ *
23
+ * Unless required by applicable law or agreed to in writing, software
24
+ * distributed under the License is distributed on an "AS IS" BASIS,
25
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26
+ * See the License for the specific language governing permissions and
27
+ * limitations under the License.
28
+ */
29
+ import { RequestEventData } from '../../types-hoist/request';
30
+ import { Span } from '../../types-hoist/span';
31
+ /** Minimal interface for a Node.js http.ClientRequest */
32
+ export interface HttpClientRequest {
33
+ method?: string;
34
+ path?: string;
35
+ host?: string;
36
+ protocol?: string;
37
+ port?: number;
38
+ end(): void;
39
+ getHeader(name: string): string | string[] | number | undefined;
40
+ getHeaders(): Record<string, string | string[] | undefined | number>;
41
+ setHeader(name: string, value: string | string[] | number): void;
42
+ removeHeader(name: string): void;
43
+ prependListener(event: 'response', listener: (res: HttpIncomingMessage) => void): this;
44
+ prependListener(event: string | symbol, listener: (...args: unknown[]) => void): this;
45
+ on(event: string | symbol, listener: (...args: unknown[]) => void): this;
46
+ once(event: string | symbol, listener: (...args: unknown[]) => void): this;
47
+ listenerCount(event: string | symbol): number;
48
+ removeListener(event: string | symbol, listener: (...args: unknown[]) => void): this;
49
+ }
50
+ /** Minimal interface for http client RequestOptions */
51
+ export interface HttpRequestOptions {
52
+ method?: string;
53
+ protocol?: string | null;
54
+ hostname?: string | null;
55
+ host?: string | null;
56
+ port?: string | number | null;
57
+ path?: string | null;
58
+ headers?: Record<string, string | string[] | undefined | number>;
59
+ }
60
+ /** Minimal interface for a Node.js http.ServerResponse */
61
+ export interface HttpServerResponse {
62
+ statusCode: number;
63
+ statusMessage?: string;
64
+ headers: Record<string, string | undefined | string[] | number>;
65
+ once(ev: string, ...data: unknown[]): this;
66
+ once(ev: 'close'): this;
67
+ on(ev: string | symbol, handler: (...data: unknown[]) => void): this;
68
+ }
69
+ export interface HttpServer {
70
+ emit(ev: string, ...data: unknown[]): this;
71
+ emit(ev: 'request', request: HttpIncomingMessage, response: HttpServerResponse): this;
72
+ }
73
+ export interface HttpSocket {
74
+ remoteAddress?: string;
75
+ remotePort?: number;
76
+ localAddress?: string;
77
+ localPort?: number;
78
+ }
79
+ /** Minimal interface for a Node.js http.IncomingMessage */
80
+ export interface HttpIncomingMessage {
81
+ statusCode?: number;
82
+ statusMessage?: string;
83
+ httpVersion?: string;
84
+ url?: string;
85
+ method?: string;
86
+ headers: Record<string, string | string[] | undefined>;
87
+ socket?: HttpSocket;
88
+ aborted?: boolean;
89
+ complete?: boolean;
90
+ resume(): void;
91
+ on(event: 'end', listener: () => void): this;
92
+ on(event: string | symbol, listener: (...args: unknown[]) => void): this;
93
+ addListener(event: 'end', listener: () => void): this;
94
+ addListener(event: string | symbol, listener: (...args: unknown[]) => void): this;
95
+ off(event: string | symbol, listener: (...args: unknown[]) => void): this;
96
+ removeListener(event: string | symbol, listener: (...args: unknown[]) => void): this;
97
+ }
98
+ /** Minimal interface for a Node.js http / https module export */
99
+ export interface HttpExport {
100
+ request: (...args: any[]) => HttpClientRequest;
101
+ get: (...args: any[]) => HttpClientRequest;
102
+ [key: string]: unknown;
103
+ }
104
+ export type HttpModuleExport = HttpExport | (HttpExport & {
105
+ default: HttpExport;
106
+ });
107
+ export interface HttpInstrumentationOptions {
108
+ /**
109
+ * Whether to create spans for outgoing HTTP requests.
110
+ * @default true
111
+ */
112
+ spans?: boolean;
113
+ /**
114
+ * Whether to inject distributed trace propagation headers
115
+ * (`sentry-trace`, `baggage`, `traceparent`) into outgoing requests.
116
+ * @default false
117
+ */
118
+ propagateTrace?: boolean;
119
+ /**
120
+ * Skip span / breadcrumb creation for requests to matching URLs.
121
+ * Receives the full URL string and the outgoing request object.
122
+ */
123
+ ignoreOutgoingRequests?: (url: string, request: HttpClientRequest) => boolean;
124
+ /**
125
+ * Whether breadcrumbs should be recorded for outgoing requests.
126
+ * @default true
127
+ */
128
+ breadcrumbs?: boolean;
129
+ /**
130
+ * Called after the outgoing-request span is created by the client.
131
+ * Use this to add custom attributes to the span.
132
+ */
133
+ outgoingRequestHook?: (span: Span, request: HttpClientRequest) => void;
134
+ /**
135
+ * Called when the response is received by the client.
136
+ */
137
+ outgoingResponseHook?: (span: Span, response: HttpIncomingMessage) => void;
138
+ /**
139
+ * Called when both the request and response are available (after the
140
+ * response ends). Useful for adding attributes based on both objects.
141
+ */
142
+ applyCustomAttributesOnSpan?: (span: Span, request: HttpClientRequest, response: HttpIncomingMessage) => void;
143
+ /**
144
+ * Symbol to use for observing errors on EventEmitters without consuming
145
+ * them. Pass `EventEmitter.errorMonitor` from Node.js `events` module.
146
+ * Falls back to the plain `'error'` event string when not provided.
147
+ *
148
+ * Using the real `errorMonitor` symbol ensures that Sentry does not
149
+ * swallow errors before they reach user-supplied `'error'` handlers.
150
+ */
151
+ errorMonitor?: symbol | string;
152
+ /**
153
+ * Controls the maximum size of incoming HTTP request bodies attached to events.
154
+ *
155
+ * Available options:
156
+ * - 'none': No request bodies will be attached
157
+ * - 'small': Request bodies up to 1,000 bytes will be attached
158
+ * - 'medium': Request bodies up to 10,000 bytes will be attached (default)
159
+ * - 'always': Request bodies will always be attached
160
+ *
161
+ * Note that even with 'always' setting, bodies exceeding 1MB will never be attached
162
+ * for performance and security reasons.
163
+ *
164
+ * @default 'medium'
165
+ */
166
+ maxRequestBodySize?: 'none' | 'small' | 'medium' | 'always';
167
+ /**
168
+ * Do not capture the request body for incoming HTTP requests to URLs where the given callback returns `true`.
169
+ * This can be useful for long running requests where the body is not needed and we want to avoid capturing it.
170
+ *
171
+ * @param url Contains the entire URL, including query string (if any), protocol, host, etc. of the incoming request.
172
+ * @param request Contains the {@type RequestOptions} object used to make the incoming request.
173
+ */
174
+ ignoreRequestBody?: (url: string, request: HttpIncomingMessage) => boolean;
175
+ /**
176
+ * Whether the integration should create [Sessions](https://docs.sentry.io/product/releases/health/#sessions) for incoming requests to track the health and crash-free rate of your releases in Sentry.
177
+ * Read more about Release Health: https://docs.sentry.io/product/releases/health/
178
+ *
179
+ * Defaults to `true`.
180
+ */
181
+ sessions?: boolean;
182
+ /**
183
+ * Number of milliseconds until sessions tracked with `trackIncomingRequestsAsSessions` will be flushed as a session aggregate.
184
+ *
185
+ * Defaults to `60000` (60s).
186
+ */
187
+ sessionFlushingDelayMS?: number;
188
+ /**
189
+ * Optional callback that can be used by integrations to emit the 'request'
190
+ * event within a given Sentry or OTEL context, possibly after creating a
191
+ * span, as in the HttpServerSpansIntegration.
192
+ */
193
+ wrapServerEmitRequest?: (request: HttpIncomingMessage, response: HttpServerResponse, normalizedRequest: RequestEventData, next: () => void) => void;
194
+ /**
195
+ * Do not capture spans for incoming HTTP requests to URLs where the given callback returns `true`.
196
+ * Spans will be non recording if tracing is disabled.
197
+ *
198
+ * The `urlPath` param consists of the URL path and query string (if any) of the incoming request.
199
+ * For example: `'/users/details?id=123'`
200
+ *
201
+ * The `request` param contains the original {@type IncomingMessage} object of the incoming request.
202
+ * You can use it to filter on additional properties like method, headers, etc.
203
+ */
204
+ ignoreIncomingRequests?: (urlPath: string, request: HttpIncomingMessage) => boolean;
205
+ /**
206
+ * Whether to automatically ignore common static asset requests like favicon.ico, robots.txt, etc.
207
+ * This helps reduce noise in your transactions.
208
+ *
209
+ * @default `true`
210
+ */
211
+ ignoreStaticAssets?: boolean;
212
+ /**
213
+ * Do not capture spans for incoming HTTP requests with the given status codes.
214
+ * By default, spans with some 3xx and 4xx status codes are ignored (see @default).
215
+ * Expects an array of status codes or a range of status codes, e.g. [[300,399], 404] would ignore 3xx and 404 status codes.
216
+ *
217
+ * @default `[[401, 404], [301, 303], [305, 399]]`
218
+ */
219
+ ignoreStatusCodes?: (number | [
220
+ number,
221
+ number
222
+ ])[];
223
+ /**
224
+ * A hook that can be used to mutate the span for incoming requests.
225
+ * This is triggered after the span is created, but before it is recorded.
226
+ */
227
+ onSpanCreated?: (span: Span, request: HttpIncomingMessage, response: HttpServerResponse) => void;
228
+ /**
229
+ * A hook that can be used to mutate the span one last time when the
230
+ * response is finished, eg to update the transaction name based on
231
+ * the RPC metadata.
232
+ */
233
+ onSpanEnd?: (span: Span, request: HttpIncomingMessage, response: HttpServerResponse) => void;
234
+ /**
235
+ * Optional: pass in the `http` and `https` modules in order to detect
236
+ * whether a standalone OTel instrumentation is attempting to wrap them
237
+ * as well. This is fine, as long as `spans` option is disabled, but will
238
+ * result in double-emitting spans otherwise.
239
+ *
240
+ * Since this cannot be fully prevented due to module load timing, and isn't
241
+ * necessarily harmful per se (just noisy/annoying), and there are a number
242
+ * of reasonable approaches to fix it (disable the OTel instrumentation,
243
+ * disable this instrumentation, or keep both and disable spans in one or the
244
+ * other), we simply print a warning so the user can hopefully make an
245
+ * informed decision about how to address it (if at all).
246
+ */
247
+ http?: HttpModuleExport;
248
+ https?: HttpModuleExport;
249
+ /** suppress the warning about double-wrapping with OTel */
250
+ suppressOtelWarning?: boolean;
251
+ }
252
+ //# sourceMappingURL=types.d.ts.map
@@ -6,9 +6,11 @@ import { SdkMetadata } from '../types-hoist/sdkmetadata';
6
6
  * Creates a log container envelope item for a list of logs.
7
7
  *
8
8
  * @param items - The logs to include in the envelope.
9
+ * @param inferUserData - If true, tells Relay to infer the end-user IP and User-Agent from the incoming request.
10
+ * Only emitted as `ingest_settings` in browser environments.
9
11
  * @returns The created log container envelope item.
10
12
  */
11
- export declare function createLogContainerEnvelopeItem(items: Array<SerializedLog>): LogContainerItem;
13
+ export declare function createLogContainerEnvelopeItem(items: Array<SerializedLog>, inferUserData?: boolean): LogContainerItem;
12
14
  /**
13
15
  * Creates an envelope for a list of logs.
14
16
  *
@@ -18,7 +20,8 @@ export declare function createLogContainerEnvelopeItem(items: Array<SerializedLo
18
20
  * @param metadata - The metadata to include in the envelope.
19
21
  * @param tunnel - The tunnel to include in the envelope.
20
22
  * @param dsn - The DSN to include in the envelope.
23
+ * @param inferUserData - If true, tells Relay to infer the end-user IP and User-Agent from the incoming request.
21
24
  * @returns The created envelope.
22
25
  */
23
- export declare function createLogEnvelope(logs: Array<SerializedLog>, metadata?: SdkMetadata, tunnel?: string, dsn?: DsnComponents): LogEnvelope;
26
+ export declare function createLogEnvelope(logs: Array<SerializedLog>, metadata?: SdkMetadata, tunnel?: string, dsn?: DsnComponents, inferUserData?: boolean): LogEnvelope;
24
27
  //# sourceMappingURL=envelope.d.ts.map
@@ -6,9 +6,11 @@ import { SdkMetadata } from '../types-hoist/sdkmetadata';
6
6
  * Creates a metric container envelope item for a list of metrics.
7
7
  *
8
8
  * @param items - The metrics to include in the envelope.
9
+ * @param inferUserData - If true, tells Relay to infer the end-user IP and User-Agent from the incoming request.
10
+ * Only emitted as `ingest_settings` in browser environments.
9
11
  * @returns The created metric container envelope item.
10
12
  */
11
- export declare function createMetricContainerEnvelopeItem(items: Array<SerializedMetric>): MetricContainerItem;
13
+ export declare function createMetricContainerEnvelopeItem(items: Array<SerializedMetric>, inferUserData?: boolean): MetricContainerItem;
12
14
  /**
13
15
  * Creates an envelope for a list of metrics.
14
16
  *
@@ -18,7 +20,8 @@ export declare function createMetricContainerEnvelopeItem(items: Array<Serialize
18
20
  * @param metadata - The metadata to include in the envelope.
19
21
  * @param tunnel - The tunnel to include in the envelope.
20
22
  * @param dsn - The DSN to include in the envelope.
23
+ * @param inferUserData - If true, tells Relay to infer the end-user IP and User-Agent from the incoming request.
21
24
  * @returns The created envelope.
22
25
  */
23
- export declare function createMetricEnvelope(metrics: Array<SerializedMetric>, metadata?: SdkMetadata, tunnel?: string, dsn?: DsnComponents): MetricEnvelope;
26
+ export declare function createMetricEnvelope(metrics: Array<SerializedMetric>, metadata?: SdkMetadata, tunnel?: string, dsn?: DsnComponents, inferUserData?: boolean): MetricEnvelope;
24
27
  //# sourceMappingURL=envelope.d.ts.map
@@ -18,6 +18,7 @@ export interface ServerRuntimeClientOptions extends ClientOptions<BaseTransportO
18
18
  * The Sentry Server Runtime Client SDK.
19
19
  */
20
20
  export declare class ServerRuntimeClient<O extends ClientOptions & ServerRuntimeClientOptions = ServerRuntimeClientOptions> extends Client<O> {
21
+ private _disposeCallbacks;
21
22
  /**
22
23
  * Creates a new Edge SDK instance.
23
24
  * @param options Configuration options for this SDK.
@@ -47,6 +48,10 @@ export declare class ServerRuntimeClient<O extends ClientOptions & ServerRuntime
47
48
  * to create a monitor automatically when sending a check in.
48
49
  */
49
50
  captureCheckIn(checkIn: CheckIn, monitorConfig?: MonitorConfig, scope?: Scope): string;
51
+ /**
52
+ * @inheritDoc
53
+ */
54
+ registerCleanup(callback: () => void): void;
50
55
  /**
51
56
  * Disposes of the client and releases all resources.
52
57
  *
@@ -5,7 +5,7 @@ export { SentrySpan } from './sentrySpan';
5
5
  export { SentryNonRecordingSpan } from './sentryNonRecordingSpan';
6
6
  export { setHttpStatus, getSpanStatusFromHttpCode } from './spanstatus';
7
7
  export { SPAN_STATUS_ERROR, SPAN_STATUS_OK, SPAN_STATUS_UNSET } from './spanstatus';
8
- export { startSpan, startInactiveSpan, startSpanManual, continueTrace, withActiveSpan, suppressTracing, startNewTrace, } from './trace';
8
+ export { startSpan, startInactiveSpan, startSpanManual, continueTrace, withActiveSpan, suppressTracing, startNewTrace, SUPPRESS_TRACING_KEY, } from './trace';
9
9
  export { getDynamicSamplingContextFromClient, getDynamicSamplingContextFromSpan, getDynamicSamplingContextFromScope, spanToBaggageHeader, } from './dynamicSamplingContext';
10
10
  export { setMeasurement, timedEventsToMeasurements } from './measurement';
11
11
  export { sampleSpan } from './sampling';
@@ -32,6 +32,14 @@ export interface LangChainSerialized {
32
32
  graph?: Record<string, unknown>;
33
33
  kwargs?: Record<string, unknown>;
34
34
  }
35
+ /**
36
+ * Subset of the 'llm' param passed to createReactAgent
37
+ */
38
+ export interface BaseChatModel {
39
+ lc_namespace: string[];
40
+ modelName?: string;
41
+ model?: string;
42
+ }
35
43
  /**
36
44
  * LangChain message structure
37
45
  * Supports both regular messages and LangChain serialized format
@@ -57,4 +57,6 @@ export declare function extractChatModelRequestAttributes(llm: LangChainSerializ
57
57
  * `stop_reason` (for providers that use it).
58
58
  */
59
59
  export declare function extractLlmResponseAttributes(llmResult: LangChainLLMResult, recordOutputs: boolean): Record<string, SpanAttributeValue> | undefined;
60
+ export declare function getAgentNameFromMetadata(metadata?: Record<string, unknown>): Record<string, SpanAttributeValue>;
61
+ export declare function extractToolDefinitions(extraParams?: Record<string, unknown>): string | undefined;
60
62
  //# sourceMappingURL=utils.d.ts.map
@@ -8,6 +8,10 @@ import { CompiledGraph, LangGraphOptions } from './types';
8
8
  *
9
9
  */
10
10
  export declare function instrumentStateGraphCompile(originalCompile: (...args: unknown[]) => CompiledGraph, options: LangGraphOptions): (...args: unknown[]) => CompiledGraph;
11
+ /**
12
+ * Instruments createReactAgent to create invoke_agent and execute_tool spans.
13
+ */
14
+ export declare function instrumentCreateReactAgent(originalCreateReactAgent: (...args: unknown[]) => CompiledGraph, options?: LangGraphOptions): (...args: unknown[]) => CompiledGraph;
11
15
  /**
12
16
  * Directly instruments a StateGraph instance to add tracing spans
13
17
  *
@@ -1,6 +1,20 @@
1
1
  import { Span } from '../../types-hoist/span';
2
- import { LangChainMessage } from '../langchain/types';
3
- import { CompiledGraph } from './types';
2
+ import { BaseChatModel, LangChainMessage } from '../langchain/types';
3
+ import { CompiledGraph, LangGraphOptions } from './types';
4
+ /**
5
+ * Extract LLM model object from createReactAgent params
6
+ */
7
+ export declare function extractLLMFromParams(args: unknown[]): BaseChatModel | null;
8
+ /**
9
+ * Extract agent name from createReactAgent params
10
+ */
11
+ export declare function extractAgentNameFromParams(args: unknown[]): string | null;
12
+ /**
13
+ * Wraps an array of LangChain tools so each invocation creates a gen_ai.execute_tool span.
14
+ *
15
+ * Wraps each tool's invoke() method in place. A marker prevents double-wrapping.
16
+ */
17
+ export declare function wrapToolsWithSpans(tools: unknown[], options: LangGraphOptions, agentName?: string): unknown[];
4
18
  /**
5
19
  * Extract tool calls from messages
6
20
  */
@@ -28,4 +42,6 @@ export declare function extractToolsFromCompiledGraph(compiledGraph: CompiledGra
28
42
  * Set response attributes on the span
29
43
  */
30
44
  export declare function setResponseAttributes(span: Span, inputMessages: LangChainMessage[] | null, result: unknown): void;
45
+ /** Merge `sentryHandler` into a langchain `callbacks` value (`BaseCallbackHandler[]` or `BaseCallbackManager`). */
46
+ export declare function mergeSentryCallback(existing: unknown, sentryHandler: unknown): unknown;
31
47
  //# sourceMappingURL=utils.d.ts.map
@@ -14,13 +14,23 @@ export type SerializedStreamedSpanWithSegmentSpan = SerializedStreamedSpan & {
14
14
  * is needed later on to compute the DSC for the span envelope.
15
15
  */
16
16
  export declare function captureSpan(span: Span, client: Client): SerializedStreamedSpanWithSegmentSpan;
17
+ /**
18
+ * Safely set attributes on a span JSON.
19
+ * If an attribute already exists, it will not be overwritten.
20
+ */
21
+ export declare function safeSetSpanJSONAttributes(spanJSON: StreamedSpanJSON, newAttributes: RawAttributes<Record<string, unknown>>): void;
17
22
  /**
18
23
  * Apply a user-provided beforeSendSpan callback to a span JSON.
19
24
  */
20
25
  export declare function applyBeforeSendSpanCallback(span: StreamedSpanJSON, beforeSendSpan: (span: StreamedSpanJSON) => StreamedSpanJSON): StreamedSpanJSON;
21
26
  /**
22
- * Safely set attributes on a span JSON.
23
- * If an attribute already exists, it will not be overwritten.
27
+ * Infer and backfill span data from OTel semantic conventions.
28
+ * This mirrors what the `SentrySpanExporter` does for non-streamed spans via `getSpanData`/`inferSpanData`.
29
+ * Streamed spans skip the exporter, so we do the inference here during capture.
30
+ *
31
+ * Backfills: `sentry.op`, `sentry.source`, and `name` (description).
32
+ * Uses `safeSetSpanJSONAttributes` so explicitly set attributes are never overwritten.
24
33
  */
25
- export declare function safeSetSpanJSONAttributes(spanJSON: StreamedSpanJSON, newAttributes: RawAttributes<Record<string, unknown>>): void;
34
+ /** Exported only for tests. */
35
+ export declare function inferSpanDataFromOtelAttributes(spanJSON: StreamedSpanJSON, spanKind?: number): void;
26
36
  //# sourceMappingURL=captureSpan.d.ts.map
@@ -2,6 +2,7 @@ import { Scope } from '../scope';
2
2
  import { Span } from '../types-hoist/span';
3
3
  import { StartSpanOptions } from '../types-hoist/startSpanOptions';
4
4
  import { propagationContextFromHeaders } from '../utils/tracing';
5
+ export declare const SUPPRESS_TRACING_KEY = "__SENTRY_SUPPRESS_TRACING__";
5
6
  /**
6
7
  * Wraps a function with a transaction/span and finishes the span after the function is done.
7
8
  * The created span is the active span and will be used as parent by other spans created inside the function
@@ -1,5 +1,6 @@
1
1
  import { ToolCallSpanContext } from './types';
2
2
  export declare const toolCallSpanContextMap: Map<string, ToolCallSpanContext>;
3
+ export declare const toolDescriptionMap: Map<string, Map<string, string>>;
3
4
  /** Maps Vercel AI span names to standardized OpenTelemetry operation names. */
4
5
  export declare const SPAN_TO_OPERATION_NAME: Map<string, string>;
5
6
  //# sourceMappingURL=constants.d.ts.map
@@ -1,4 +1,13 @@
1
1
  import { Client } from '../../client';
2
+ /**
3
+ * Post-process spans emitted by the Vercel AI SDK.
4
+ */
5
+ /**
6
+ * Rename and normalize Vercel AI SDK attributes to OpenTelemetry semantic conventions.
7
+ * This is the shared attribute processing logic used by both the legacy event processor
8
+ * path (SpanJSON) and the streamed span path (StreamedSpanJSON).
9
+ */
10
+ export declare function processVercelAiSpanAttributes(attributes: Record<string, unknown>): void;
2
11
  /**
3
12
  * Add event processors to the given client to process Vercel AI spans.
4
13
  */
@@ -159,6 +159,26 @@ export interface FeedbackTextConfiguration {
159
159
  * The label for the button that removed a highlight/hidden section of the screenshot.
160
160
  */
161
161
  removeHighlightText: string;
162
+ /**
163
+ * Error text shown when feedback submission is attempted with an empty message
164
+ */
165
+ errorEmptyMessageText: string;
166
+ /**
167
+ * Error text shown when the Sentry client is not set up
168
+ */
169
+ errorNoClientText: string;
170
+ /**
171
+ * Error text shown when the feedback submission times out (after 30s)
172
+ */
173
+ errorTimeoutText: string;
174
+ /**
175
+ * Error text shown when the feedback submission is blocked because the domain is not allowed (HTTP 403)
176
+ */
177
+ errorForbiddenText: string;
178
+ /**
179
+ * Error text shown when the feedback submission fails for any other reason (e.g. network error, ad-blocker)
180
+ */
181
+ errorGenericText: string;
162
182
  }
163
183
  /**
164
184
  * The public callbacks available for the feedback integration
@@ -1,9 +1,9 @@
1
1
  import { Attachment } from '../attachment';
2
2
  import { Integration } from '../integration';
3
3
  import { FeedbackCallbacks, FeedbackGeneralConfiguration, FeedbackTextConfiguration, FeedbackThemeConfiguration } from './config';
4
- import { FeedbackEvent, SendFeedback, SendFeedbackParams, UserFeedback } from './sendFeedback';
4
+ import { FeedbackErrorCode, FeedbackErrorMessages, FeedbackEvent, SendFeedback, SendFeedbackParams, UserFeedback } from './sendFeedback';
5
5
  export { FeedbackFormData } from './form';
6
- export { FeedbackEvent, UserFeedback, SendFeedback, SendFeedbackParams };
6
+ export { FeedbackErrorCode, FeedbackErrorMessages, FeedbackEvent, SendFeedback, SendFeedbackParams, UserFeedback };
7
7
  /**
8
8
  * The integration's internal `options` member where every value should be set
9
9
  */
@@ -43,8 +43,11 @@ export interface SendFeedbackParams {
43
43
  [key: string]: Primitive;
44
44
  };
45
45
  }
46
+ export type FeedbackErrorCode = 'ERROR_EMPTY_MESSAGE' | 'ERROR_NO_CLIENT' | 'ERROR_TIMEOUT' | 'ERROR_FORBIDDEN' | 'ERROR_GENERIC';
47
+ export type FeedbackErrorMessages = Partial<Record<FeedbackErrorCode, string>>;
46
48
  export type SendFeedback = (params: SendFeedbackParams, hint?: EventHint & {
47
49
  includeReplay?: boolean;
50
+ errorMessages?: FeedbackErrorMessages;
48
51
  }) => Promise<string>;
49
52
  export {};
50
53
  //# sourceMappingURL=sendFeedback.d.ts.map
@@ -52,6 +52,11 @@ export interface SerializedLog {
52
52
  severity_number?: Log['severityNumber'];
53
53
  }
54
54
  export type SerializedLogContainer = {
55
+ version?: number;
56
+ ingest_settings?: {
57
+ infer_ip?: 'auto' | 'never';
58
+ infer_user_agent?: 'auto' | 'never';
59
+ };
55
60
  items: Array<SerializedLog>;
56
61
  };
57
62
  //# sourceMappingURL=log.d.ts.map
@@ -61,6 +61,11 @@ export interface SerializedMetric {
61
61
  attributes?: Attributes;
62
62
  }
63
63
  export type SerializedMetricContainer = {
64
+ version?: number;
65
+ ingest_settings?: {
66
+ infer_ip?: 'auto' | 'never';
67
+ infer_user_agent?: 'auto' | 'never';
68
+ };
64
69
  items: Array<SerializedMetric>;
65
70
  };
66
71
  //# sourceMappingURL=metric.d.ts.map
@@ -90,9 +90,16 @@ export interface ServerRuntimeOptions {
90
90
  */
91
91
  onFatalError?(this: void, error: Error): void;
92
92
  }
93
+ /**
94
+ * Allowed attribute value matchers in `ignoreSpans` filters.
95
+ * String span attributes use pattern matching (substring or RegExp).
96
+ * Non-string attribute values match by strict equality (arrays element-wise).
97
+ */
98
+ export type IgnoreSpanAttributeValue = string | boolean | number | string[] | boolean[] | number[] | RegExp;
93
99
  /**
94
100
  * A filter object for ignoring spans.
95
- * At least one of the properties (`op` or `name`) must be set.
101
+ * At least one of the properties (`name`, `op`, or `attributes`) must be set.
102
+ * If multiple are set, all must match for the span to be ignored.
96
103
  */
97
104
  type IgnoreSpanFilter = {
98
105
  /**
@@ -103,6 +110,12 @@ type IgnoreSpanFilter = {
103
110
  * Spans with an op matching this pattern will be ignored.
104
111
  */
105
112
  op?: string | RegExp;
113
+ /**
114
+ * Spans whose attributes ALL match the corresponding entries will be ignored.
115
+ * String attribute values are matched as patterns (substring or RegExp).
116
+ * Non-string values match by strict equality (arrays element-wise).
117
+ */
118
+ attributes?: Record<string, IgnoreSpanAttributeValue>;
106
119
  } | {
107
120
  /**
108
121
  * Spans with a name matching this pattern will be ignored.
@@ -112,6 +125,27 @@ type IgnoreSpanFilter = {
112
125
  * Spans with an op matching this pattern will be ignored.
113
126
  */
114
127
  op: string | RegExp;
128
+ /**
129
+ * Spans whose attributes ALL match the corresponding entries will be ignored.
130
+ * String attribute values are matched as patterns (substring or RegExp).
131
+ * Non-string values match by strict equality (arrays element-wise).
132
+ */
133
+ attributes?: Record<string, IgnoreSpanAttributeValue>;
134
+ } | {
135
+ /**
136
+ * Spans with a name matching this pattern will be ignored.
137
+ */
138
+ name?: string | RegExp;
139
+ /**
140
+ * Spans with an op matching this pattern will be ignored.
141
+ */
142
+ op?: string | RegExp;
143
+ /**
144
+ * Spans whose attributes ALL match the corresponding entries will be ignored.
145
+ * String attribute values are matched as patterns (substring or RegExp).
146
+ * Non-string values match by strict equality (arrays element-wise).
147
+ */
148
+ attributes: Record<string, IgnoreSpanAttributeValue>;
115
149
  };
116
150
  export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOptions> {
117
151
  /**
@@ -291,7 +325,8 @@ export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOp
291
325
  * A list of span names or patterns to ignore.
292
326
  *
293
327
  * If you specify a pattern {@link IgnoreSpanFilter}, at least one
294
- * of the properties (`op` or `name`) must be set.
328
+ * of the properties (`name`, `op`, or `attributes`) must be set.
329
+ * When multiple properties are set, all must match for the span to be ignored.
295
330
  *
296
331
  * @default []
297
332
  */
@@ -50,6 +50,11 @@ export type SerializedStreamedSpan = Pick<StreamedSpanJSON, Exclude<keyof Stream
50
50
  * Envelope span item container.
51
51
  */
52
52
  export type SerializedStreamedSpanContainer = {
53
+ version?: number;
54
+ ingest_settings?: {
55
+ infer_ip?: 'auto' | 'never';
56
+ infer_user_agent?: 'auto' | 'never';
57
+ };
53
58
  items: Array<SerializedStreamedSpan>;
54
59
  };
55
60
  /** A JSON representation of a span. */
@@ -10,6 +10,8 @@ export interface WebFetchRequest {
10
10
  readonly headers: WebFetchHeaders;
11
11
  readonly method: string;
12
12
  readonly url: string;
13
+ readonly body?: unknown;
13
14
  clone(): WebFetchRequest;
15
+ text(): Promise<string>;
14
16
  }
15
17
  //# sourceMappingURL=webfetchapi.d.ts.map
@@ -37,4 +37,17 @@ export declare function parseBaggageHeader(baggageHeader: string | string[] | nu
37
37
  * is not spec compliant.
38
38
  */
39
39
  export declare function objectToBaggageHeader(object: Record<string, string>): string | undefined;
40
+ /**
41
+ * Merge two baggage headers into one.
42
+ * - Sentry-specific entries (keys starting with "sentry-") from the new
43
+ * baggage take precedence
44
+ * - Non-Sentry entries from existing baggage take precedence
45
+ *
46
+ * The order of the existing baggage will be preserved, and new entries will
47
+ * be added to the end.
48
+ *
49
+ * This matches the behavior of OTEL's propagation.inject() which uses
50
+ * `baggage.setEntry()` to overwrite existing entries with the same key.
51
+ */
52
+ export declare function mergeBaggageHeaders<Existing extends string | string[] | number | undefined>(existing: Existing, incoming: string): string | undefined | Existing;
40
53
  //# sourceMappingURL=baggage.d.ts.map