@sentry/core 10.47.0 → 10.49.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 (413) hide show
  1. package/build/cjs/attributes.js +43 -0
  2. package/build/cjs/attributes.js.map +1 -1
  3. package/build/cjs/client.js +13 -6
  4. package/build/cjs/client.js.map +1 -1
  5. package/build/cjs/envelope.js +4 -3
  6. package/build/cjs/envelope.js.map +1 -1
  7. package/build/cjs/fetch.js +36 -17
  8. package/build/cjs/fetch.js.map +1 -1
  9. package/build/cjs/index.js +53 -18
  10. package/build/cjs/index.js.map +1 -1
  11. package/build/cjs/integration.js +6 -0
  12. package/build/cjs/integration.js.map +1 -1
  13. package/build/cjs/integrations/conversationId.js +11 -0
  14. package/build/cjs/integrations/conversationId.js.map +1 -1
  15. package/build/cjs/integrations/express/index.js +243 -0
  16. package/build/cjs/integrations/express/index.js.map +1 -0
  17. package/build/cjs/integrations/express/patch-layer.js +257 -0
  18. package/build/cjs/integrations/express/patch-layer.js.map +1 -0
  19. package/build/cjs/integrations/express/request-layer-store.js +25 -0
  20. package/build/cjs/integrations/express/request-layer-store.js.map +1 -0
  21. package/build/cjs/integrations/express/set-sdk-processing-metadata.js +17 -0
  22. package/build/cjs/integrations/express/set-sdk-processing-metadata.js.map +1 -0
  23. package/build/cjs/integrations/express/types.js +17 -0
  24. package/build/cjs/integrations/express/types.js.map +1 -0
  25. package/build/cjs/integrations/express/utils.js +238 -0
  26. package/build/cjs/integrations/express/utils.js.map +1 -0
  27. package/build/cjs/integrations/mcp-server/correlation.js +5 -1
  28. package/build/cjs/integrations/mcp-server/correlation.js.map +1 -1
  29. package/build/cjs/integrations/mcp-server/handlers.js +18 -10
  30. package/build/cjs/integrations/mcp-server/handlers.js.map +1 -1
  31. package/build/cjs/integrations/mcp-server/index.js +2 -1
  32. package/build/cjs/integrations/mcp-server/index.js.map +1 -1
  33. package/build/cjs/integrations/mcp-server/transport.js +1 -1
  34. package/build/cjs/integrations/mcp-server/transport.js.map +1 -1
  35. package/build/cjs/integrations/mcp-server/validation.js +7 -5
  36. package/build/cjs/integrations/mcp-server/validation.js.map +1 -1
  37. package/build/cjs/integrations/requestdata.js.map +1 -1
  38. package/build/cjs/integrations/spanStreaming.js +48 -0
  39. package/build/cjs/integrations/spanStreaming.js.map +1 -0
  40. package/build/cjs/semanticAttributes.js +35 -3
  41. package/build/cjs/semanticAttributes.js.map +1 -1
  42. package/build/cjs/tracing/ai/gen-ai-attributes.js +3 -89
  43. package/build/cjs/tracing/ai/gen-ai-attributes.js.map +1 -1
  44. package/build/cjs/tracing/ai/utils.js +74 -0
  45. package/build/cjs/tracing/ai/utils.js.map +1 -1
  46. package/build/cjs/tracing/anthropic-ai/index.js +6 -17
  47. package/build/cjs/tracing/anthropic-ai/index.js.map +1 -1
  48. package/build/cjs/tracing/anthropic-ai/streaming.js +2 -100
  49. package/build/cjs/tracing/anthropic-ai/streaming.js.map +1 -1
  50. package/build/cjs/tracing/anthropic-ai/utils.js +4 -2
  51. package/build/cjs/tracing/anthropic-ai/utils.js.map +1 -1
  52. package/build/cjs/tracing/dynamicSamplingContext.js +2 -1
  53. package/build/cjs/tracing/dynamicSamplingContext.js.map +1 -1
  54. package/build/cjs/tracing/google-genai/constants.js +1 -6
  55. package/build/cjs/tracing/google-genai/constants.js.map +1 -1
  56. package/build/cjs/tracing/google-genai/index.js +40 -35
  57. package/build/cjs/tracing/google-genai/index.js.map +1 -1
  58. package/build/cjs/tracing/google-genai/streaming.js +2 -23
  59. package/build/cjs/tracing/google-genai/streaming.js.map +1 -1
  60. package/build/cjs/tracing/langchain/embeddings.js +132 -0
  61. package/build/cjs/tracing/langchain/embeddings.js.map +1 -0
  62. package/build/cjs/tracing/langchain/index.js +3 -0
  63. package/build/cjs/tracing/langchain/index.js.map +1 -1
  64. package/build/cjs/tracing/langchain/utils.js +12 -4
  65. package/build/cjs/tracing/langchain/utils.js.map +1 -1
  66. package/build/cjs/tracing/langgraph/index.js +4 -3
  67. package/build/cjs/tracing/langgraph/index.js.map +1 -1
  68. package/build/cjs/tracing/openai/index.js +14 -34
  69. package/build/cjs/tracing/openai/index.js.map +1 -1
  70. package/build/cjs/tracing/openai/streaming.js +3 -34
  71. package/build/cjs/tracing/openai/streaming.js.map +1 -1
  72. package/build/cjs/tracing/openai/utils.js +78 -204
  73. package/build/cjs/tracing/openai/utils.js.map +1 -1
  74. package/build/cjs/tracing/sentryNonRecordingSpan.js +7 -0
  75. package/build/cjs/tracing/sentryNonRecordingSpan.js.map +1 -1
  76. package/build/cjs/tracing/sentrySpan.js +39 -0
  77. package/build/cjs/tracing/sentrySpan.js.map +1 -1
  78. package/build/cjs/tracing/spans/beforeSendSpan.js +43 -0
  79. package/build/cjs/tracing/spans/beforeSendSpan.js.map +1 -0
  80. package/build/cjs/tracing/spans/captureSpan.js +126 -0
  81. package/build/cjs/tracing/spans/captureSpan.js.map +1 -0
  82. package/build/cjs/tracing/spans/envelope.js +38 -0
  83. package/build/cjs/tracing/spans/envelope.js.map +1 -0
  84. package/build/cjs/tracing/spans/estimateSize.js +41 -0
  85. package/build/cjs/tracing/spans/estimateSize.js.map +1 -0
  86. package/build/cjs/tracing/spans/hasSpanStreamingEnabled.js +11 -0
  87. package/build/cjs/tracing/spans/hasSpanStreamingEnabled.js.map +1 -0
  88. package/build/cjs/tracing/spans/spanBuffer.js +158 -0
  89. package/build/cjs/tracing/spans/spanBuffer.js.map +1 -0
  90. package/build/cjs/tracing/trace.js +83 -13
  91. package/build/cjs/tracing/trace.js.map +1 -1
  92. package/build/cjs/tracing/utils.js +3 -37
  93. package/build/cjs/tracing/utils.js.map +1 -1
  94. package/build/cjs/tracing/vercel-ai/constants.js +15 -23
  95. package/build/cjs/tracing/vercel-ai/constants.js.map +1 -1
  96. package/build/cjs/tracing/vercel-ai/index.js +32 -45
  97. package/build/cjs/tracing/vercel-ai/index.js.map +1 -1
  98. package/build/cjs/tracing/vercel-ai/utils.js +11 -42
  99. package/build/cjs/tracing/vercel-ai/utils.js.map +1 -1
  100. package/build/cjs/tracing/vercel-ai/vercel-ai-attributes.js +4 -1
  101. package/build/cjs/tracing/vercel-ai/vercel-ai-attributes.js.map +1 -1
  102. package/build/cjs/utils/browser.js +2 -3
  103. package/build/cjs/utils/browser.js.map +1 -1
  104. package/build/cjs/utils/featureFlags.js +6 -0
  105. package/build/cjs/utils/featureFlags.js.map +1 -1
  106. package/build/cjs/utils/object.js +33 -0
  107. package/build/cjs/utils/object.js.map +1 -1
  108. package/build/cjs/utils/spanUtils.js +116 -13
  109. package/build/cjs/utils/spanUtils.js.map +1 -1
  110. package/build/cjs/utils/stacktrace.js +3 -1
  111. package/build/cjs/utils/stacktrace.js.map +1 -1
  112. package/build/cjs/utils/string.js +3 -0
  113. package/build/cjs/utils/string.js.map +1 -1
  114. package/build/cjs/utils/version.js +1 -1
  115. package/build/cjs/utils/weakRef.js +62 -0
  116. package/build/cjs/utils/weakRef.js.map +1 -0
  117. package/build/esm/attributes.js +43 -1
  118. package/build/esm/attributes.js.map +1 -1
  119. package/build/esm/client.js +8 -1
  120. package/build/esm/client.js.map +1 -1
  121. package/build/esm/envelope.js +2 -1
  122. package/build/esm/envelope.js.map +1 -1
  123. package/build/esm/fetch.js +36 -17
  124. package/build/esm/fetch.js.map +1 -1
  125. package/build/esm/index.js +12 -3
  126. package/build/esm/index.js.map +1 -1
  127. package/build/esm/integration.js +6 -0
  128. package/build/esm/integration.js.map +1 -1
  129. package/build/esm/integrations/conversationId.js +11 -0
  130. package/build/esm/integrations/conversationId.js.map +1 -1
  131. package/build/esm/integrations/express/index.js +239 -0
  132. package/build/esm/integrations/express/index.js.map +1 -0
  133. package/build/esm/integrations/express/patch-layer.js +255 -0
  134. package/build/esm/integrations/express/patch-layer.js.map +1 -0
  135. package/build/esm/integrations/express/request-layer-store.js +22 -0
  136. package/build/esm/integrations/express/request-layer-store.js.map +1 -0
  137. package/build/esm/integrations/express/set-sdk-processing-metadata.js +15 -0
  138. package/build/esm/integrations/express/set-sdk-processing-metadata.js.map +1 -0
  139. package/build/esm/integrations/express/types.js +10 -0
  140. package/build/esm/integrations/express/types.js.map +1 -0
  141. package/build/esm/integrations/express/utils.js +225 -0
  142. package/build/esm/integrations/express/utils.js.map +1 -0
  143. package/build/esm/integrations/mcp-server/correlation.js +5 -1
  144. package/build/esm/integrations/mcp-server/correlation.js.map +1 -1
  145. package/build/esm/integrations/mcp-server/handlers.js +18 -10
  146. package/build/esm/integrations/mcp-server/handlers.js.map +1 -1
  147. package/build/esm/integrations/mcp-server/index.js +2 -1
  148. package/build/esm/integrations/mcp-server/index.js.map +1 -1
  149. package/build/esm/integrations/mcp-server/transport.js +1 -1
  150. package/build/esm/integrations/mcp-server/transport.js.map +1 -1
  151. package/build/esm/integrations/mcp-server/validation.js +7 -5
  152. package/build/esm/integrations/mcp-server/validation.js.map +1 -1
  153. package/build/esm/integrations/requestdata.js.map +1 -1
  154. package/build/esm/integrations/spanStreaming.js +46 -0
  155. package/build/esm/integrations/spanStreaming.js.map +1 -0
  156. package/build/esm/package.json +1 -1
  157. package/build/esm/semanticAttributes.js +26 -4
  158. package/build/esm/semanticAttributes.js.map +1 -1
  159. package/build/esm/tracing/ai/gen-ai-attributes.js +3 -76
  160. package/build/esm/tracing/ai/gen-ai-attributes.js.map +1 -1
  161. package/build/esm/tracing/ai/utils.js +73 -2
  162. package/build/esm/tracing/ai/utils.js.map +1 -1
  163. package/build/esm/tracing/anthropic-ai/index.js +8 -19
  164. package/build/esm/tracing/anthropic-ai/index.js.map +1 -1
  165. package/build/esm/tracing/anthropic-ai/streaming.js +3 -101
  166. package/build/esm/tracing/anthropic-ai/streaming.js.map +1 -1
  167. package/build/esm/tracing/anthropic-ai/utils.js +5 -3
  168. package/build/esm/tracing/anthropic-ai/utils.js.map +1 -1
  169. package/build/esm/tracing/dynamicSamplingContext.js +2 -1
  170. package/build/esm/tracing/dynamicSamplingContext.js.map +1 -1
  171. package/build/esm/tracing/google-genai/constants.js +2 -5
  172. package/build/esm/tracing/google-genai/constants.js.map +1 -1
  173. package/build/esm/tracing/google-genai/index.js +42 -37
  174. package/build/esm/tracing/google-genai/index.js.map +1 -1
  175. package/build/esm/tracing/google-genai/streaming.js +2 -23
  176. package/build/esm/tracing/google-genai/streaming.js.map +1 -1
  177. package/build/esm/tracing/langchain/embeddings.js +129 -0
  178. package/build/esm/tracing/langchain/embeddings.js.map +1 -0
  179. package/build/esm/tracing/langchain/index.js +4 -1
  180. package/build/esm/tracing/langchain/index.js.map +1 -1
  181. package/build/esm/tracing/langchain/utils.js +13 -5
  182. package/build/esm/tracing/langchain/utils.js.map +1 -1
  183. package/build/esm/tracing/langgraph/index.js +5 -4
  184. package/build/esm/tracing/langgraph/index.js.map +1 -1
  185. package/build/esm/tracing/openai/index.js +16 -36
  186. package/build/esm/tracing/openai/index.js.map +1 -1
  187. package/build/esm/tracing/openai/streaming.js +4 -35
  188. package/build/esm/tracing/openai/streaming.js.map +1 -1
  189. package/build/esm/tracing/openai/utils.js +79 -196
  190. package/build/esm/tracing/openai/utils.js.map +1 -1
  191. package/build/esm/tracing/sentryNonRecordingSpan.js +7 -0
  192. package/build/esm/tracing/sentryNonRecordingSpan.js.map +1 -1
  193. package/build/esm/tracing/sentrySpan.js +40 -1
  194. package/build/esm/tracing/sentrySpan.js.map +1 -1
  195. package/build/esm/tracing/spans/beforeSendSpan.js +40 -0
  196. package/build/esm/tracing/spans/beforeSendSpan.js.map +1 -0
  197. package/build/esm/tracing/spans/captureSpan.js +122 -0
  198. package/build/esm/tracing/spans/captureSpan.js.map +1 -0
  199. package/build/esm/tracing/spans/envelope.js +36 -0
  200. package/build/esm/tracing/spans/envelope.js.map +1 -0
  201. package/build/esm/tracing/spans/estimateSize.js +39 -0
  202. package/build/esm/tracing/spans/estimateSize.js.map +1 -0
  203. package/build/esm/tracing/spans/hasSpanStreamingEnabled.js +9 -0
  204. package/build/esm/tracing/spans/hasSpanStreamingEnabled.js.map +1 -0
  205. package/build/esm/tracing/spans/spanBuffer.js +156 -0
  206. package/build/esm/tracing/spans/spanBuffer.js.map +1 -0
  207. package/build/esm/tracing/trace.js +84 -14
  208. package/build/esm/tracing/trace.js.map +1 -1
  209. package/build/esm/tracing/utils.js +3 -37
  210. package/build/esm/tracing/utils.js.map +1 -1
  211. package/build/esm/tracing/vercel-ai/constants.js +15 -19
  212. package/build/esm/tracing/vercel-ai/constants.js.map +1 -1
  213. package/build/esm/tracing/vercel-ai/index.js +29 -42
  214. package/build/esm/tracing/vercel-ai/index.js.map +1 -1
  215. package/build/esm/tracing/vercel-ai/utils.js +14 -44
  216. package/build/esm/tracing/vercel-ai/utils.js.map +1 -1
  217. package/build/esm/tracing/vercel-ai/vercel-ai-attributes.js +4 -1
  218. package/build/esm/tracing/vercel-ai/vercel-ai-attributes.js.map +1 -1
  219. package/build/esm/utils/browser.js +2 -3
  220. package/build/esm/utils/browser.js.map +1 -1
  221. package/build/esm/utils/featureFlags.js +6 -0
  222. package/build/esm/utils/featureFlags.js.map +1 -1
  223. package/build/esm/utils/object.js +33 -1
  224. package/build/esm/utils/object.js.map +1 -1
  225. package/build/esm/utils/spanUtils.js +112 -14
  226. package/build/esm/utils/spanUtils.js.map +1 -1
  227. package/build/esm/utils/stacktrace.js +3 -1
  228. package/build/esm/utils/stacktrace.js.map +1 -1
  229. package/build/esm/utils/string.js +3 -0
  230. package/build/esm/utils/string.js.map +1 -1
  231. package/build/esm/utils/version.js +1 -1
  232. package/build/esm/utils/weakRef.js +59 -0
  233. package/build/esm/utils/weakRef.js.map +1 -0
  234. package/build/types/attributes.d.ts +5 -0
  235. package/build/types/attributes.d.ts.map +1 -1
  236. package/build/types/build-time-plugins/buildTimeOptionsBase.d.ts +13 -0
  237. package/build/types/build-time-plugins/buildTimeOptionsBase.d.ts.map +1 -1
  238. package/build/types/client.d.ts +35 -1
  239. package/build/types/client.d.ts.map +1 -1
  240. package/build/types/envelope.d.ts.map +1 -1
  241. package/build/types/fetch.d.ts +12 -8
  242. package/build/types/fetch.d.ts.map +1 -1
  243. package/build/types/index.d.ts +16 -5
  244. package/build/types/index.d.ts.map +1 -1
  245. package/build/types/integration.d.ts.map +1 -1
  246. package/build/types/integrations/conversationId.d.ts.map +1 -1
  247. package/build/types/integrations/express/index.d.ts +82 -0
  248. package/build/types/integrations/express/index.d.ts.map +1 -0
  249. package/build/types/integrations/express/patch-layer.d.ts +32 -0
  250. package/build/types/integrations/express/patch-layer.d.ts.map +1 -0
  251. package/build/types/integrations/express/request-layer-store.d.ts +32 -0
  252. package/build/types/integrations/express/request-layer-store.d.ts.map +1 -0
  253. package/build/types/integrations/express/set-sdk-processing-metadata.d.ts +35 -0
  254. package/build/types/integrations/express/set-sdk-processing-metadata.d.ts.map +1 -0
  255. package/build/types/integrations/express/types.d.ts +158 -0
  256. package/build/types/integrations/express/types.d.ts.map +1 -0
  257. package/build/types/integrations/express/utils.d.ts +93 -0
  258. package/build/types/integrations/express/utils.d.ts.map +1 -0
  259. package/build/types/integrations/mcp-server/correlation.d.ts +2 -1
  260. package/build/types/integrations/mcp-server/correlation.d.ts.map +1 -1
  261. package/build/types/integrations/mcp-server/handlers.d.ts +9 -4
  262. package/build/types/integrations/mcp-server/handlers.d.ts.map +1 -1
  263. package/build/types/integrations/mcp-server/index.d.ts +2 -1
  264. package/build/types/integrations/mcp-server/index.d.ts.map +1 -1
  265. package/build/types/integrations/mcp-server/types.d.ts +40 -7
  266. package/build/types/integrations/mcp-server/types.d.ts.map +1 -1
  267. package/build/types/integrations/mcp-server/validation.d.ts +4 -1
  268. package/build/types/integrations/mcp-server/validation.d.ts.map +1 -1
  269. package/build/types/integrations/requestdata.d.ts.map +1 -1
  270. package/build/types/integrations/spanStreaming.d.ts +2 -0
  271. package/build/types/integrations/spanStreaming.d.ts.map +1 -0
  272. package/build/types/semanticAttributes.d.ts +23 -3
  273. package/build/types/semanticAttributes.d.ts.map +1 -1
  274. package/build/types/tracing/ai/gen-ai-attributes.d.ts +4 -44
  275. package/build/types/tracing/ai/gen-ai-attributes.d.ts.map +1 -1
  276. package/build/types/tracing/ai/utils.d.ts +32 -2
  277. package/build/types/tracing/ai/utils.d.ts.map +1 -1
  278. package/build/types/tracing/anthropic-ai/index.d.ts.map +1 -1
  279. package/build/types/tracing/anthropic-ai/streaming.d.ts.map +1 -1
  280. package/build/types/tracing/anthropic-ai/types.d.ts +5 -0
  281. package/build/types/tracing/anthropic-ai/types.d.ts.map +1 -1
  282. package/build/types/tracing/anthropic-ai/utils.d.ts +1 -1
  283. package/build/types/tracing/anthropic-ai/utils.d.ts.map +1 -1
  284. package/build/types/tracing/dynamicSamplingContext.d.ts.map +1 -1
  285. package/build/types/tracing/google-genai/constants.d.ts +1 -3
  286. package/build/types/tracing/google-genai/constants.d.ts.map +1 -1
  287. package/build/types/tracing/google-genai/index.d.ts.map +1 -1
  288. package/build/types/tracing/google-genai/streaming.d.ts.map +1 -1
  289. package/build/types/tracing/google-genai/types.d.ts +5 -0
  290. package/build/types/tracing/google-genai/types.d.ts.map +1 -1
  291. package/build/types/tracing/index.d.ts +1 -0
  292. package/build/types/tracing/index.d.ts.map +1 -1
  293. package/build/types/tracing/langchain/embeddings.d.ts +27 -0
  294. package/build/types/tracing/langchain/embeddings.d.ts.map +1 -0
  295. package/build/types/tracing/langchain/index.d.ts +1 -0
  296. package/build/types/tracing/langchain/index.d.ts.map +1 -1
  297. package/build/types/tracing/langchain/types.d.ts +5 -0
  298. package/build/types/tracing/langchain/types.d.ts.map +1 -1
  299. package/build/types/tracing/langchain/utils.d.ts +2 -2
  300. package/build/types/tracing/langchain/utils.d.ts.map +1 -1
  301. package/build/types/tracing/langgraph/index.d.ts.map +1 -1
  302. package/build/types/tracing/langgraph/types.d.ts +5 -0
  303. package/build/types/tracing/langgraph/types.d.ts.map +1 -1
  304. package/build/types/tracing/openai/index.d.ts.map +1 -1
  305. package/build/types/tracing/openai/streaming.d.ts.map +1 -1
  306. package/build/types/tracing/openai/types.d.ts +5 -0
  307. package/build/types/tracing/openai/types.d.ts.map +1 -1
  308. package/build/types/tracing/openai/utils.d.ts +4 -49
  309. package/build/types/tracing/openai/utils.d.ts.map +1 -1
  310. package/build/types/tracing/sentryNonRecordingSpan.d.ts +12 -1
  311. package/build/types/tracing/sentryNonRecordingSpan.d.ts.map +1 -1
  312. package/build/types/tracing/sentrySpan.d.ts +10 -1
  313. package/build/types/tracing/sentrySpan.d.ts.map +1 -1
  314. package/build/types/tracing/spans/beforeSendSpan.d.ts +35 -0
  315. package/build/types/tracing/spans/beforeSendSpan.d.ts.map +1 -0
  316. package/build/types/tracing/spans/captureSpan.d.ts +26 -0
  317. package/build/types/tracing/spans/captureSpan.d.ts.map +1 -0
  318. package/build/types/tracing/spans/envelope.d.ts +8 -0
  319. package/build/types/tracing/spans/envelope.d.ts.map +1 -0
  320. package/build/types/tracing/spans/estimateSize.d.ts +12 -0
  321. package/build/types/tracing/spans/estimateSize.d.ts.map +1 -0
  322. package/build/types/tracing/spans/hasSpanStreamingEnabled.d.ts +6 -0
  323. package/build/types/tracing/spans/hasSpanStreamingEnabled.d.ts.map +1 -0
  324. package/build/types/tracing/spans/spanBuffer.d.ts +60 -0
  325. package/build/types/tracing/spans/spanBuffer.d.ts.map +1 -0
  326. package/build/types/tracing/trace.d.ts.map +1 -1
  327. package/build/types/tracing/utils.d.ts.map +1 -1
  328. package/build/types/tracing/vercel-ai/constants.d.ts +2 -5
  329. package/build/types/tracing/vercel-ai/constants.d.ts.map +1 -1
  330. package/build/types/tracing/vercel-ai/index.d.ts.map +1 -1
  331. package/build/types/tracing/vercel-ai/utils.d.ts +1 -5
  332. package/build/types/tracing/vercel-ai/utils.d.ts.map +1 -1
  333. package/build/types/tracing/vercel-ai/vercel-ai-attributes.d.ts +0 -480
  334. package/build/types/tracing/vercel-ai/vercel-ai-attributes.d.ts.map +1 -1
  335. package/build/types/types-hoist/envelope.d.ts +22 -2
  336. package/build/types/types-hoist/envelope.d.ts.map +1 -1
  337. package/build/types/types-hoist/integration.d.ts +8 -0
  338. package/build/types/types-hoist/integration.d.ts.map +1 -1
  339. package/build/types/types-hoist/link.d.ts +2 -2
  340. package/build/types/types-hoist/link.d.ts.map +1 -1
  341. package/build/types/types-hoist/options.d.ts +26 -2
  342. package/build/types/types-hoist/options.d.ts.map +1 -1
  343. package/build/types/types-hoist/span.d.ts +35 -0
  344. package/build/types/types-hoist/span.d.ts.map +1 -1
  345. package/build/types/types-hoist/view-hierarchy.d.ts +1 -0
  346. package/build/types/types-hoist/view-hierarchy.d.ts.map +1 -1
  347. package/build/types/utils/browser.d.ts +1 -1
  348. package/build/types/utils/browser.d.ts.map +1 -1
  349. package/build/types/utils/featureFlags.d.ts.map +1 -1
  350. package/build/types/utils/object.d.ts +10 -0
  351. package/build/types/utils/object.d.ts.map +1 -1
  352. package/build/types/utils/spanUtils.d.ts +27 -2
  353. package/build/types/utils/spanUtils.d.ts.map +1 -1
  354. package/build/types/utils/stacktrace.d.ts.map +1 -1
  355. package/build/types/utils/string.d.ts +2 -2
  356. package/build/types/utils/string.d.ts.map +1 -1
  357. package/build/types/utils/weakRef.d.ts +34 -0
  358. package/build/types/utils/weakRef.d.ts.map +1 -0
  359. package/build/types-ts3.8/attributes.d.ts +5 -0
  360. package/build/types-ts3.8/build-time-plugins/buildTimeOptionsBase.d.ts +13 -0
  361. package/build/types-ts3.8/client.d.ts +35 -1
  362. package/build/types-ts3.8/fetch.d.ts +14 -10
  363. package/build/types-ts3.8/index.d.ts +16 -5
  364. package/build/types-ts3.8/integrations/express/index.d.ts +82 -0
  365. package/build/types-ts3.8/integrations/express/patch-layer.d.ts +32 -0
  366. package/build/types-ts3.8/integrations/express/request-layer-store.d.ts +32 -0
  367. package/build/types-ts3.8/integrations/express/set-sdk-processing-metadata.d.ts +35 -0
  368. package/build/types-ts3.8/integrations/express/types.d.ts +158 -0
  369. package/build/types-ts3.8/integrations/express/utils.d.ts +96 -0
  370. package/build/types-ts3.8/integrations/mcp-server/correlation.d.ts +2 -1
  371. package/build/types-ts3.8/integrations/mcp-server/handlers.d.ts +9 -4
  372. package/build/types-ts3.8/integrations/mcp-server/index.d.ts +2 -1
  373. package/build/types-ts3.8/integrations/mcp-server/types.d.ts +40 -7
  374. package/build/types-ts3.8/integrations/mcp-server/validation.d.ts +4 -1
  375. package/build/types-ts3.8/integrations/spanStreaming.d.ts +2 -0
  376. package/build/types-ts3.8/semanticAttributes.d.ts +23 -3
  377. package/build/types-ts3.8/tracing/ai/gen-ai-attributes.d.ts +4 -44
  378. package/build/types-ts3.8/tracing/ai/utils.d.ts +32 -2
  379. package/build/types-ts3.8/tracing/anthropic-ai/types.d.ts +5 -0
  380. package/build/types-ts3.8/tracing/anthropic-ai/utils.d.ts +1 -1
  381. package/build/types-ts3.8/tracing/google-genai/constants.d.ts +1 -3
  382. package/build/types-ts3.8/tracing/google-genai/types.d.ts +5 -0
  383. package/build/types-ts3.8/tracing/index.d.ts +1 -0
  384. package/build/types-ts3.8/tracing/langchain/embeddings.d.ts +27 -0
  385. package/build/types-ts3.8/tracing/langchain/index.d.ts +1 -0
  386. package/build/types-ts3.8/tracing/langchain/types.d.ts +5 -0
  387. package/build/types-ts3.8/tracing/langchain/utils.d.ts +2 -2
  388. package/build/types-ts3.8/tracing/langgraph/types.d.ts +5 -0
  389. package/build/types-ts3.8/tracing/openai/types.d.ts +5 -0
  390. package/build/types-ts3.8/tracing/openai/utils.d.ts +4 -49
  391. package/build/types-ts3.8/tracing/sentryNonRecordingSpan.d.ts +12 -1
  392. package/build/types-ts3.8/tracing/sentrySpan.d.ts +10 -1
  393. package/build/types-ts3.8/tracing/spans/beforeSendSpan.d.ts +35 -0
  394. package/build/types-ts3.8/tracing/spans/captureSpan.d.ts +26 -0
  395. package/build/types-ts3.8/tracing/spans/envelope.d.ts +8 -0
  396. package/build/types-ts3.8/tracing/spans/estimateSize.d.ts +12 -0
  397. package/build/types-ts3.8/tracing/spans/hasSpanStreamingEnabled.d.ts +6 -0
  398. package/build/types-ts3.8/tracing/spans/spanBuffer.d.ts +60 -0
  399. package/build/types-ts3.8/tracing/vercel-ai/constants.d.ts +2 -5
  400. package/build/types-ts3.8/tracing/vercel-ai/utils.d.ts +1 -5
  401. package/build/types-ts3.8/tracing/vercel-ai/vercel-ai-attributes.d.ts +0 -480
  402. package/build/types-ts3.8/types-hoist/envelope.d.ts +22 -2
  403. package/build/types-ts3.8/types-hoist/integration.d.ts +8 -0
  404. package/build/types-ts3.8/types-hoist/link.d.ts +2 -2
  405. package/build/types-ts3.8/types-hoist/options.d.ts +26 -2
  406. package/build/types-ts3.8/types-hoist/span.d.ts +35 -0
  407. package/build/types-ts3.8/types-hoist/view-hierarchy.d.ts +1 -0
  408. package/build/types-ts3.8/utils/browser.d.ts +1 -1
  409. package/build/types-ts3.8/utils/object.d.ts +10 -0
  410. package/build/types-ts3.8/utils/spanUtils.d.ts +27 -2
  411. package/build/types-ts3.8/utils/string.d.ts +2 -2
  412. package/build/types-ts3.8/utils/weakRef.d.ts +34 -0
  413. package/package.json +1 -1
@@ -0,0 +1,158 @@
1
+ /**
2
+ * Platform-portable Express tracing integration.
3
+ *
4
+ * @module
5
+ *
6
+ * This Sentry integration is a derivative work based on the OpenTelemetry
7
+ * Express instrumentation.
8
+ *
9
+ * <https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/packages/instrumentation-express>
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 type { RequestEventData } from '../../types-hoist/request';
30
+ import type { SpanAttributes } from '../../types-hoist/span';
31
+ export declare const ATTR_EXPRESS_NAME = "express.name";
32
+ export declare const ATTR_HTTP_ROUTE = "http.route";
33
+ export declare const ATTR_EXPRESS_TYPE = "express.type";
34
+ export type ExpressExport = {
35
+ Router: ExpressRouterv5 | ExpressRouterv4;
36
+ application: ExpressApplication;
37
+ };
38
+ export type ExpressExportv5 = ExpressExport & {
39
+ Router: ExpressRouterv5;
40
+ };
41
+ export type ExpressExportv4 = ExpressExport & {
42
+ Router: ExpressRouterv4;
43
+ };
44
+ export type ExpressModuleExport = ExpressExport | {
45
+ default: ExpressExport;
46
+ };
47
+ export interface ExpressRequest extends RequestEventData {
48
+ originalUrl: string;
49
+ route: unknown;
50
+ res?: ExpressResponse;
51
+ }
52
+ export interface ExpressResponse {
53
+ once(ev: string, listener: Function): this;
54
+ removeListener(ev: string, listener?: Function): this;
55
+ emit(ev: string, ...data: unknown[]): this;
56
+ }
57
+ export interface NextFunction {
58
+ (err?: unknown): void;
59
+ /**
60
+ * "Break-out" of a router by calling {next('router')};
61
+ * @see {https://expressjs.com/en/guide/using-middleware.html#middleware.router}
62
+ */
63
+ (deferToNext: 'router'): void;
64
+ /**
65
+ * "Break-out" of a route by calling {next('route')};
66
+ * @see {https://expressjs.com/en/guide/using-middleware.html#middleware.application}
67
+ */
68
+ (deferToNext: 'route'): void;
69
+ }
70
+ export type ExpressApplicationRequestHandler = (...handlers: any[]) => any;
71
+ export type ExpressRequestInfo<T = unknown> = {
72
+ /** An express request object */
73
+ request: T;
74
+ route: string;
75
+ layerType: ExpressLayerType;
76
+ };
77
+ export type ExpressLayerType = 'router' | 'middleware' | 'request_handler';
78
+ export declare const ExpressLayerType_ROUTER = "router";
79
+ export declare const ExpressLayerType_MIDDLEWARE = "middleware";
80
+ export declare const ExpressLayerType_REQUEST_HANDLER = "request_handler";
81
+ export type PathParams = string | RegExp | Array<string | RegExp>;
82
+ export type LayerPathSegment = string | RegExp | number;
83
+ export interface ExpressRoute {
84
+ path: string;
85
+ stack: ExpressLayer[];
86
+ }
87
+ export type ExpressRouterv4 = ExpressRouter;
88
+ export interface ExpressRouterv5 {
89
+ prototype: ExpressRouter;
90
+ }
91
+ export type ExpressLayer = {
92
+ handle: Function & Record<string, unknown> & {
93
+ stack?: ExpressLayer[];
94
+ };
95
+ name: string;
96
+ params: {
97
+ [key: string]: string;
98
+ };
99
+ path?: string;
100
+ regexp: RegExp;
101
+ route?: ExpressLayer;
102
+ };
103
+ export type ExpressRouter = {
104
+ params: {
105
+ [key: string]: string;
106
+ };
107
+ _params: string[];
108
+ caseSensitive: boolean;
109
+ mergeParams: boolean;
110
+ strict: boolean;
111
+ stack: ExpressLayer[];
112
+ route(prefix: PathParams): ExpressRoute;
113
+ use(...handlers: unknown[]): unknown;
114
+ };
115
+ export type IgnoreMatcher = string | RegExp | ((name: string) => boolean);
116
+ export type ExpressIntegrationOptions = {
117
+ /**
118
+ * @deprecated Pass the express module as the first argument, and an
119
+ * options getter as the second argument to patchExpressModule.
120
+ */
121
+ express?: ExpressModuleExport;
122
+ /** Ignore specific based on their name */
123
+ ignoreLayers?: IgnoreMatcher[];
124
+ /** Ignore specific layers based on their type */
125
+ ignoreLayersType?: ExpressLayerType[];
126
+ /**
127
+ * Optional callback invoked each time a layer resolves the matched HTTP route.
128
+ * Platform-specific integrations (e.g. Node.js) use this to propagate the
129
+ * resolved route to the underlying transport layer (e.g. OTel RPCMetadata).
130
+ */
131
+ onRouteResolved?: (route: string | undefined) => void;
132
+ };
133
+ export type LayerMetadata = {
134
+ attributes: SpanAttributes;
135
+ name: string;
136
+ };
137
+ export interface ExpressApplication {
138
+ stack: ExpressLayer[];
139
+ use: ExpressApplicationRequestHandler;
140
+ }
141
+ export interface MiddlewareError extends Error {
142
+ status?: number | string;
143
+ statusCode?: number | string;
144
+ status_code?: number | string;
145
+ output?: {
146
+ statusCode?: number | string;
147
+ };
148
+ }
149
+ export type ExpressMiddleware = (req: ExpressRequest, res: ExpressResponse, next: () => void) => void;
150
+ export type ExpressErrorMiddleware = (error: MiddlewareError, req: ExpressRequest, res: ExpressResponse, next: (error: MiddlewareError) => void) => void;
151
+ export interface ExpressHandlerOptions {
152
+ /**
153
+ * Callback method deciding whether error should be captured and sent to Sentry
154
+ * @param error Captured middleware error
155
+ */
156
+ shouldHandleError?(this: void, error: MiddlewareError): boolean;
157
+ }
158
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/integrations/express/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,eAAO,MAAM,iBAAiB,iBAAiB,CAAC;AAChD,eAAO,MAAM,eAAe,eAAe,CAAC;AAC5C,eAAO,MAAM,iBAAiB,iBAAiB,CAAC;AAEhD,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,eAAe,GAAG,eAAe,CAAC;IAC1C,WAAW,EAAE,kBAAkB,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,aAAa,GAAG;IAC5C,MAAM,EAAE,eAAe,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,aAAa,GAAG;IAC5C,MAAM,EAAE,eAAe,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,aAAa,GAAG;IAAE,OAAO,EAAE,aAAa,CAAA;CAAE,CAAC;AAE7E,MAAM,WAAW,cAAe,SAAQ,gBAAgB;IACtD,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,OAAO,CAAC;IAGf,GAAG,CAAC,EAAE,eAAe,CAAC;CACvB;AAID,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAA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C1B,UAAU,EAAE,cAAc,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,GAAG,EAAE,gCAAgC,CAAC;CACvC;AAED,MAAM,WAAW,eAAgB,SAAQ,KAAK;IAC5C,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,MAAM,CAAC,EAAE;QACP,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;KAC9B,CAAC;CACH;AAED,MAAM,MAAM,iBAAiB,GAAG,CAAC,GAAG,EAAE,cAAc,EAAE,GAAG,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;AAEtG,MAAM,MAAM,sBAAsB,GAAG,CACnC,KAAK,EAAE,eAAe,EACtB,GAAG,EAAE,cAAc,EACnB,GAAG,EAAE,eAAe,EACpB,IAAI,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,KACnC,IAAI,CAAC;AAEV,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,iBAAiB,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC;CACjE"}
@@ -0,0 +1,93 @@
1
+ /**
2
+ * Platform-portable Express tracing integration.
3
+ *
4
+ * @module
5
+ *
6
+ * This Sentry integration is a derivative work based on the OpenTelemetry
7
+ * Express instrumentation.
8
+ *
9
+ * <https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/packages/instrumentation-express>
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 type { SpanAttributes } from '../../types-hoist/span';
30
+ import type { ExpressExport, ExpressIntegrationOptions, ExpressLayer, ExpressLayerType, ExpressRequest, MiddlewareError, ExpressExportv5, ExpressExportv4 } from './types';
31
+ import { ATTR_EXPRESS_NAME, ATTR_EXPRESS_TYPE } from './types';
32
+ /**
33
+ * Converts a user-provided error value into an error and error message pair
34
+ *
35
+ * @param error - User-provided error value
36
+ * @returns Both an Error or string representation of the value and an error message
37
+ */
38
+ export declare const asErrorAndMessage: (error: unknown) => [string | Error, string];
39
+ /**
40
+ * Checks if a route contains parameter patterns (e.g., :id, :userId)
41
+ * which are valid even if they don't exactly match the original URL
42
+ */
43
+ export declare function isRoutePattern(route: string): boolean;
44
+ /**
45
+ * Parse express layer context to retrieve a name and attributes.
46
+ * @param route The route of the layer
47
+ * @param layer Express layer
48
+ * @param [layerPath] if present, the path on which the layer has been mounted
49
+ */
50
+ export declare const getLayerMetadata: (route: string, layer: ExpressLayer, layerPath?: string) => {
51
+ attributes: SpanAttributes & {
52
+ [ATTR_EXPRESS_NAME]: string;
53
+ [ATTR_EXPRESS_TYPE]: ExpressLayerType;
54
+ };
55
+ name: string;
56
+ };
57
+ /**
58
+ * Recursively search the router path from layer stack
59
+ * @param path The path to reconstruct
60
+ * @param layer The layer to reconstruct from
61
+ * @returns The reconstructed path
62
+ */
63
+ export declare const getRouterPath: (path: string, layer: ExpressLayer) => string;
64
+ /**
65
+ * Check whether the given request is ignored by configuration
66
+ * It will not re-throw exceptions from `list` provided by the client
67
+ * @param constant e.g URL of request
68
+ * @param [list] List of ignore patterns
69
+ * @param [onException] callback for doing something when an exception has
70
+ * occurred
71
+ */
72
+ export type ExpressIsLayerIgnoredOptions = Pick<ExpressIntegrationOptions, 'ignoreLayersType' | 'ignoreLayers'>;
73
+ export declare const isLayerIgnored: (name: string, type: ExpressLayerType, config?: ExpressIsLayerIgnoredOptions) => boolean;
74
+ /**
75
+ * Extracts the actual matched route from Express request for OpenTelemetry instrumentation.
76
+ * Returns the route that should be used as the http.route attribute.
77
+ *
78
+ * @param req - The Express request object with layers store
79
+ * @param constructedRoute - The constructed route from `getConstructedRoute`
80
+ * @returns The matched route string or undefined if no valid route is found
81
+ */
82
+ export declare function getActualMatchedRoute(req: ExpressRequest, constructedRoute: string): string | undefined;
83
+ export declare function getConstructedRoute(req: ExpressRequest): string;
84
+ export declare const getLayerPath: (args: unknown[]) => string | undefined;
85
+ export declare const isExpressWithRouterPrototype: (express: unknown) => express is ExpressExportv5;
86
+ export declare const isExpressWithoutRouterPrototype: (express: unknown) => express is ExpressExportv4;
87
+ export declare const hasDefaultProp: (express: unknown) => express is {
88
+ [k: string]: unknown;
89
+ default: ExpressExport;
90
+ };
91
+ /** Returns true if response code is internal server error */
92
+ export declare function defaultShouldHandleError(error: MiddlewareError): boolean;
93
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/integrations/express/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,KAAK,EACV,aAAa,EACb,yBAAyB,EACzB,YAAY,EACZ,gBAAgB,EAChB,cAAc,EAEd,eAAe,EAEf,eAAe,EACf,eAAe,EAChB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EAIlB,MAAM,SAAS,CAAC;AAGjB;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAAI,OAAO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AC;IACrB,OAAO,EAAE,aAAa,CAAC;CACqF,CAAC;AAO/G,6DAA6D;AAC7D,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAGxE"}
@@ -25,8 +25,9 @@ export declare function storeSpanForRequest(transport: MCPTransport, requestId:
25
25
  * @param requestId - Request identifier
26
26
  * @param result - Execution result for attribute extraction
27
27
  * @param options - Resolved MCP options
28
+ * @param hasError - Whether the JSON-RPC response contained an error
28
29
  */
29
- export declare function completeSpanWithResults(transport: MCPTransport, requestId: RequestId, result: unknown, options: ResolvedMcpOptions): void;
30
+ export declare function completeSpanWithResults(transport: MCPTransport, requestId: RequestId, result: unknown, options: ResolvedMcpOptions, hasError?: boolean): void;
30
31
  /**
31
32
  * Cleans up pending spans for a specific transport (when that transport closes)
32
33
  * @param transport - MCP transport instance
@@ -1 +1 @@
1
- {"version":3,"file":"correlation.d.ts","sourceRoot":"","sources":["../../../../src/integrations/mcp-server/correlation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAInD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAuB,kBAAkB,EAAE,MAAM,SAAS,CAAC;AA2ChG;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAQnH;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,YAAY,EACvB,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,kBAAkB,GAC1B,IAAI,CA6BN;AAED;;;GAGG;AACH,wBAAgB,+BAA+B,CAAC,SAAS,EAAE,YAAY,GAAG,IAAI,CAgC7E"}
1
+ {"version":3,"file":"correlation.d.ts","sourceRoot":"","sources":["../../../../src/integrations/mcp-server/correlation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAInD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAuB,kBAAkB,EAAE,MAAM,SAAS,CAAC;AA2ChG;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAQnH;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,YAAY,EACvB,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,kBAAkB,EAC3B,QAAQ,UAAQ,GACf,IAAI,CA+BN;AAED;;;GAGG;AACH,wBAAgB,+BAA+B,CAAC,SAAS,EAAE,YAAY,GAAG,IAAI,CAgC7E"}
@@ -6,22 +6,27 @@
6
6
  */
7
7
  import type { MCPServerInstance } from './types';
8
8
  /**
9
- * Wraps tool handlers to associate them with request spans
9
+ * Wraps tool handlers to associate them with request spans.
10
+ * Instruments both `tool` (legacy API) and `registerTool` (new API) if present.
10
11
  * @param serverInstance - MCP server instance
11
12
  */
12
13
  export declare function wrapToolHandlers(serverInstance: MCPServerInstance): void;
13
14
  /**
14
- * Wraps resource handlers to associate them with request spans
15
+ * Wraps resource handlers to associate them with request spans.
16
+ * Instruments both `resource` (legacy API) and `registerResource` (new API) if present.
15
17
  * @param serverInstance - MCP server instance
16
18
  */
17
19
  export declare function wrapResourceHandlers(serverInstance: MCPServerInstance): void;
18
20
  /**
19
- * Wraps prompt handlers to associate them with request spans
21
+ * Wraps prompt handlers to associate them with request spans.
22
+ * Instruments both `prompt` (legacy API) and `registerPrompt` (new API) if present.
20
23
  * @param serverInstance - MCP server instance
21
24
  */
22
25
  export declare function wrapPromptHandlers(serverInstance: MCPServerInstance): void;
23
26
  /**
24
- * Wraps all MCP handler types (tool, resource, prompt) for span correlation
27
+ * Wraps all MCP handler types for span correlation.
28
+ * Supports both the legacy API (`tool`, `resource`, `prompt`) and the newer API
29
+ * (`registerTool`, `registerResource`, `registerPrompt`), instrumenting whichever methods are present.
25
30
  * @param serverInstance - MCP server instance
26
31
  */
27
32
  export declare function wrapAllMCPHandlers(serverInstance: MCPServerInstance): void;
@@ -1 +1 @@
1
- {"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../../../src/integrations/mcp-server/handlers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,EAAc,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAqH7D;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,cAAc,EAAE,iBAAiB,GAAG,IAAI,CAExE;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,cAAc,EAAE,iBAAiB,GAAG,IAAI,CAE5E;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,cAAc,EAAE,iBAAiB,GAAG,IAAI,CAE1E;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,cAAc,EAAE,iBAAiB,GAAG,IAAI,CAI1E"}
1
+ {"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../../../src/integrations/mcp-server/handlers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,EAAc,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAqH7D;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,cAAc,EAAE,iBAAiB,GAAG,IAAI,CAGxE;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,cAAc,EAAE,iBAAiB,GAAG,IAAI,CAG5E;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,cAAc,EAAE,iBAAiB,GAAG,IAAI,CAG1E;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,cAAc,EAAE,iBAAiB,GAAG,IAAI,CAI1E"}
@@ -2,7 +2,8 @@ import type { McpServerWrapperOptions } from './types';
2
2
  /**
3
3
  * Wraps a MCP Server instance from the `@modelcontextprotocol/sdk` package with Sentry instrumentation.
4
4
  *
5
- * Compatible with versions `^1.9.0` of the `@modelcontextprotocol/sdk` package.
5
+ * Compatible with versions `^1.9.0` of the `@modelcontextprotocol/sdk` package (legacy `tool`/`resource`/`prompt` API)
6
+ * and versions that expose the newer `registerTool`/`registerResource`/`registerPrompt` API (introduced in 1.x, sole API in 2.x).
6
7
  * Automatically instruments transport methods and handler functions for comprehensive monitoring.
7
8
  *
8
9
  * @example
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/integrations/mcp-server/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAqB,uBAAuB,EAAoC,MAAM,SAAS,CAAC;AAS5G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,SAAS,MAAM,EAAE,iBAAiB,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,uBAAuB,GAAG,CAAC,CAuCpH"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/integrations/mcp-server/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAqB,uBAAuB,EAAoC,MAAM,SAAS,CAAC;AAS5G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,SAAS,MAAM,EAAE,iBAAiB,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,uBAAuB,GAAG,CAAC,CAuCpH"}
@@ -74,15 +74,48 @@ export interface MCPTransport {
74
74
  export type JsonRpcMessage = JsonRpcRequest | JsonRpcNotification | JsonRpcResponse;
75
75
  /**
76
76
  * MCP server instance interface
77
- * @description MCP server methods for registering handlers
77
+ * @description MCP server methods for registering handlers.
78
+ * Supports both the legacy API (`tool`, `resource`, `prompt`) used in SDK 1.x
79
+ * and the newer API (`registerTool`, `registerResource`, `registerPrompt`) introduced in SDK 1.x
80
+ * and made the only option in SDK 2.x.
78
81
  */
79
82
  export interface MCPServerInstance {
80
- /** Register a resource handler */
81
- resource: (name: string, ...args: unknown[]) => void;
82
- /** Register a tool handler */
83
- tool: (name: string, ...args: unknown[]) => void;
84
- /** Register a prompt handler */
85
- prompt: (name: string, ...args: unknown[]) => void;
83
+ /**
84
+ * Register a resource handler.
85
+ * Supported in `@modelcontextprotocol/sdk` v1.x alongside `registerResource`.
86
+ * @deprecated Removed in `@modelcontextprotocol/sdk` v2.0.0 — use `registerResource` instead.
87
+ */
88
+ resource?: (name: string, ...args: unknown[]) => void;
89
+ /**
90
+ * Register a tool handler.
91
+ * Supported in `@modelcontextprotocol/sdk` v1.x alongside `registerTool`.
92
+ * @deprecated Removed in `@modelcontextprotocol/sdk` v2.0.0 — use `registerTool` instead.
93
+ */
94
+ tool?: (name: string, ...args: unknown[]) => void;
95
+ /**
96
+ * Register a prompt handler.
97
+ * Supported in `@modelcontextprotocol/sdk` v1.x alongside `registerPrompt`.
98
+ * @deprecated Removed in `@modelcontextprotocol/sdk` v2.0.0 — use `registerPrompt` instead.
99
+ */
100
+ prompt?: (name: string, ...args: unknown[]) => void;
101
+ /**
102
+ * Register a resource handler.
103
+ * Available in `@modelcontextprotocol/sdk` v1.x (alongside the legacy `resource` method)
104
+ * and the only supported form in v2.0.0+.
105
+ */
106
+ registerResource?: (name: string, ...args: unknown[]) => void;
107
+ /**
108
+ * Register a tool handler.
109
+ * Available in `@modelcontextprotocol/sdk` v1.x (alongside the legacy `tool` method)
110
+ * and the only supported form in v2.0.0+.
111
+ */
112
+ registerTool?: (name: string, ...args: unknown[]) => void;
113
+ /**
114
+ * Register a prompt handler.
115
+ * Available in `@modelcontextprotocol/sdk` v1.x (alongside the legacy `prompt` method)
116
+ * and the only supported form in v2.0.0+.
117
+ */
118
+ registerPrompt?: (name: string, ...args: unknown[]) => void;
86
119
  /** Connect the server to a transport */
87
120
  connect(transport: MCPTransport): Promise<void>;
88
121
  }
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/integrations/mcp-server/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAEnD,2CAA2C;AAE3C;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,KAAK,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,KAAK,CAAC;IACf,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC3B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,YAAY,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,KAAK,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED;;;GAGG;AACH,MAAM,WAAW,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MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAC,uBAAuB,CAAC,CAAC"}
@@ -23,7 +23,10 @@ export declare function isJsonRpcNotification(message: unknown): message is Json
23
23
  */
24
24
  export declare function isJsonRpcResponse(message: unknown): message is JsonRpcResponse;
25
25
  /**
26
- * Validates MCP server instance with type checking
26
+ * Validates MCP server instance with type checking.
27
+ * Accepts both the legacy API (`tool`, `resource`, `prompt`) used in SDK 1.x
28
+ * and the newer API (`registerTool`, `registerResource`, `registerPrompt`) introduced
29
+ * alongside the legacy API in SDK 1.x and made the only option in SDK 2.x.
27
30
  * @param instance - Object to validate as MCP server instance
28
31
  * @returns True if instance has required MCP server methods
29
32
  */
@@ -1 +1 @@
1
- {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../../src/integrations/mcp-server/validation.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAEpF;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,cAAc,CAS5E;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,mBAAmB,CAStF;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,eAAe,CAS9E;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,CAapE;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEjF"}
1
+ {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../../src/integrations/mcp-server/validation.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAEpF;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,cAAc,CAS5E;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,mBAAmB,CAStF;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,eAAe,CAS9E;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,CAYpE;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEjF"}
@@ -1 +1 @@
1
- {"version":3,"file":"requestdata.d.ts","sourceRoot":"","sources":["../../../src/integrations/requestdata.ts"],"names":[],"mappings":"AAOA,UAAU,yBAAyB;IACjC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED,KAAK,6BAA6B,GAAG;IACnC;;OAEG;IACH,OAAO,CAAC,EAAE,yBAAyB,CAAC;CACrC,CAAC;AAuCF;;;GAGG;AACH,eAAO,MAAM,sBAAsB,2GAA6C,CAAC"}
1
+ {"version":3,"file":"requestdata.d.ts","sourceRoot":"","sources":["../../../src/integrations/requestdata.ts"],"names":[],"mappings":"AAQA,UAAU,yBAAyB;IACjC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED,KAAK,6BAA6B,GAAG;IACnC;;OAEG;IACH,OAAO,CAAC,EAAE,yBAAyB,CAAC;CACrC,CAAC;AAuCF;;;GAGG;AACH,eAAO,MAAM,sBAAsB,2GAA6C,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const spanStreamingIntegration: () => import("../types-hoist/integration").Integration;
2
+ //# sourceMappingURL=spanStreaming.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spanStreaming.d.ts","sourceRoot":"","sources":["../../../src/integrations/spanStreaming.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,wBAAwB,wDAiCX,CAAC"}
@@ -1,7 +1,7 @@
1
1
  /**
2
- * Use this attribute to represent the source of a span.
3
- * Should be one of: custom, url, route, view, component, task, unknown
4
- *
2
+ * Use this attribute to represent the source of a span name.
3
+ * Must be one of: custom, url, route, view, component, task
4
+ * TODO(v11): rename this to sentry.span.source'
5
5
  */
6
6
  export declare const SEMANTIC_ATTRIBUTE_SENTRY_SOURCE = "sentry.source";
7
7
  /**
@@ -32,6 +32,26 @@ export declare const SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON = "sentry
32
32
  export declare const SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT = "sentry.measurement_unit";
33
33
  /** The value of a measurement, which may be stored as a TimedEvent. */
34
34
  export declare const SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE = "sentry.measurement_value";
35
+ /** The release version of the application */
36
+ export declare const SEMANTIC_ATTRIBUTE_SENTRY_RELEASE = "sentry.release";
37
+ /** The environment name (e.g., "production", "staging", "development") */
38
+ export declare const SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT = "sentry.environment";
39
+ /** The segment name (e.g., "GET /users") */
40
+ export declare const SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_NAME = "sentry.segment.name";
41
+ /** The id of the segment that this span belongs to. */
42
+ export declare const SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_ID = "sentry.segment.id";
43
+ /** The name of the Sentry SDK (e.g., "sentry.php", "sentry.javascript") */
44
+ export declare const SEMANTIC_ATTRIBUTE_SENTRY_SDK_NAME = "sentry.sdk.name";
45
+ /** The version of the Sentry SDK */
46
+ export declare const SEMANTIC_ATTRIBUTE_SENTRY_SDK_VERSION = "sentry.sdk.version";
47
+ /** The user ID (gated by sendDefaultPii) */
48
+ export declare const SEMANTIC_ATTRIBUTE_USER_ID = "user.id";
49
+ /** The user email (gated by sendDefaultPii) */
50
+ export declare const SEMANTIC_ATTRIBUTE_USER_EMAIL = "user.email";
51
+ /** The user IP address (gated by sendDefaultPii) */
52
+ export declare const SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS = "user.ip_address";
53
+ /** The user username (gated by sendDefaultPii) */
54
+ export declare const SEMANTIC_ATTRIBUTE_USER_USERNAME = "user.name";
35
55
  /**
36
56
  * A custom span name set by users guaranteed to be taken over any automatically
37
57
  * inferred name. This attribute is removed before the span is sent.
@@ -1 +1 @@
1
- {"version":3,"file":"semanticAttributes.d.ts","sourceRoot":"","sources":["../../src/semanticAttributes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,gCAAgC,kBAAkB,CAAC;AAEhE;;;;;GAKG;AACH,eAAO,MAAM,qCAAqC,uBAAuB,CAAC;AAE1E;;;;;GAKG;AACH,eAAO,MAAM,oDAAoD,sCAAsC,CAAC;AAExG;;GAEG;AACH,eAAO,MAAM,4BAA4B,cAAc,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,gCAAgC,kBAAkB,CAAC;AAEhE,4CAA4C;AAC5C,eAAO,MAAM,iDAAiD,mCAAmC,CAAC;AAElG,sEAAsE;AACtE,eAAO,MAAM,0CAA0C,4BAA4B,CAAC;AAEpF,uEAAuE;AACvE,eAAO,MAAM,2CA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uDAAuD;AACvD,eAAO,MAAM,oCAAoC,sBAAsB,CAAC;AACxE,2EAA2E;AAC3E,eAAO,MAAM,kCAAkC,oBAAoB,CAAC;AACpE,oCAAoC;AACpC,eAAO,MAAM,qCAAqC,uBAAuB,CAAC;AAE1E,4CAA4C;AAC5C,eAAO,MAAM,0BAA0B,YAAY,CAAC;AACpD,+CAA+C;AAC/C,eAAO,MAAM,6BAA6B,eAAe,CAAC;AAC1D,oDAAoD;AACpD,eAAO,MAAM,kCAAkC,oBAAoB,CAAC;AACpE,kDAAkD;AAClD,eAAO,MAAM,gCAAgC,cAAc,CAAC;AAE5D;;;;;;GAMG;AACH,eAAO,MAAM,0CAA0C,4BAA4B,CAAC;AAEpF;;GAEG;AACH,eAAO,MAAM,6BAA6B,sBAAsB,CAAC;AAEjE,eAAO,MAAM,iCAAiC,0BAA0B,CAAC;AAEzE,eAAO,MAAM,4BAA4B,cAAc,CAAC;AAExD,eAAO,MAAM,4BAA4B,cAAc,CAAC;AAExD,eAAO,MAAM,kCAAkC,oBAAoB,CAAC;AAEpE,uEAAuE;AACvE,eAAO,MAAM,sCAAsC,wBAAwB,CAAC;AAC5E,eAAO,MAAM,2BAA2B,aAAa,CAAC;AAEtD;;;;;;;;;GASG;AACH,eAAO,MAAM,iCAAiC,qBAAqB,CAAC;AAEpE;;;;;;GAMG;AAEH;;;;GAIG;AACH,eAAO,MAAM,gCAAgC,2BAA2B,CAAC"}
@@ -165,34 +165,18 @@ export declare const GEN_AI_USAGE_INPUT_TOKENS_CACHED_ATTRIBUTE = "gen_ai.usage.
165
165
  */
166
166
  export declare const GEN_AI_INVOKE_AGENT_OPERATION_ATTRIBUTE = "gen_ai.invoke_agent";
167
167
  /**
168
- * The span operation name for generating text
168
+ * The span operation name for generating content
169
169
  */
170
- export declare const GEN_AI_GENERATE_TEXT_DO_GENERATE_OPERATION_ATTRIBUTE = "gen_ai.generate_text";
171
- /**
172
- * The span operation name for streaming text
173
- */
174
- export declare const GEN_AI_STREAM_TEXT_DO_STREAM_OPERATION_ATTRIBUTE = "gen_ai.stream_text";
175
- /**
176
- * The span operation name for generating object
177
- */
178
- export declare const GEN_AI_GENERATE_OBJECT_DO_GENERATE_OPERATION_ATTRIBUTE = "gen_ai.generate_object";
179
- /**
180
- * The span operation name for streaming object
181
- */
182
- export declare const GEN_AI_STREAM_OBJECT_DO_STREAM_OPERATION_ATTRIBUTE = "gen_ai.stream_object";
170
+ export declare const GEN_AI_GENERATE_CONTENT_OPERATION_ATTRIBUTE = "gen_ai.generate_content";
183
171
  /**
184
172
  * The embeddings input
185
173
  * Only recorded when recordInputs is enabled
186
174
  */
187
175
  export declare const GEN_AI_EMBEDDINGS_INPUT_ATTRIBUTE = "gen_ai.embeddings.input";
188
176
  /**
189
- * The span operation name for embedding
190
- */
191
- export declare const GEN_AI_EMBED_DO_EMBED_OPERATION_ATTRIBUTE = "gen_ai.embeddings";
192
- /**
193
- * The span operation name for embedding many
177
+ * The span operation for embeddings
194
178
  */
195
- export declare const GEN_AI_EMBED_MANY_DO_EMBED_OPERATION_ATTRIBUTE = "gen_ai.embeddings";
179
+ export declare const GEN_AI_EMBEDDINGS_OPERATION_ATTRIBUTE = "gen_ai.embeddings";
196
180
  /**
197
181
  * The span operation name for reranking
198
182
  */
@@ -226,28 +210,4 @@ export declare const GEN_AI_TOOL_OUTPUT_ATTRIBUTE = "gen_ai.tool.output";
226
210
  * @see https://opentelemetry.io/docs/specs/semconv/registry/attributes/gen-ai/#gen-ai-tool-description
227
211
  */
228
212
  export declare const GEN_AI_TOOL_DESCRIPTION_ATTRIBUTE = "gen_ai.tool.description";
229
- /**
230
- * The response ID from OpenAI
231
- */
232
- export declare const OPENAI_RESPONSE_ID_ATTRIBUTE = "openai.response.id";
233
- /**
234
- * The response model from OpenAI
235
- */
236
- export declare const OPENAI_RESPONSE_MODEL_ATTRIBUTE = "openai.response.model";
237
- /**
238
- * The response timestamp from OpenAI (ISO string)
239
- */
240
- export declare const OPENAI_RESPONSE_TIMESTAMP_ATTRIBUTE = "openai.response.timestamp";
241
- /**
242
- * The number of completion tokens used
243
- */
244
- export declare const OPENAI_USAGE_COMPLETION_TOKENS_ATTRIBUTE = "openai.usage.completion_tokens";
245
- /**
246
- * The number of prompt tokens used
247
- */
248
- export declare const OPENAI_USAGE_PROMPT_TOKENS_ATTRIBUTE = "openai.usage.prompt_tokens";
249
- /**
250
- * The response timestamp from Anthropic AI (ISO string)
251
- */
252
- export declare const ANTHROPIC_AI_RESPONSE_TIMESTAMP_ATTRIBUTE = "anthropic.response.timestamp";
253
213
  //# sourceMappingURL=gen-ai-attributes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"gen-ai-attributes.d.ts","sourceRoot":"","sources":["../../../../src/tracing/ai/gen-ai-attributes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH;;GAEG;AACH,eAAO,MAAM,uBAAuB,kBAAkB,CAAC;AAEvD;;;GAGG;AACH,eAAO,MAAM,uBAAuB,kBAAkB,CAAC;AAEvD;;;GAGG;AACH,eAAO,MAAM,8BAA8B,yBAAyB,CAAC;AAErE;;GAEG;AACH,eAAO,MAAM,+BAA+B,0BAA0B,CAAC;AAEvE;;GAEG;AACH,eAAO,MAAM,oCAAoC,+BAA+B,CAAC;AAEjF;;GAEG;AACH,eAAO,MAAM,mCAAmC,8BAA8B,CAAC;AAE/E;;GAEG;AACH,eAAO,MAAM,0CAA0C,qCAAqC,CAAC;AAE7F;;GAEG;AACH,eAAO,MAAM,yCAAyC,oCAAoC,CAAC;AAE3F;;GAEG;AACH,eAAO,MAAM,8BAA8B,yBAAyB,CAAC;AAErE;;GAEG;AACH,eAAO,MAAM,8BAA8B,yBAAyB,CAAC;AAErE;;GAEG;AACH,eAAO,MAAM,uCAAuC,kCAAkC,CAAC;AAEvF;;GAEG;AACH,eAAO,MAAM,wCAAwC,mCAAmC,CAAC;AAEzF;;GAEG;AACH,eAAO,MAAM,mCAAmC,8BAA8B,CAAC;AAE/E;;GAEG;AACH,eAA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AEnE;;GAEG;AACH,eAAO,MAAM,0BAA0B,qBAAqB,CAAC;AAE7D;;GAEG;AACH,eAAO,MAAM,2BAA2B,sBAAsB,CAAC;AAE/D;;GAEG;AACH,eAAO,MAAM,4BAA4B,uBAAuB,CAAC;AAEjE;;;GAGG;AACH,eAAO,MAAM,iCAAiC,4BAA4B,CAAC"}
@@ -8,10 +8,12 @@ export interface AIRecordingOptions {
8
8
  * which gen_ai operation it maps to and whether it is intrinsically streaming.
9
9
  */
10
10
  export interface InstrumentedMethodEntry {
11
- /** Operation name (e.g. 'chat', 'embeddings', 'generate_content') */
12
- operation: string;
11
+ /** Operation name (e.g. 'chat', 'embeddings', 'generate_content'). Omit for factory methods that only need result proxying. */
12
+ operation?: string;
13
13
  /** True if the method itself is always streaming (not param-based) */
14
14
  streaming?: boolean;
15
+ /** When set, the method's return value is re-proxied with this as the base path */
16
+ proxyResultPath?: string;
15
17
  }
16
18
  /**
17
19
  * Maps method paths to their registry entries.
@@ -24,6 +26,12 @@ export type InstrumentedMethodRegistry = Record<string, InstrumentedMethodEntry>
24
26
  * Precedence: explicit option > sendDefaultPii > false
25
27
  */
26
28
  export declare function resolveAIRecordingOptions<T extends AIRecordingOptions>(options?: T): T & Required<AIRecordingOptions>;
29
+ /**
30
+ * Resolves whether truncation should be enabled.
31
+ * If the user explicitly set `enableTruncation`, that value is used.
32
+ * Otherwise, truncation is disabled when span streaming is active.
33
+ */
34
+ export declare function shouldEnableTruncation(enableTruncation: boolean | undefined): boolean;
27
35
  /**
28
36
  * Build method path from current traversal
29
37
  */
@@ -37,6 +45,28 @@ export declare function buildMethodPath(currentPath: string, prop: string): stri
37
45
  * @param cachedOutputTokens - The number of cached output tokens
38
46
  */
39
47
  export declare function setTokenUsageAttributes(span: Span, promptTokens?: number, completionTokens?: number, cachedInputTokens?: number, cachedOutputTokens?: number): void;
48
+ export interface StreamResponseState {
49
+ responseId?: string;
50
+ responseModel?: string;
51
+ finishReasons: string[];
52
+ responseTexts: string[];
53
+ toolCalls: unknown[];
54
+ promptTokens?: number;
55
+ completionTokens?: number;
56
+ totalTokens?: number;
57
+ cacheCreationInputTokens?: number;
58
+ cacheReadInputTokens?: number;
59
+ }
60
+ /**
61
+ * Ends a streaming span by setting all accumulated response attributes and ending the span.
62
+ * Shared across OpenAI, Anthropic, and Google GenAI streaming implementations.
63
+ */
64
+ export declare function endStreamSpan(span: Span, state: StreamResponseState, recordOutputs: boolean): void;
65
+ /**
66
+ * Serialize a value to a JSON string without truncation.
67
+ * Strings are returned as-is, arrays and objects are JSON-stringified.
68
+ */
69
+ export declare function getJsonString<T>(value: T | T[]): string;
40
70
  /**
41
71
  * Get the truncated JSON string for a string or array of strings.
42
72
  *