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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (989) hide show
  1. package/README.md +5 -4
  2. package/build/cjs/debug-build.js +0 -5
  3. package/build/cjs/debug-build.js.map +1 -1
  4. package/build/cjs/index.js +81 -68
  5. package/build/cjs/index.js.map +1 -1
  6. package/build/cjs/init.js +0 -6
  7. package/build/cjs/init.js.map +1 -1
  8. package/build/cjs/integrations/featureFlagShims/growthbook.js +0 -4
  9. package/build/cjs/integrations/featureFlagShims/growthbook.js.map +1 -1
  10. package/build/cjs/integrations/featureFlagShims/launchDarkly.js +6 -18
  11. package/build/cjs/integrations/featureFlagShims/launchDarkly.js.map +1 -1
  12. package/build/cjs/integrations/featureFlagShims/openFeature.js +6 -21
  13. package/build/cjs/integrations/featureFlagShims/openFeature.js.map +1 -1
  14. package/build/cjs/integrations/featureFlagShims/statsig.js +2 -8
  15. package/build/cjs/integrations/featureFlagShims/statsig.js.map +1 -1
  16. package/build/cjs/integrations/featureFlagShims/unleash.js +2 -8
  17. package/build/cjs/integrations/featureFlagShims/unleash.js.map +1 -1
  18. package/build/cjs/integrations/fs/index.js +17 -0
  19. package/build/cjs/integrations/fs/index.js.map +1 -0
  20. package/build/cjs/integrations/fs/vendored/constants.js +138 -0
  21. package/build/cjs/integrations/fs/vendored/constants.js.map +1 -0
  22. package/build/cjs/integrations/fs/vendored/instrumentation.js +230 -0
  23. package/build/cjs/integrations/fs/vendored/instrumentation.js.map +1 -0
  24. package/build/cjs/integrations/fs/vendored/utils.js +31 -0
  25. package/build/cjs/integrations/fs/vendored/utils.js.map +1 -0
  26. package/build/cjs/integrations/http.js +19 -175
  27. package/build/cjs/integrations/http.js.map +1 -1
  28. package/build/cjs/integrations/node-fetch.js +10 -94
  29. package/build/cjs/integrations/node-fetch.js.map +1 -1
  30. package/build/cjs/integrations/tracing/InstrumentationNodeModuleFile.js +15 -0
  31. package/build/cjs/integrations/tracing/InstrumentationNodeModuleFile.js.map +1 -0
  32. package/build/cjs/integrations/tracing/amqplib/index.js +21 -0
  33. package/build/cjs/integrations/tracing/amqplib/index.js.map +1 -0
  34. package/build/cjs/integrations/tracing/amqplib/vendored/instrumentation.js +117 -0
  35. package/build/cjs/integrations/tracing/amqplib/vendored/instrumentation.js.map +1 -0
  36. package/build/cjs/integrations/tracing/amqplib/vendored/patches.js +185 -0
  37. package/build/cjs/integrations/tracing/amqplib/vendored/patches.js.map +1 -0
  38. package/build/cjs/integrations/tracing/amqplib/vendored/semconv.js +26 -0
  39. package/build/cjs/integrations/tracing/amqplib/vendored/semconv.js.map +1 -0
  40. package/build/cjs/integrations/tracing/amqplib/vendored/types.js +17 -0
  41. package/build/cjs/integrations/tracing/amqplib/vendored/types.js.map +1 -0
  42. package/build/cjs/integrations/tracing/amqplib/vendored/utils.js +129 -0
  43. package/build/cjs/integrations/tracing/amqplib/vendored/utils.js.map +1 -0
  44. package/build/cjs/integrations/tracing/anthropic-ai/index.js +3 -58
  45. package/build/cjs/integrations/tracing/anthropic-ai/index.js.map +1 -1
  46. package/build/cjs/integrations/tracing/anthropic-ai/instrumentation.js +21 -44
  47. package/build/cjs/integrations/tracing/anthropic-ai/instrumentation.js.map +1 -1
  48. package/build/cjs/integrations/tracing/connect/index.js +35 -0
  49. package/build/cjs/integrations/tracing/connect/index.js.map +1 -0
  50. package/build/cjs/integrations/tracing/connect/vendored/enums/AttributeNames.js +16 -0
  51. package/build/cjs/integrations/tracing/connect/vendored/enums/AttributeNames.js.map +1 -0
  52. package/build/cjs/integrations/tracing/connect/vendored/instrumentation.js +137 -0
  53. package/build/cjs/integrations/tracing/connect/vendored/instrumentation.js.map +1 -0
  54. package/build/cjs/integrations/tracing/connect/vendored/internal-types.js +8 -0
  55. package/build/cjs/integrations/tracing/connect/vendored/internal-types.js.map +1 -0
  56. package/build/cjs/integrations/tracing/connect/vendored/utils.js +36 -0
  57. package/build/cjs/integrations/tracing/connect/vendored/utils.js.map +1 -0
  58. package/build/cjs/integrations/tracing/dataloader/index.js +26 -0
  59. package/build/cjs/integrations/tracing/dataloader/index.js.map +1 -0
  60. package/build/cjs/integrations/tracing/dataloader/vendored/instrumentation.js +217 -0
  61. package/build/cjs/integrations/tracing/dataloader/vendored/instrumentation.js.map +1 -0
  62. package/build/cjs/integrations/tracing/express.js +44 -147
  63. package/build/cjs/integrations/tracing/express.js.map +1 -1
  64. package/build/cjs/integrations/tracing/fastify/index.js +19 -234
  65. package/build/cjs/integrations/tracing/fastify/index.js.map +1 -1
  66. package/build/cjs/integrations/tracing/fastify/v3/constants.js +1 -18
  67. package/build/cjs/integrations/tracing/fastify/v3/constants.js.map +1 -1
  68. package/build/cjs/integrations/tracing/fastify/v3/enums/AttributeNames.js +20 -33
  69. package/build/cjs/integrations/tracing/fastify/v3/enums/AttributeNames.js.map +1 -1
  70. package/build/cjs/integrations/tracing/fastify/v3/instrumentation.js +78 -162
  71. package/build/cjs/integrations/tracing/fastify/v3/instrumentation.js.map +1 -1
  72. package/build/cjs/integrations/tracing/fastify/v3/utils.js +8 -79
  73. package/build/cjs/integrations/tracing/fastify/v3/utils.js.map +1 -1
  74. package/build/cjs/integrations/tracing/firebase/firebase.js +4 -33
  75. package/build/cjs/integrations/tracing/firebase/firebase.js.map +1 -1
  76. package/build/cjs/integrations/tracing/firebase/otel/firebaseInstrumentation.js +7 -23
  77. package/build/cjs/integrations/tracing/firebase/otel/firebaseInstrumentation.js.map +1 -1
  78. package/build/cjs/integrations/tracing/firebase/otel/patches/firestore.js +73 -215
  79. package/build/cjs/integrations/tracing/firebase/otel/patches/firestore.js.map +1 -1
  80. package/build/cjs/integrations/tracing/firebase/otel/patches/functions.js +86 -210
  81. package/build/cjs/integrations/tracing/firebase/otel/patches/functions.js.map +1 -1
  82. package/build/cjs/integrations/tracing/genericPool/index.js +21 -0
  83. package/build/cjs/integrations/tracing/genericPool/index.js.map +1 -0
  84. package/build/cjs/integrations/tracing/genericPool/vendored/instrumentation.js +122 -0
  85. package/build/cjs/integrations/tracing/genericPool/vendored/instrumentation.js.map +1 -0
  86. package/build/cjs/integrations/tracing/google-genai/index.js +3 -58
  87. package/build/cjs/integrations/tracing/google-genai/index.js.map +1 -1
  88. package/build/cjs/integrations/tracing/google-genai/instrumentation.js +23 -43
  89. package/build/cjs/integrations/tracing/google-genai/instrumentation.js.map +1 -1
  90. package/build/cjs/integrations/tracing/graphql/index.js +34 -0
  91. package/build/cjs/integrations/tracing/graphql/index.js.map +1 -0
  92. package/build/cjs/integrations/tracing/graphql/vendored/enum.js +47 -0
  93. package/build/cjs/integrations/tracing/graphql/vendored/enum.js.map +1 -0
  94. package/build/cjs/integrations/tracing/graphql/vendored/enums/AttributeNames.js +15 -0
  95. package/build/cjs/integrations/tracing/graphql/vendored/enums/AttributeNames.js.map +1 -0
  96. package/build/cjs/integrations/tracing/graphql/vendored/instrumentation.js +329 -0
  97. package/build/cjs/integrations/tracing/graphql/vendored/instrumentation.js.map +1 -0
  98. package/build/cjs/integrations/tracing/graphql/vendored/internal-types.js +6 -0
  99. package/build/cjs/integrations/tracing/graphql/vendored/internal-types.js.map +1 -0
  100. package/build/cjs/integrations/tracing/graphql/vendored/symbols.js +8 -0
  101. package/build/cjs/integrations/tracing/graphql/vendored/symbols.js.map +1 -0
  102. package/build/cjs/integrations/tracing/graphql/vendored/utils.js +265 -0
  103. package/build/cjs/integrations/tracing/graphql/vendored/utils.js.map +1 -0
  104. package/build/cjs/integrations/tracing/hapi/index.js +16 -91
  105. package/build/cjs/integrations/tracing/hapi/index.js.map +1 -1
  106. package/build/cjs/integrations/tracing/hapi/vendored/enums/AttributeNames.js +11 -0
  107. package/build/cjs/integrations/tracing/hapi/vendored/enums/AttributeNames.js.map +1 -0
  108. package/build/cjs/integrations/tracing/hapi/vendored/instrumentation.js +255 -0
  109. package/build/cjs/integrations/tracing/hapi/vendored/instrumentation.js.map +1 -0
  110. package/build/cjs/integrations/tracing/hapi/vendored/internal-types.js +24 -0
  111. package/build/cjs/integrations/tracing/hapi/vendored/internal-types.js.map +1 -0
  112. package/build/cjs/integrations/tracing/hapi/vendored/utils.js +85 -0
  113. package/build/cjs/integrations/tracing/hapi/vendored/utils.js.map +1 -0
  114. package/build/cjs/integrations/tracing/hono/constants.js +6 -7
  115. package/build/cjs/integrations/tracing/hono/constants.js.map +1 -1
  116. package/build/cjs/integrations/tracing/hono/index.js +26 -77
  117. package/build/cjs/integrations/tracing/hono/index.js.map +1 -1
  118. package/build/cjs/integrations/tracing/hono/instrumentation.js +47 -82
  119. package/build/cjs/integrations/tracing/hono/instrumentation.js.map +1 -1
  120. package/build/cjs/integrations/tracing/index.js +74 -83
  121. package/build/cjs/integrations/tracing/index.js.map +1 -1
  122. package/build/cjs/integrations/tracing/kafka/index.js +21 -0
  123. package/build/cjs/integrations/tracing/kafka/index.js.map +1 -0
  124. package/build/cjs/integrations/tracing/kafka/vendored/instrumentation.js +237 -0
  125. package/build/cjs/integrations/tracing/kafka/vendored/instrumentation.js.map +1 -0
  126. package/build/cjs/integrations/tracing/kafka/vendored/semconv.js +22 -0
  127. package/build/cjs/integrations/tracing/kafka/vendored/semconv.js.map +1 -0
  128. package/build/cjs/integrations/tracing/kafka/vendored/utils.js +114 -0
  129. package/build/cjs/integrations/tracing/kafka/vendored/utils.js.map +1 -0
  130. package/build/cjs/integrations/tracing/knex/index.js +26 -0
  131. package/build/cjs/integrations/tracing/knex/index.js.map +1 -0
  132. package/build/cjs/integrations/tracing/knex/vendored/instrumentation.js +135 -0
  133. package/build/cjs/integrations/tracing/knex/vendored/instrumentation.js.map +1 -0
  134. package/build/cjs/integrations/tracing/knex/vendored/semconv.js +10 -0
  135. package/build/cjs/integrations/tracing/knex/vendored/semconv.js.map +1 -0
  136. package/build/cjs/integrations/tracing/knex/vendored/utils.js +84 -0
  137. package/build/cjs/integrations/tracing/knex/vendored/utils.js.map +1 -0
  138. package/build/cjs/integrations/tracing/koa/index.js +46 -0
  139. package/build/cjs/integrations/tracing/koa/index.js.map +1 -0
  140. package/build/cjs/integrations/tracing/koa/vendored/enums/AttributeNames.js +10 -0
  141. package/build/cjs/integrations/tracing/koa/vendored/enums/AttributeNames.js.map +1 -0
  142. package/build/cjs/integrations/tracing/koa/vendored/instrumentation.js +127 -0
  143. package/build/cjs/integrations/tracing/koa/vendored/instrumentation.js.map +1 -0
  144. package/build/cjs/integrations/tracing/koa/vendored/internal-types.js +6 -0
  145. package/build/cjs/integrations/tracing/koa/vendored/internal-types.js.map +1 -0
  146. package/build/cjs/integrations/tracing/koa/vendored/types.js +10 -0
  147. package/build/cjs/integrations/tracing/koa/vendored/types.js.map +1 -0
  148. package/build/cjs/integrations/tracing/koa/vendored/utils.js +36 -0
  149. package/build/cjs/integrations/tracing/koa/vendored/utils.js.map +1 -0
  150. package/build/cjs/integrations/tracing/langchain/index.js +3 -96
  151. package/build/cjs/integrations/tracing/langchain/index.js.map +1 -1
  152. package/build/cjs/integrations/tracing/langchain/instrumentation.js +80 -140
  153. package/build/cjs/integrations/tracing/langchain/instrumentation.js.map +1 -1
  154. package/build/cjs/integrations/tracing/langgraph/index.js +3 -73
  155. package/build/cjs/integrations/tracing/langgraph/index.js.map +1 -1
  156. package/build/cjs/integrations/tracing/langgraph/instrumentation.js +76 -40
  157. package/build/cjs/integrations/tracing/langgraph/instrumentation.js.map +1 -1
  158. package/build/cjs/integrations/tracing/lrumemoizer/index.js +21 -0
  159. package/build/cjs/integrations/tracing/lrumemoizer/index.js.map +1 -0
  160. package/build/cjs/integrations/tracing/lrumemoizer/vendored/instrumentation.js +38 -0
  161. package/build/cjs/integrations/tracing/lrumemoizer/vendored/instrumentation.js.map +1 -0
  162. package/build/cjs/integrations/tracing/mongo/index.js +21 -0
  163. package/build/cjs/integrations/tracing/mongo/index.js.map +1 -0
  164. package/build/cjs/integrations/tracing/mongo/vendored/instrumentation.js +129 -0
  165. package/build/cjs/integrations/tracing/mongo/vendored/instrumentation.js.map +1 -0
  166. package/build/cjs/integrations/tracing/mongo/vendored/patches.js +150 -0
  167. package/build/cjs/integrations/tracing/mongo/vendored/patches.js.map +1 -0
  168. package/build/cjs/integrations/tracing/mongo/vendored/utils.js +40 -0
  169. package/build/cjs/integrations/tracing/mongo/vendored/utils.js.map +1 -0
  170. package/build/cjs/integrations/tracing/mongoose/index.js +22 -0
  171. package/build/cjs/integrations/tracing/mongoose/index.js.map +1 -0
  172. package/build/cjs/integrations/tracing/mongoose/vendored/mongoose.js +240 -0
  173. package/build/cjs/integrations/tracing/mongoose/vendored/mongoose.js.map +1 -0
  174. package/build/cjs/integrations/tracing/mongoose/vendored/utils.js +41 -0
  175. package/build/cjs/integrations/tracing/mongoose/vendored/utils.js.map +1 -0
  176. package/build/cjs/integrations/tracing/mysql/index.js +21 -0
  177. package/build/cjs/integrations/tracing/mysql/index.js.map +1 -0
  178. package/build/cjs/integrations/tracing/mysql/vendored/instrumentation.js +185 -0
  179. package/build/cjs/integrations/tracing/mysql/vendored/instrumentation.js.map +1 -0
  180. package/build/cjs/integrations/tracing/mysql/vendored/semconv.js +8 -0
  181. package/build/cjs/integrations/tracing/mysql/vendored/semconv.js.map +1 -0
  182. package/build/cjs/integrations/tracing/mysql/vendored/utils.js +38 -0
  183. package/build/cjs/integrations/tracing/mysql/vendored/utils.js.map +1 -0
  184. package/build/cjs/integrations/tracing/mysql2/index.js +22 -0
  185. package/build/cjs/integrations/tracing/mysql2/index.js.map +1 -0
  186. package/build/cjs/integrations/tracing/mysql2/vendored/instrumentation.js +138 -0
  187. package/build/cjs/integrations/tracing/mysql2/vendored/instrumentation.js.map +1 -0
  188. package/build/cjs/integrations/tracing/mysql2/vendored/semconv.js +8 -0
  189. package/build/cjs/integrations/tracing/mysql2/vendored/semconv.js.map +1 -0
  190. package/build/cjs/integrations/tracing/mysql2/vendored/utils.js +81 -0
  191. package/build/cjs/integrations/tracing/mysql2/vendored/utils.js.map +1 -0
  192. package/build/cjs/integrations/tracing/openai/index.js +3 -58
  193. package/build/cjs/integrations/tracing/openai/index.js.map +1 -1
  194. package/build/cjs/integrations/tracing/openai/instrumentation.js +25 -49
  195. package/build/cjs/integrations/tracing/openai/instrumentation.js.map +1 -1
  196. package/build/cjs/integrations/tracing/postgres/index.js +27 -0
  197. package/build/cjs/integrations/tracing/postgres/index.js.map +1 -0
  198. package/build/cjs/integrations/tracing/postgres/vendored/enums/AttributeNames.js +11 -0
  199. package/build/cjs/integrations/tracing/postgres/vendored/enums/AttributeNames.js.map +1 -0
  200. package/build/cjs/integrations/tracing/postgres/vendored/enums/SpanNames.js +11 -0
  201. package/build/cjs/integrations/tracing/postgres/vendored/enums/SpanNames.js.map +1 -0
  202. package/build/cjs/integrations/tracing/postgres/vendored/instrumentation.js +225 -0
  203. package/build/cjs/integrations/tracing/postgres/vendored/instrumentation.js.map +1 -0
  204. package/build/cjs/integrations/tracing/postgres/vendored/semconv.js +8 -0
  205. package/build/cjs/integrations/tracing/postgres/vendored/semconv.js.map +1 -0
  206. package/build/cjs/integrations/tracing/postgres/vendored/utils.js +151 -0
  207. package/build/cjs/integrations/tracing/postgres/vendored/utils.js.map +1 -0
  208. package/build/cjs/integrations/tracing/postgresjs.js +77 -190
  209. package/build/cjs/integrations/tracing/postgresjs.js.map +1 -1
  210. package/build/cjs/integrations/tracing/redis/cache.js +41 -0
  211. package/build/cjs/integrations/tracing/redis/cache.js.map +1 -0
  212. package/build/cjs/integrations/tracing/redis/index.js +50 -0
  213. package/build/cjs/integrations/tracing/redis/index.js.map +1 -0
  214. package/build/cjs/integrations/tracing/redis/vendored/ioredis-instrumentation.js +147 -0
  215. package/build/cjs/integrations/tracing/redis/vendored/ioredis-instrumentation.js.map +1 -0
  216. package/build/cjs/integrations/tracing/redis/vendored/redis-instrumentation.js +445 -0
  217. package/build/cjs/integrations/tracing/redis/vendored/redis-instrumentation.js.map +1 -0
  218. package/build/cjs/integrations/tracing/redis/vendored/semconv.js +8 -0
  219. package/build/cjs/integrations/tracing/redis/vendored/semconv.js.map +1 -0
  220. package/build/cjs/integrations/tracing/tedious/index.js +21 -0
  221. package/build/cjs/integrations/tracing/tedious/index.js.map +1 -0
  222. package/build/cjs/integrations/tracing/tedious/vendored/instrumentation.js +154 -0
  223. package/build/cjs/integrations/tracing/tedious/vendored/instrumentation.js.map +1 -0
  224. package/build/cjs/integrations/tracing/tedious/vendored/semconv.js +8 -0
  225. package/build/cjs/integrations/tracing/tedious/vendored/semconv.js.map +1 -0
  226. package/build/cjs/integrations/tracing/tedious/vendored/utils.js +29 -0
  227. package/build/cjs/integrations/tracing/tedious/vendored/utils.js.map +1 -0
  228. package/build/cjs/integrations/tracing/vercelai/constants.js +1 -1
  229. package/build/cjs/integrations/tracing/vercelai/constants.js.map +1 -1
  230. package/build/cjs/integrations/tracing/vercelai/index.js +7 -53
  231. package/build/cjs/integrations/tracing/vercelai/index.js.map +1 -1
  232. package/build/cjs/integrations/tracing/vercelai/instrumentation.js +60 -158
  233. package/build/cjs/integrations/tracing/vercelai/instrumentation.js.map +1 -1
  234. package/build/cjs/preload.js +1 -14
  235. package/build/cjs/preload.js.map +1 -1
  236. package/build/cjs/sdk/diagnosticsChannelInjection.js +21 -0
  237. package/build/cjs/sdk/diagnosticsChannelInjection.js.map +1 -0
  238. package/build/cjs/sdk/experimentalUseDiagnosticsChannelInjection.js +33 -0
  239. package/build/cjs/sdk/experimentalUseDiagnosticsChannelInjection.js.map +1 -0
  240. package/build/cjs/sdk/index.js +33 -35
  241. package/build/cjs/sdk/index.js.map +1 -1
  242. package/build/cjs/sdk/initOtel.js +74 -60
  243. package/build/cjs/sdk/initOtel.js.map +1 -1
  244. package/build/cjs/utils/redisCache.js +24 -52
  245. package/build/cjs/utils/redisCache.js.map +1 -1
  246. package/build/cjs/utils/setHttpServerSpanRouteAttribute.js +21 -0
  247. package/build/cjs/utils/setHttpServerSpanRouteAttribute.js.map +1 -0
  248. package/build/esm/debug-build.js +0 -5
  249. package/build/esm/debug-build.js.map +1 -1
  250. package/build/esm/index.js +24 -22
  251. package/build/esm/index.js.map +1 -1
  252. package/build/esm/init.js +0 -6
  253. package/build/esm/init.js.map +1 -1
  254. package/build/esm/integrations/featureFlagShims/growthbook.js +0 -4
  255. package/build/esm/integrations/featureFlagShims/growthbook.js.map +1 -1
  256. package/build/esm/integrations/featureFlagShims/launchDarkly.js +6 -18
  257. package/build/esm/integrations/featureFlagShims/launchDarkly.js.map +1 -1
  258. package/build/esm/integrations/featureFlagShims/openFeature.js +6 -21
  259. package/build/esm/integrations/featureFlagShims/openFeature.js.map +1 -1
  260. package/build/esm/integrations/featureFlagShims/statsig.js +2 -8
  261. package/build/esm/integrations/featureFlagShims/statsig.js.map +1 -1
  262. package/build/esm/integrations/featureFlagShims/unleash.js +2 -8
  263. package/build/esm/integrations/featureFlagShims/unleash.js.map +1 -1
  264. package/build/esm/integrations/fs/index.js +15 -0
  265. package/build/esm/integrations/fs/index.js.map +1 -0
  266. package/build/esm/integrations/fs/vendored/constants.js +134 -0
  267. package/build/esm/integrations/fs/vendored/constants.js.map +1 -0
  268. package/build/esm/integrations/fs/vendored/instrumentation.js +228 -0
  269. package/build/esm/integrations/fs/vendored/instrumentation.js.map +1 -0
  270. package/build/esm/integrations/fs/vendored/utils.js +28 -0
  271. package/build/esm/integrations/fs/vendored/utils.js.map +1 -0
  272. package/build/esm/integrations/http.js +22 -176
  273. package/build/esm/integrations/http.js.map +1 -1
  274. package/build/esm/integrations/node-fetch.js +12 -95
  275. package/build/esm/integrations/node-fetch.js.map +1 -1
  276. package/build/esm/integrations/tracing/InstrumentationNodeModuleFile.js +13 -0
  277. package/build/esm/integrations/tracing/InstrumentationNodeModuleFile.js.map +1 -0
  278. package/build/esm/integrations/tracing/amqplib/index.js +18 -0
  279. package/build/esm/integrations/tracing/amqplib/index.js.map +1 -0
  280. package/build/esm/integrations/tracing/amqplib/vendored/instrumentation.js +115 -0
  281. package/build/esm/integrations/tracing/amqplib/vendored/instrumentation.js.map +1 -0
  282. package/build/esm/integrations/tracing/amqplib/vendored/patches.js +177 -0
  283. package/build/esm/integrations/tracing/amqplib/vendored/patches.js.map +1 -0
  284. package/build/esm/integrations/tracing/amqplib/vendored/semconv.js +14 -0
  285. package/build/esm/integrations/tracing/amqplib/vendored/semconv.js.map +1 -0
  286. package/build/esm/integrations/tracing/amqplib/vendored/types.js +15 -0
  287. package/build/esm/integrations/tracing/amqplib/vendored/types.js.map +1 -0
  288. package/build/esm/integrations/tracing/amqplib/vendored/utils.js +117 -0
  289. package/build/esm/integrations/tracing/amqplib/vendored/utils.js.map +1 -0
  290. package/build/esm/integrations/tracing/anthropic-ai/index.js +3 -58
  291. package/build/esm/integrations/tracing/anthropic-ai/index.js.map +1 -1
  292. package/build/esm/integrations/tracing/anthropic-ai/instrumentation.js +21 -44
  293. package/build/esm/integrations/tracing/anthropic-ai/instrumentation.js.map +1 -1
  294. package/build/esm/integrations/tracing/connect/index.js +31 -0
  295. package/build/esm/integrations/tracing/connect/index.js.map +1 -0
  296. package/build/esm/integrations/tracing/connect/vendored/enums/AttributeNames.js +13 -0
  297. package/build/esm/integrations/tracing/connect/vendored/enums/AttributeNames.js.map +1 -0
  298. package/build/esm/integrations/tracing/connect/vendored/instrumentation.js +135 -0
  299. package/build/esm/integrations/tracing/connect/vendored/instrumentation.js.map +1 -0
  300. package/build/esm/integrations/tracing/connect/vendored/internal-types.js +6 -0
  301. package/build/esm/integrations/tracing/connect/vendored/internal-types.js.map +1 -0
  302. package/build/esm/integrations/tracing/connect/vendored/utils.js +32 -0
  303. package/build/esm/integrations/tracing/connect/vendored/utils.js.map +1 -0
  304. package/build/esm/integrations/tracing/dataloader/index.js +23 -0
  305. package/build/esm/integrations/tracing/dataloader/index.js.map +1 -0
  306. package/build/esm/integrations/tracing/dataloader/vendored/instrumentation.js +215 -0
  307. package/build/esm/integrations/tracing/dataloader/vendored/instrumentation.js.map +1 -0
  308. package/build/esm/integrations/tracing/express.js +45 -148
  309. package/build/esm/integrations/tracing/express.js.map +1 -1
  310. package/build/esm/integrations/tracing/fastify/index.js +21 -235
  311. package/build/esm/integrations/tracing/fastify/index.js.map +1 -1
  312. package/build/esm/integrations/tracing/fastify/v3/constants.js +1 -18
  313. package/build/esm/integrations/tracing/fastify/v3/constants.js.map +1 -1
  314. package/build/esm/integrations/tracing/fastify/v3/enums/AttributeNames.js +17 -34
  315. package/build/esm/integrations/tracing/fastify/v3/enums/AttributeNames.js.map +1 -1
  316. package/build/esm/integrations/tracing/fastify/v3/instrumentation.js +74 -158
  317. package/build/esm/integrations/tracing/fastify/v3/instrumentation.js.map +1 -1
  318. package/build/esm/integrations/tracing/fastify/v3/utils.js +8 -79
  319. package/build/esm/integrations/tracing/fastify/v3/utils.js.map +1 -1
  320. package/build/esm/integrations/tracing/firebase/firebase.js +6 -35
  321. package/build/esm/integrations/tracing/firebase/firebase.js.map +1 -1
  322. package/build/esm/integrations/tracing/firebase/otel/firebaseInstrumentation.js +7 -23
  323. package/build/esm/integrations/tracing/firebase/otel/firebaseInstrumentation.js.map +1 -1
  324. package/build/esm/integrations/tracing/firebase/otel/patches/firestore.js +72 -214
  325. package/build/esm/integrations/tracing/firebase/otel/patches/firestore.js.map +1 -1
  326. package/build/esm/integrations/tracing/firebase/otel/patches/functions.js +86 -210
  327. package/build/esm/integrations/tracing/firebase/otel/patches/functions.js.map +1 -1
  328. package/build/esm/integrations/tracing/genericPool/index.js +18 -0
  329. package/build/esm/integrations/tracing/genericPool/index.js.map +1 -0
  330. package/build/esm/integrations/tracing/genericPool/vendored/instrumentation.js +120 -0
  331. package/build/esm/integrations/tracing/genericPool/vendored/instrumentation.js.map +1 -0
  332. package/build/esm/integrations/tracing/google-genai/index.js +3 -58
  333. package/build/esm/integrations/tracing/google-genai/index.js.map +1 -1
  334. package/build/esm/integrations/tracing/google-genai/instrumentation.js +23 -43
  335. package/build/esm/integrations/tracing/google-genai/instrumentation.js.map +1 -1
  336. package/build/esm/integrations/tracing/graphql/index.js +31 -0
  337. package/build/esm/integrations/tracing/graphql/index.js.map +1 -0
  338. package/build/esm/integrations/tracing/graphql/vendored/enum.js +43 -0
  339. package/build/esm/integrations/tracing/graphql/vendored/enum.js.map +1 -0
  340. package/build/esm/integrations/tracing/graphql/vendored/enums/AttributeNames.js +13 -0
  341. package/build/esm/integrations/tracing/graphql/vendored/enums/AttributeNames.js.map +1 -0
  342. package/build/esm/integrations/tracing/graphql/vendored/instrumentation.js +327 -0
  343. package/build/esm/integrations/tracing/graphql/vendored/instrumentation.js.map +1 -0
  344. package/build/esm/integrations/tracing/graphql/vendored/internal-types.js +4 -0
  345. package/build/esm/integrations/tracing/graphql/vendored/internal-types.js.map +1 -0
  346. package/build/esm/integrations/tracing/graphql/vendored/symbols.js +5 -0
  347. package/build/esm/integrations/tracing/graphql/vendored/symbols.js.map +1 -0
  348. package/build/esm/integrations/tracing/graphql/vendored/utils.js +257 -0
  349. package/build/esm/integrations/tracing/graphql/vendored/utils.js.map +1 -0
  350. package/build/esm/integrations/tracing/hapi/index.js +16 -91
  351. package/build/esm/integrations/tracing/hapi/index.js.map +1 -1
  352. package/build/esm/integrations/tracing/hapi/vendored/enums/AttributeNames.js +9 -0
  353. package/build/esm/integrations/tracing/hapi/vendored/enums/AttributeNames.js.map +1 -0
  354. package/build/esm/integrations/tracing/hapi/vendored/instrumentation.js +253 -0
  355. package/build/esm/integrations/tracing/hapi/vendored/instrumentation.js.map +1 -0
  356. package/build/esm/integrations/tracing/hapi/vendored/internal-types.js +19 -0
  357. package/build/esm/integrations/tracing/hapi/vendored/internal-types.js.map +1 -0
  358. package/build/esm/integrations/tracing/hapi/vendored/utils.js +76 -0
  359. package/build/esm/integrations/tracing/hapi/vendored/utils.js.map +1 -0
  360. package/build/esm/integrations/tracing/hono/constants.js +6 -7
  361. package/build/esm/integrations/tracing/hono/constants.js.map +1 -1
  362. package/build/esm/integrations/tracing/hono/index.js +22 -73
  363. package/build/esm/integrations/tracing/hono/index.js.map +1 -1
  364. package/build/esm/integrations/tracing/hono/instrumentation.js +47 -82
  365. package/build/esm/integrations/tracing/hono/instrumentation.js.map +1 -1
  366. package/build/esm/integrations/tracing/index.js +20 -29
  367. package/build/esm/integrations/tracing/index.js.map +1 -1
  368. package/build/esm/integrations/tracing/kafka/index.js +18 -0
  369. package/build/esm/integrations/tracing/kafka/index.js.map +1 -0
  370. package/build/esm/integrations/tracing/kafka/vendored/instrumentation.js +235 -0
  371. package/build/esm/integrations/tracing/kafka/vendored/instrumentation.js.map +1 -0
  372. package/build/esm/integrations/tracing/kafka/vendored/semconv.js +12 -0
  373. package/build/esm/integrations/tracing/kafka/vendored/semconv.js.map +1 -0
  374. package/build/esm/integrations/tracing/kafka/vendored/utils.js +108 -0
  375. package/build/esm/integrations/tracing/kafka/vendored/utils.js.map +1 -0
  376. package/build/esm/integrations/tracing/knex/index.js +23 -0
  377. package/build/esm/integrations/tracing/knex/index.js.map +1 -0
  378. package/build/esm/integrations/tracing/knex/vendored/instrumentation.js +133 -0
  379. package/build/esm/integrations/tracing/knex/vendored/instrumentation.js.map +1 -0
  380. package/build/esm/integrations/tracing/knex/vendored/semconv.js +6 -0
  381. package/build/esm/integrations/tracing/knex/vendored/semconv.js.map +1 -0
  382. package/build/esm/integrations/tracing/knex/vendored/utils.js +75 -0
  383. package/build/esm/integrations/tracing/knex/vendored/utils.js.map +1 -0
  384. package/build/esm/integrations/tracing/koa/index.js +42 -0
  385. package/build/esm/integrations/tracing/koa/index.js.map +1 -0
  386. package/build/esm/integrations/tracing/koa/vendored/enums/AttributeNames.js +8 -0
  387. package/build/esm/integrations/tracing/koa/vendored/enums/AttributeNames.js.map +1 -0
  388. package/build/esm/integrations/tracing/koa/vendored/instrumentation.js +125 -0
  389. package/build/esm/integrations/tracing/koa/vendored/instrumentation.js.map +1 -0
  390. package/build/esm/integrations/tracing/koa/vendored/internal-types.js +4 -0
  391. package/build/esm/integrations/tracing/koa/vendored/internal-types.js.map +1 -0
  392. package/build/esm/integrations/tracing/koa/vendored/types.js +8 -0
  393. package/build/esm/integrations/tracing/koa/vendored/types.js.map +1 -0
  394. package/build/esm/integrations/tracing/koa/vendored/utils.js +33 -0
  395. package/build/esm/integrations/tracing/koa/vendored/utils.js.map +1 -0
  396. package/build/esm/integrations/tracing/langchain/index.js +3 -96
  397. package/build/esm/integrations/tracing/langchain/index.js.map +1 -1
  398. package/build/esm/integrations/tracing/langchain/instrumentation.js +80 -140
  399. package/build/esm/integrations/tracing/langchain/instrumentation.js.map +1 -1
  400. package/build/esm/integrations/tracing/langgraph/index.js +3 -73
  401. package/build/esm/integrations/tracing/langgraph/index.js.map +1 -1
  402. package/build/esm/integrations/tracing/langgraph/instrumentation.js +78 -42
  403. package/build/esm/integrations/tracing/langgraph/instrumentation.js.map +1 -1
  404. package/build/esm/integrations/tracing/lrumemoizer/index.js +18 -0
  405. package/build/esm/integrations/tracing/lrumemoizer/index.js.map +1 -0
  406. package/build/esm/integrations/tracing/lrumemoizer/vendored/instrumentation.js +36 -0
  407. package/build/esm/integrations/tracing/lrumemoizer/vendored/instrumentation.js.map +1 -0
  408. package/build/esm/integrations/tracing/mongo/index.js +18 -0
  409. package/build/esm/integrations/tracing/mongo/index.js.map +1 -0
  410. package/build/esm/integrations/tracing/mongo/vendored/instrumentation.js +127 -0
  411. package/build/esm/integrations/tracing/mongo/vendored/instrumentation.js.map +1 -0
  412. package/build/esm/integrations/tracing/mongo/vendored/patches.js +142 -0
  413. package/build/esm/integrations/tracing/mongo/vendored/patches.js.map +1 -0
  414. package/build/esm/integrations/tracing/mongo/vendored/utils.js +34 -0
  415. package/build/esm/integrations/tracing/mongo/vendored/utils.js.map +1 -0
  416. package/build/esm/integrations/tracing/mongoose/index.js +19 -0
  417. package/build/esm/integrations/tracing/mongoose/index.js.map +1 -0
  418. package/build/esm/integrations/tracing/mongoose/vendored/mongoose.js +236 -0
  419. package/build/esm/integrations/tracing/mongoose/vendored/mongoose.js.map +1 -0
  420. package/build/esm/integrations/tracing/mongoose/vendored/utils.js +38 -0
  421. package/build/esm/integrations/tracing/mongoose/vendored/utils.js.map +1 -0
  422. package/build/esm/integrations/tracing/mysql/index.js +18 -0
  423. package/build/esm/integrations/tracing/mysql/index.js.map +1 -0
  424. package/build/esm/integrations/tracing/mysql/vendored/instrumentation.js +183 -0
  425. package/build/esm/integrations/tracing/mysql/vendored/instrumentation.js.map +1 -0
  426. package/build/esm/integrations/tracing/mysql/vendored/semconv.js +5 -0
  427. package/build/esm/integrations/tracing/mysql/vendored/semconv.js.map +1 -0
  428. package/build/esm/integrations/tracing/mysql/vendored/utils.js +33 -0
  429. package/build/esm/integrations/tracing/mysql/vendored/utils.js.map +1 -0
  430. package/build/esm/integrations/tracing/mysql2/index.js +19 -0
  431. package/build/esm/integrations/tracing/mysql2/index.js.map +1 -0
  432. package/build/esm/integrations/tracing/mysql2/vendored/instrumentation.js +136 -0
  433. package/build/esm/integrations/tracing/mysql2/vendored/instrumentation.js.map +1 -0
  434. package/build/esm/integrations/tracing/mysql2/vendored/semconv.js +5 -0
  435. package/build/esm/integrations/tracing/mysql2/vendored/semconv.js.map +1 -0
  436. package/build/esm/integrations/tracing/mysql2/vendored/utils.js +75 -0
  437. package/build/esm/integrations/tracing/mysql2/vendored/utils.js.map +1 -0
  438. package/build/esm/integrations/tracing/openai/index.js +3 -58
  439. package/build/esm/integrations/tracing/openai/index.js.map +1 -1
  440. package/build/esm/integrations/tracing/openai/instrumentation.js +25 -49
  441. package/build/esm/integrations/tracing/openai/instrumentation.js.map +1 -1
  442. package/build/esm/integrations/tracing/postgres/index.js +24 -0
  443. package/build/esm/integrations/tracing/postgres/index.js.map +1 -0
  444. package/build/esm/integrations/tracing/postgres/vendored/enums/AttributeNames.js +9 -0
  445. package/build/esm/integrations/tracing/postgres/vendored/enums/AttributeNames.js.map +1 -0
  446. package/build/esm/integrations/tracing/postgres/vendored/enums/SpanNames.js +9 -0
  447. package/build/esm/integrations/tracing/postgres/vendored/enums/SpanNames.js.map +1 -0
  448. package/build/esm/integrations/tracing/postgres/vendored/instrumentation.js +223 -0
  449. package/build/esm/integrations/tracing/postgres/vendored/instrumentation.js.map +1 -0
  450. package/build/esm/integrations/tracing/postgres/vendored/semconv.js +5 -0
  451. package/build/esm/integrations/tracing/postgres/vendored/semconv.js.map +1 -0
  452. package/build/esm/integrations/tracing/postgres/vendored/utils.js +136 -0
  453. package/build/esm/integrations/tracing/postgres/vendored/utils.js.map +1 -0
  454. package/build/esm/integrations/tracing/postgresjs.js +77 -190
  455. package/build/esm/integrations/tracing/postgresjs.js.map +1 -1
  456. package/build/esm/integrations/tracing/redis/cache.js +38 -0
  457. package/build/esm/integrations/tracing/redis/cache.js.map +1 -0
  458. package/build/esm/integrations/tracing/redis/index.js +43 -0
  459. package/build/esm/integrations/tracing/redis/index.js.map +1 -0
  460. package/build/esm/integrations/tracing/redis/vendored/ioredis-instrumentation.js +145 -0
  461. package/build/esm/integrations/tracing/redis/vendored/ioredis-instrumentation.js.map +1 -0
  462. package/build/esm/integrations/tracing/redis/vendored/redis-instrumentation.js +443 -0
  463. package/build/esm/integrations/tracing/redis/vendored/redis-instrumentation.js.map +1 -0
  464. package/build/esm/integrations/tracing/redis/vendored/semconv.js +5 -0
  465. package/build/esm/integrations/tracing/redis/vendored/semconv.js.map +1 -0
  466. package/build/esm/integrations/tracing/tedious/index.js +18 -0
  467. package/build/esm/integrations/tracing/tedious/index.js.map +1 -0
  468. package/build/esm/integrations/tracing/tedious/vendored/instrumentation.js +152 -0
  469. package/build/esm/integrations/tracing/tedious/vendored/instrumentation.js.map +1 -0
  470. package/build/esm/integrations/tracing/tedious/vendored/semconv.js +5 -0
  471. package/build/esm/integrations/tracing/tedious/vendored/semconv.js.map +1 -0
  472. package/build/esm/integrations/tracing/tedious/vendored/utils.js +26 -0
  473. package/build/esm/integrations/tracing/tedious/vendored/utils.js.map +1 -0
  474. package/build/esm/integrations/tracing/vercelai/constants.js +1 -1
  475. package/build/esm/integrations/tracing/vercelai/constants.js.map +1 -1
  476. package/build/esm/integrations/tracing/vercelai/index.js +8 -54
  477. package/build/esm/integrations/tracing/vercelai/index.js.map +1 -1
  478. package/build/esm/integrations/tracing/vercelai/instrumentation.js +60 -158
  479. package/build/esm/integrations/tracing/vercelai/instrumentation.js.map +1 -1
  480. package/build/esm/package.json +1 -1
  481. package/build/esm/preload.js +1 -14
  482. package/build/esm/preload.js.map +1 -1
  483. package/build/esm/sdk/diagnosticsChannelInjection.js +17 -0
  484. package/build/esm/sdk/diagnosticsChannelInjection.js.map +1 -0
  485. package/build/esm/sdk/experimentalUseDiagnosticsChannelInjection.js +30 -0
  486. package/build/esm/sdk/experimentalUseDiagnosticsChannelInjection.js.map +1 -0
  487. package/build/esm/sdk/index.js +33 -36
  488. package/build/esm/sdk/index.js.map +1 -1
  489. package/build/esm/sdk/initOtel.js +77 -63
  490. package/build/esm/sdk/initOtel.js.map +1 -1
  491. package/build/esm/utils/redisCache.js +24 -52
  492. package/build/esm/utils/redisCache.js.map +1 -1
  493. package/build/esm/utils/setHttpServerSpanRouteAttribute.js +19 -0
  494. package/build/esm/utils/setHttpServerSpanRouteAttribute.js.map +1 -0
  495. package/build/import-hook.mjs +6 -0
  496. package/build/types/index.d.ts +6 -4
  497. package/build/types/index.d.ts.map +1 -1
  498. package/build/types/integrations/featureFlagShims/launchDarkly.d.ts +3 -1
  499. package/build/types/integrations/featureFlagShims/launchDarkly.d.ts.map +1 -1
  500. package/build/types/integrations/featureFlagShims/openFeature.d.ts +3 -1
  501. package/build/types/integrations/featureFlagShims/openFeature.d.ts.map +1 -1
  502. package/build/types/integrations/featureFlagShims/statsig.d.ts +3 -1
  503. package/build/types/integrations/featureFlagShims/statsig.d.ts.map +1 -1
  504. package/build/types/integrations/featureFlagShims/unleash.d.ts +3 -1
  505. package/build/types/integrations/featureFlagShims/unleash.d.ts.map +1 -1
  506. package/build/types/integrations/fs/index.d.ts +14 -0
  507. package/build/types/integrations/fs/index.d.ts.map +1 -0
  508. package/build/types/integrations/fs/vendored/constants.d.ts +5 -0
  509. package/build/types/integrations/fs/vendored/constants.d.ts.map +1 -0
  510. package/build/types/integrations/fs/vendored/instrumentation.d.ts +3 -0
  511. package/build/types/integrations/fs/vendored/instrumentation.d.ts.map +1 -0
  512. package/build/types/integrations/fs/vendored/types.d.ts +23 -0
  513. package/build/types/integrations/fs/vendored/types.d.ts.map +1 -0
  514. package/build/types/integrations/fs/vendored/utils.d.ts +10 -0
  515. package/build/types/integrations/fs/vendored/utils.d.ts.map +1 -0
  516. package/build/types/integrations/http.d.ts +12 -17
  517. package/build/types/integrations/http.d.ts.map +1 -1
  518. package/build/types/integrations/node-fetch.d.ts +8 -35
  519. package/build/types/integrations/node-fetch.d.ts.map +1 -1
  520. package/build/types/integrations/tracing/InstrumentationNodeModuleFile.d.ts +9 -0
  521. package/build/types/integrations/tracing/InstrumentationNodeModuleFile.d.ts.map +1 -0
  522. package/build/types/integrations/tracing/{amqplib.d.ts → amqplib/index.d.ts} +5 -3
  523. package/build/types/integrations/tracing/amqplib/index.d.ts.map +1 -0
  524. package/build/types/integrations/tracing/amqplib/vendored/amqplib-types.d.ts +44 -0
  525. package/build/types/integrations/tracing/amqplib/vendored/amqplib-types.d.ts.map +1 -0
  526. package/build/types/integrations/tracing/amqplib/vendored/instrumentation.d.ts +11 -0
  527. package/build/types/integrations/tracing/amqplib/vendored/instrumentation.d.ts.map +1 -0
  528. package/build/types/integrations/tracing/amqplib/vendored/patches.d.ts +11 -0
  529. package/build/types/integrations/tracing/amqplib/vendored/patches.d.ts.map +1 -0
  530. package/build/types/integrations/tracing/amqplib/vendored/semconv.d.ts +23 -0
  531. package/build/types/integrations/tracing/amqplib/vendored/semconv.d.ts.map +1 -0
  532. package/build/types/integrations/tracing/amqplib/vendored/types.d.ts +49 -0
  533. package/build/types/integrations/tracing/amqplib/vendored/types.d.ts.map +1 -0
  534. package/build/types/integrations/tracing/amqplib/vendored/utils.d.ts +42 -0
  535. package/build/types/integrations/tracing/amqplib/vendored/utils.d.ts.map +1 -0
  536. package/build/types/integrations/tracing/anthropic-ai/index.d.ts +11 -8
  537. package/build/types/integrations/tracing/anthropic-ai/index.d.ts.map +1 -1
  538. package/build/types/integrations/tracing/{connect.d.ts → connect/index.d.ts} +5 -3
  539. package/build/types/integrations/tracing/connect/index.d.ts.map +1 -0
  540. package/build/types/integrations/tracing/connect/vendored/enums/AttributeNames.d.ts +9 -0
  541. package/build/types/integrations/tracing/connect/vendored/enums/AttributeNames.d.ts.map +1 -0
  542. package/build/types/integrations/tracing/connect/vendored/instrumentation.d.ts +18 -0
  543. package/build/types/integrations/tracing/connect/vendored/instrumentation.d.ts.map +1 -0
  544. package/build/types/integrations/tracing/connect/vendored/internal-types.d.ts +31 -0
  545. package/build/types/integrations/tracing/connect/vendored/internal-types.d.ts.map +1 -0
  546. package/build/types/integrations/tracing/connect/vendored/utils.d.ts +5 -0
  547. package/build/types/integrations/tracing/connect/vendored/utils.d.ts.map +1 -0
  548. package/build/types/integrations/tracing/{dataloader.d.ts → dataloader/index.d.ts} +5 -3
  549. package/build/types/integrations/tracing/dataloader/index.d.ts.map +1 -0
  550. package/build/types/integrations/tracing/dataloader/vendored/instrumentation.d.ts +18 -0
  551. package/build/types/integrations/tracing/dataloader/vendored/instrumentation.d.ts.map +1 -0
  552. package/build/types/integrations/tracing/dataloader/vendored/types.d.ts +22 -0
  553. package/build/types/integrations/tracing/dataloader/vendored/types.d.ts.map +1 -0
  554. package/build/types/integrations/tracing/express.d.ts +15 -68
  555. package/build/types/integrations/tracing/express.d.ts.map +1 -1
  556. package/build/types/integrations/tracing/fastify/index.d.ts +6 -6
  557. package/build/types/integrations/tracing/fastify/index.d.ts.map +1 -1
  558. package/build/types/integrations/tracing/fastify/v3/instrumentation.d.ts.map +1 -1
  559. package/build/types/integrations/tracing/firebase/firebase.d.ts +3 -1
  560. package/build/types/integrations/tracing/firebase/firebase.d.ts.map +1 -1
  561. package/build/types/integrations/tracing/firebase/otel/firebaseInstrumentation.d.ts +4 -9
  562. package/build/types/integrations/tracing/firebase/otel/firebaseInstrumentation.d.ts.map +1 -1
  563. package/build/types/integrations/tracing/firebase/otel/patches/firestore.d.ts +2 -5
  564. package/build/types/integrations/tracing/firebase/otel/patches/firestore.d.ts.map +1 -1
  565. package/build/types/integrations/tracing/firebase/otel/patches/functions.d.ts +3 -8
  566. package/build/types/integrations/tracing/firebase/otel/patches/functions.d.ts.map +1 -1
  567. package/build/types/integrations/tracing/firebase/otel/types.d.ts +0 -20
  568. package/build/types/integrations/tracing/firebase/otel/types.d.ts.map +1 -1
  569. package/build/types/integrations/tracing/{genericPool.d.ts → genericPool/index.d.ts} +5 -3
  570. package/build/types/integrations/tracing/genericPool/index.d.ts.map +1 -0
  571. package/build/types/integrations/tracing/genericPool/vendored/generic-pool-types.d.ts +5 -0
  572. package/build/types/integrations/tracing/genericPool/vendored/generic-pool-types.d.ts.map +1 -0
  573. package/build/types/integrations/tracing/genericPool/vendored/instrumentation.d.ts +11 -0
  574. package/build/types/integrations/tracing/genericPool/vendored/instrumentation.d.ts.map +1 -0
  575. package/build/types/integrations/tracing/google-genai/index.d.ts +11 -8
  576. package/build/types/integrations/tracing/google-genai/index.d.ts.map +1 -1
  577. package/build/types/integrations/tracing/google-genai/instrumentation.d.ts.map +1 -1
  578. package/build/types/integrations/tracing/{graphql.d.ts → graphql/index.d.ts} +5 -3
  579. package/build/types/integrations/tracing/graphql/index.d.ts.map +1 -0
  580. package/build/types/integrations/tracing/graphql/vendored/enum.d.ts +38 -0
  581. package/build/types/integrations/tracing/graphql/vendored/enum.d.ts.map +1 -0
  582. package/build/types/integrations/tracing/graphql/vendored/enums/AttributeNames.d.ts +10 -0
  583. package/build/types/integrations/tracing/graphql/vendored/enums/AttributeNames.d.ts.map +1 -0
  584. package/build/types/integrations/tracing/graphql/vendored/graphql-types.d.ts +2 -0
  585. package/build/types/integrations/tracing/graphql/vendored/graphql-types.d.ts.map +1 -0
  586. package/build/types/integrations/tracing/graphql/vendored/instrumentation.d.ts +25 -0
  587. package/build/types/integrations/tracing/graphql/vendored/instrumentation.d.ts.map +1 -0
  588. package/build/types/integrations/tracing/graphql/vendored/internal-types.d.ts +63 -0
  589. package/build/types/integrations/tracing/graphql/vendored/internal-types.d.ts.map +1 -0
  590. package/build/types/integrations/tracing/graphql/vendored/symbols.d.ts +3 -0
  591. package/build/types/integrations/tracing/graphql/vendored/symbols.d.ts.map +1 -0
  592. package/build/types/integrations/tracing/graphql/vendored/types.d.ts +33 -0
  593. package/build/types/integrations/tracing/graphql/vendored/types.d.ts.map +1 -0
  594. package/build/types/integrations/tracing/graphql/vendored/utils.d.ts +14 -0
  595. package/build/types/integrations/tracing/graphql/vendored/utils.d.ts.map +1 -0
  596. package/build/types/integrations/tracing/hapi/index.d.ts +4 -2
  597. package/build/types/integrations/tracing/hapi/index.d.ts.map +1 -1
  598. package/build/types/integrations/tracing/hapi/vendored/enums/AttributeNames.d.ts +6 -0
  599. package/build/types/integrations/tracing/hapi/vendored/enums/AttributeNames.d.ts.map +1 -0
  600. package/build/types/integrations/tracing/hapi/vendored/hapi-types.d.ts +70 -0
  601. package/build/types/integrations/tracing/hapi/vendored/hapi-types.d.ts.map +1 -0
  602. package/build/types/integrations/tracing/hapi/vendored/instrumentation.d.ts +72 -0
  603. package/build/types/integrations/tracing/hapi/vendored/instrumentation.d.ts.map +1 -0
  604. package/build/types/integrations/tracing/hapi/vendored/internal-types.d.ts +32 -0
  605. package/build/types/integrations/tracing/hapi/vendored/internal-types.d.ts.map +1 -0
  606. package/build/types/integrations/tracing/hapi/vendored/utils.d.ts +18 -0
  607. package/build/types/integrations/tracing/hapi/vendored/utils.d.ts.map +1 -0
  608. package/build/types/integrations/tracing/hono/index.d.ts +9 -1
  609. package/build/types/integrations/tracing/hono/index.d.ts.map +1 -1
  610. package/build/types/integrations/tracing/index.d.ts.map +1 -1
  611. package/build/types/integrations/tracing/{kafka.d.ts → kafka/index.d.ts} +5 -3
  612. package/build/types/integrations/tracing/kafka/index.d.ts.map +1 -0
  613. package/build/types/integrations/tracing/kafka/vendored/instrumentation.d.ts +15 -0
  614. package/build/types/integrations/tracing/kafka/vendored/instrumentation.d.ts.map +1 -0
  615. package/build/types/integrations/tracing/kafka/vendored/kafkajs-types.d.ts +79 -0
  616. package/build/types/integrations/tracing/kafka/vendored/kafkajs-types.d.ts.map +1 -0
  617. package/build/types/integrations/tracing/kafka/vendored/semconv.d.ts +54 -0
  618. package/build/types/integrations/tracing/kafka/vendored/semconv.d.ts.map +1 -0
  619. package/build/types/integrations/tracing/kafka/vendored/utils.d.ts +29 -0
  620. package/build/types/integrations/tracing/kafka/vendored/utils.d.ts.map +1 -0
  621. package/build/types/integrations/tracing/{knex.d.ts → knex/index.d.ts} +5 -3
  622. package/build/types/integrations/tracing/knex/index.d.ts.map +1 -0
  623. package/build/types/integrations/tracing/knex/vendored/instrumentation.d.ts +12 -0
  624. package/build/types/integrations/tracing/knex/vendored/instrumentation.d.ts.map +1 -0
  625. package/build/types/integrations/tracing/knex/vendored/semconv.d.ts +7 -0
  626. package/build/types/integrations/tracing/knex/vendored/semconv.d.ts.map +1 -0
  627. package/build/types/integrations/tracing/knex/vendored/utils.d.ts +9 -0
  628. package/build/types/integrations/tracing/knex/vendored/utils.d.ts.map +1 -0
  629. package/build/types/integrations/tracing/{koa.d.ts → koa/index.d.ts} +5 -3
  630. package/build/types/integrations/tracing/koa/index.d.ts.map +1 -0
  631. package/build/types/integrations/tracing/koa/vendored/enums/AttributeNames.d.ts +5 -0
  632. package/build/types/integrations/tracing/koa/vendored/enums/AttributeNames.d.ts.map +1 -0
  633. package/build/types/integrations/tracing/koa/vendored/instrumentation.d.ts +32 -0
  634. package/build/types/integrations/tracing/koa/vendored/instrumentation.d.ts.map +1 -0
  635. package/build/types/integrations/tracing/koa/vendored/internal-types.d.ts +34 -0
  636. package/build/types/integrations/tracing/koa/vendored/internal-types.d.ts.map +1 -0
  637. package/build/types/integrations/tracing/koa/vendored/types.d.ts +13 -0
  638. package/build/types/integrations/tracing/koa/vendored/types.d.ts.map +1 -0
  639. package/build/types/integrations/tracing/koa/vendored/utils.d.ts +15 -0
  640. package/build/types/integrations/tracing/koa/vendored/utils.d.ts.map +1 -0
  641. package/build/types/integrations/tracing/langchain/index.d.ts +16 -12
  642. package/build/types/integrations/tracing/langchain/index.d.ts.map +1 -1
  643. package/build/types/integrations/tracing/langchain/instrumentation.d.ts +10 -1
  644. package/build/types/integrations/tracing/langchain/instrumentation.d.ts.map +1 -1
  645. package/build/types/integrations/tracing/langgraph/index.d.ts +11 -8
  646. package/build/types/integrations/tracing/langgraph/index.d.ts.map +1 -1
  647. package/build/types/integrations/tracing/langgraph/instrumentation.d.ts +1 -1
  648. package/build/types/integrations/tracing/langgraph/instrumentation.d.ts.map +1 -1
  649. package/build/types/integrations/tracing/{lrumemoizer.d.ts → lrumemoizer/index.d.ts} +5 -3
  650. package/build/types/integrations/tracing/lrumemoizer/index.d.ts.map +1 -0
  651. package/build/types/integrations/tracing/lrumemoizer/vendored/instrumentation.d.ts +6 -0
  652. package/build/types/integrations/tracing/lrumemoizer/vendored/instrumentation.d.ts.map +1 -0
  653. package/build/{types-ts3.8/integrations/tracing/mongo.d.ts → types/integrations/tracing/mongo/index.d.ts} +22 -24
  654. package/build/types/integrations/tracing/mongo/index.d.ts.map +1 -0
  655. package/build/types/integrations/tracing/mongo/vendored/instrumentation.d.ts +11 -0
  656. package/build/types/integrations/tracing/mongo/vendored/instrumentation.d.ts.map +1 -0
  657. package/build/types/integrations/tracing/mongo/vendored/internal-types.d.ts +62 -0
  658. package/build/types/integrations/tracing/mongo/vendored/internal-types.d.ts.map +1 -0
  659. package/build/types/integrations/tracing/mongo/vendored/patches.d.ts +15 -0
  660. package/build/types/integrations/tracing/mongo/vendored/patches.d.ts.map +1 -0
  661. package/build/types/integrations/tracing/mongo/vendored/utils.d.ts +15 -0
  662. package/build/types/integrations/tracing/mongo/vendored/utils.d.ts.map +1 -0
  663. package/build/types/integrations/tracing/{mongoose.d.ts → mongoose/index.d.ts} +5 -3
  664. package/build/types/integrations/tracing/mongoose/index.d.ts.map +1 -0
  665. package/build/types/integrations/tracing/mongoose/vendored/mongoose-types.d.ts +33 -0
  666. package/build/types/integrations/tracing/mongoose/vendored/mongoose-types.d.ts.map +1 -0
  667. package/build/types/integrations/tracing/mongoose/vendored/mongoose.d.ts +18 -0
  668. package/build/types/integrations/tracing/mongoose/vendored/mongoose.d.ts.map +1 -0
  669. package/build/types/integrations/tracing/mongoose/vendored/utils.d.ts +4 -0
  670. package/build/types/integrations/tracing/mongoose/vendored/utils.d.ts.map +1 -0
  671. package/build/types/integrations/tracing/{mysql.d.ts → mysql/index.d.ts} +5 -3
  672. package/build/types/integrations/tracing/mysql/index.d.ts.map +1 -0
  673. package/build/types/integrations/tracing/mysql/vendored/instrumentation.d.ts +14 -0
  674. package/build/types/integrations/tracing/mysql/vendored/instrumentation.d.ts.map +1 -0
  675. package/build/types/integrations/tracing/mysql/vendored/mysql-types.d.ts +78 -0
  676. package/build/types/integrations/tracing/mysql/vendored/mysql-types.d.ts.map +1 -0
  677. package/build/types/integrations/tracing/mysql/vendored/semconv.d.ts +19 -0
  678. package/build/types/integrations/tracing/mysql/vendored/semconv.d.ts.map +1 -0
  679. package/build/types/integrations/tracing/mysql/vendored/utils.d.ts +22 -0
  680. package/build/types/integrations/tracing/mysql/vendored/utils.d.ts.map +1 -0
  681. package/build/types/integrations/tracing/{mysql2.d.ts → mysql2/index.d.ts} +5 -3
  682. package/build/types/integrations/tracing/mysql2/index.d.ts.map +1 -0
  683. package/build/types/integrations/tracing/mysql2/vendored/instrumentation.d.ts +9 -0
  684. package/build/types/integrations/tracing/mysql2/vendored/instrumentation.d.ts.map +1 -0
  685. package/build/types/integrations/tracing/mysql2/vendored/mysql2-types.d.ts +39 -0
  686. package/build/types/integrations/tracing/mysql2/vendored/mysql2-types.d.ts.map +1 -0
  687. package/build/types/integrations/tracing/mysql2/vendored/semconv.d.ts +3 -0
  688. package/build/types/integrations/tracing/mysql2/vendored/semconv.d.ts.map +1 -0
  689. package/build/types/integrations/tracing/mysql2/vendored/utils.d.ts +25 -0
  690. package/build/types/integrations/tracing/mysql2/vendored/utils.d.ts.map +1 -0
  691. package/build/types/integrations/tracing/openai/index.d.ts +11 -8
  692. package/build/types/integrations/tracing/openai/index.d.ts.map +1 -1
  693. package/build/types/integrations/tracing/{postgres.d.ts → postgres/index.d.ts} +5 -3
  694. package/build/types/integrations/tracing/postgres/index.d.ts.map +1 -0
  695. package/build/types/integrations/tracing/postgres/vendored/enums/AttributeNames.d.ts +6 -0
  696. package/build/types/integrations/tracing/postgres/vendored/enums/AttributeNames.d.ts.map +1 -0
  697. package/build/types/integrations/tracing/postgres/vendored/enums/SpanNames.d.ts +6 -0
  698. package/build/types/integrations/tracing/postgres/vendored/enums/SpanNames.d.ts.map +1 -0
  699. package/build/types/integrations/tracing/postgres/vendored/instrumentation.d.ts +12 -0
  700. package/build/types/integrations/tracing/postgres/vendored/instrumentation.d.ts.map +1 -0
  701. package/build/types/integrations/tracing/postgres/vendored/internal-types.d.ts +33 -0
  702. package/build/types/integrations/tracing/postgres/vendored/internal-types.d.ts.map +1 -0
  703. package/build/types/integrations/tracing/postgres/vendored/pg-pool-types.d.ts +20 -0
  704. package/build/types/integrations/tracing/postgres/vendored/pg-pool-types.d.ts.map +1 -0
  705. package/build/types/integrations/tracing/postgres/vendored/pg-types.d.ts +54 -0
  706. package/build/types/integrations/tracing/postgres/vendored/pg-types.d.ts.map +1 -0
  707. package/build/types/integrations/tracing/postgres/vendored/semconv.d.ts +13 -0
  708. package/build/types/integrations/tracing/postgres/vendored/semconv.d.ts.map +1 -0
  709. package/build/types/integrations/tracing/postgres/vendored/types.d.ts +11 -0
  710. package/build/types/integrations/tracing/postgres/vendored/types.d.ts.map +1 -0
  711. package/build/types/integrations/tracing/postgres/vendored/utils.d.ts +56 -0
  712. package/build/types/integrations/tracing/postgres/vendored/utils.d.ts.map +1 -0
  713. package/build/types/integrations/tracing/postgresjs.d.ts +3 -1
  714. package/build/types/integrations/tracing/postgresjs.d.ts.map +1 -1
  715. package/build/types/integrations/tracing/redis/cache.d.ts +22 -0
  716. package/build/types/integrations/tracing/redis/cache.d.ts.map +1 -0
  717. package/build/types/integrations/tracing/redis/index.d.ts +28 -0
  718. package/build/types/integrations/tracing/redis/index.d.ts.map +1 -0
  719. package/build/types/integrations/tracing/redis/vendored/ioredis-instrumentation.d.ts +10 -0
  720. package/build/types/integrations/tracing/redis/vendored/ioredis-instrumentation.d.ts.map +1 -0
  721. package/build/types/integrations/tracing/redis/vendored/redis-instrumentation.d.ts +16 -0
  722. package/build/types/integrations/tracing/redis/vendored/redis-instrumentation.d.ts.map +1 -0
  723. package/build/types/integrations/tracing/redis/vendored/semconv.d.ts +4 -0
  724. package/build/types/integrations/tracing/redis/vendored/semconv.d.ts.map +1 -0
  725. package/build/types/integrations/tracing/redis/vendored/types.d.ts +24 -0
  726. package/build/types/integrations/tracing/redis/vendored/types.d.ts.map +1 -0
  727. package/build/types/integrations/tracing/{tedious.d.ts → tedious/index.d.ts} +5 -3
  728. package/build/types/integrations/tracing/tedious/index.d.ts.map +1 -0
  729. package/build/types/integrations/tracing/tedious/vendored/instrumentation.d.ts +11 -0
  730. package/build/types/integrations/tracing/tedious/vendored/instrumentation.d.ts.map +1 -0
  731. package/build/types/integrations/tracing/tedious/vendored/semconv.d.ts +19 -0
  732. package/build/types/integrations/tracing/tedious/vendored/semconv.d.ts.map +1 -0
  733. package/build/types/integrations/tracing/tedious/vendored/tedious-types.d.ts +21 -0
  734. package/build/types/integrations/tracing/tedious/vendored/tedious-types.d.ts.map +1 -0
  735. package/build/types/integrations/tracing/tedious/vendored/utils.d.ts +9 -0
  736. package/build/types/integrations/tracing/tedious/vendored/utils.d.ts.map +1 -0
  737. package/build/types/integrations/tracing/vercelai/constants.d.ts +1 -1
  738. package/build/types/integrations/tracing/vercelai/constants.d.ts.map +1 -1
  739. package/build/types/integrations/tracing/vercelai/index.d.ts +3 -2
  740. package/build/types/integrations/tracing/vercelai/index.d.ts.map +1 -1
  741. package/build/types/integrations/tracing/vercelai/instrumentation.d.ts +2 -2
  742. package/build/types/integrations/tracing/vercelai/instrumentation.d.ts.map +1 -1
  743. package/build/types/integrations/tracing/vercelai/types.d.ts +11 -4
  744. package/build/types/integrations/tracing/vercelai/types.d.ts.map +1 -1
  745. package/build/types/sdk/diagnosticsChannelInjection.d.ts +41 -0
  746. package/build/types/sdk/diagnosticsChannelInjection.d.ts.map +1 -0
  747. package/build/types/sdk/experimentalUseDiagnosticsChannelInjection.d.ts +37 -0
  748. package/build/types/sdk/experimentalUseDiagnosticsChannelInjection.d.ts.map +1 -0
  749. package/build/types/sdk/index.d.ts +18 -0
  750. package/build/types/sdk/index.d.ts.map +1 -1
  751. package/build/types/sdk/initOtel.d.ts +2 -3
  752. package/build/types/sdk/initOtel.d.ts.map +1 -1
  753. package/build/types/utils/redisCache.d.ts +1 -1
  754. package/build/types/utils/redisCache.d.ts.map +1 -1
  755. package/build/types/utils/setHttpServerSpanRouteAttribute.d.ts +9 -0
  756. package/build/types/utils/setHttpServerSpanRouteAttribute.d.ts.map +1 -0
  757. package/build/types-ts3.8/index.d.ts +6 -4
  758. package/build/types-ts3.8/integrations/featureFlagShims/launchDarkly.d.ts +3 -1
  759. package/build/types-ts3.8/integrations/featureFlagShims/openFeature.d.ts +3 -1
  760. package/build/types-ts3.8/integrations/featureFlagShims/statsig.d.ts +3 -1
  761. package/build/types-ts3.8/integrations/featureFlagShims/unleash.d.ts +3 -1
  762. package/build/types-ts3.8/integrations/fs/index.d.ts +14 -0
  763. package/build/types-ts3.8/integrations/fs/vendored/constants.d.ts +5 -0
  764. package/build/types-ts3.8/integrations/fs/vendored/instrumentation.d.ts +3 -0
  765. package/build/types-ts3.8/integrations/fs/vendored/types.d.ts +23 -0
  766. package/build/types-ts3.8/integrations/fs/vendored/utils.d.ts +15 -0
  767. package/build/types-ts3.8/integrations/http.d.ts +12 -17
  768. package/build/types-ts3.8/integrations/node-fetch.d.ts +8 -35
  769. package/build/types-ts3.8/integrations/tracing/InstrumentationNodeModuleFile.d.ts +9 -0
  770. package/build/types-ts3.8/integrations/tracing/{amqplib.d.ts → amqplib/index.d.ts} +5 -3
  771. package/build/types-ts3.8/integrations/tracing/amqplib/vendored/amqplib-types.d.ts +44 -0
  772. package/build/types-ts3.8/integrations/tracing/amqplib/vendored/instrumentation.d.ts +11 -0
  773. package/build/types-ts3.8/integrations/tracing/amqplib/vendored/patches.d.ts +11 -0
  774. package/build/types-ts3.8/integrations/tracing/amqplib/vendored/semconv.d.ts +23 -0
  775. package/build/types-ts3.8/integrations/tracing/amqplib/vendored/types.d.ts +49 -0
  776. package/build/types-ts3.8/integrations/tracing/amqplib/vendored/utils.d.ts +42 -0
  777. package/build/types-ts3.8/integrations/tracing/anthropic-ai/index.d.ts +11 -8
  778. package/build/types-ts3.8/integrations/tracing/{connect.d.ts → connect/index.d.ts} +5 -3
  779. package/build/types-ts3.8/integrations/tracing/connect/vendored/enums/AttributeNames.d.ts +9 -0
  780. package/build/types-ts3.8/integrations/tracing/connect/vendored/instrumentation.d.ts +18 -0
  781. package/build/types-ts3.8/integrations/tracing/connect/vendored/internal-types.d.ts +36 -0
  782. package/build/types-ts3.8/integrations/tracing/connect/vendored/utils.d.ts +5 -0
  783. package/build/types-ts3.8/integrations/tracing/{dataloader.d.ts → dataloader/index.d.ts} +5 -3
  784. package/build/types-ts3.8/integrations/tracing/dataloader/vendored/instrumentation.d.ts +18 -0
  785. package/build/types-ts3.8/integrations/tracing/dataloader/vendored/types.d.ts +22 -0
  786. package/build/types-ts3.8/integrations/tracing/express.d.ts +15 -68
  787. package/build/types-ts3.8/integrations/tracing/fastify/index.d.ts +6 -6
  788. package/build/types-ts3.8/integrations/tracing/firebase/firebase.d.ts +3 -1
  789. package/build/types-ts3.8/integrations/tracing/firebase/otel/firebaseInstrumentation.d.ts +4 -9
  790. package/build/types-ts3.8/integrations/tracing/firebase/otel/patches/firestore.d.ts +2 -5
  791. package/build/types-ts3.8/integrations/tracing/firebase/otel/patches/functions.d.ts +3 -8
  792. package/build/types-ts3.8/integrations/tracing/firebase/otel/types.d.ts +0 -20
  793. package/build/types-ts3.8/integrations/tracing/{genericPool.d.ts → genericPool/index.d.ts} +5 -3
  794. package/build/types-ts3.8/integrations/tracing/genericPool/vendored/generic-pool-types.d.ts +5 -0
  795. package/build/types-ts3.8/integrations/tracing/genericPool/vendored/instrumentation.d.ts +11 -0
  796. package/build/types-ts3.8/integrations/tracing/google-genai/index.d.ts +11 -8
  797. package/build/types-ts3.8/integrations/tracing/{graphql.d.ts → graphql/index.d.ts} +5 -3
  798. package/build/types-ts3.8/integrations/tracing/graphql/vendored/enum.d.ts +38 -0
  799. package/build/types-ts3.8/integrations/tracing/graphql/vendored/enums/AttributeNames.d.ts +10 -0
  800. package/build/types-ts3.8/integrations/tracing/graphql/vendored/graphql-types.d.ts +2 -0
  801. package/build/types-ts3.8/integrations/tracing/graphql/vendored/instrumentation.d.ts +25 -0
  802. package/build/types-ts3.8/integrations/tracing/graphql/vendored/internal-types.d.ts +63 -0
  803. package/build/types-ts3.8/integrations/tracing/graphql/vendored/symbols.d.ts +3 -0
  804. package/build/types-ts3.8/integrations/tracing/graphql/vendored/types.d.ts +33 -0
  805. package/build/types-ts3.8/integrations/tracing/graphql/vendored/utils.d.ts +14 -0
  806. package/build/types-ts3.8/integrations/tracing/hapi/index.d.ts +4 -2
  807. package/build/types-ts3.8/integrations/tracing/hapi/vendored/enums/AttributeNames.d.ts +6 -0
  808. package/build/types-ts3.8/integrations/tracing/hapi/vendored/hapi-types.d.ts +70 -0
  809. package/build/types-ts3.8/integrations/tracing/hapi/vendored/instrumentation.d.ts +72 -0
  810. package/build/types-ts3.8/integrations/tracing/hapi/vendored/internal-types.d.ts +32 -0
  811. package/build/types-ts3.8/integrations/tracing/hapi/vendored/utils.d.ts +18 -0
  812. package/build/types-ts3.8/integrations/tracing/hono/index.d.ts +9 -1
  813. package/build/types-ts3.8/integrations/tracing/{kafka.d.ts → kafka/index.d.ts} +5 -3
  814. package/build/types-ts3.8/integrations/tracing/kafka/vendored/instrumentation.d.ts +15 -0
  815. package/build/types-ts3.8/integrations/tracing/kafka/vendored/kafkajs-types.d.ts +79 -0
  816. package/build/types-ts3.8/integrations/tracing/kafka/vendored/semconv.d.ts +54 -0
  817. package/build/types-ts3.8/integrations/tracing/kafka/vendored/utils.d.ts +29 -0
  818. package/build/types-ts3.8/integrations/tracing/{knex.d.ts → knex/index.d.ts} +5 -3
  819. package/build/types-ts3.8/integrations/tracing/knex/vendored/instrumentation.d.ts +12 -0
  820. package/build/types-ts3.8/integrations/tracing/knex/vendored/semconv.d.ts +7 -0
  821. package/build/types-ts3.8/integrations/tracing/knex/vendored/utils.d.ts +9 -0
  822. package/build/types-ts3.8/integrations/tracing/{koa.d.ts → koa/index.d.ts} +5 -3
  823. package/build/types-ts3.8/integrations/tracing/koa/vendored/enums/AttributeNames.d.ts +5 -0
  824. package/build/types-ts3.8/integrations/tracing/koa/vendored/instrumentation.d.ts +32 -0
  825. package/build/types-ts3.8/integrations/tracing/koa/vendored/internal-types.d.ts +34 -0
  826. package/build/types-ts3.8/integrations/tracing/koa/vendored/types.d.ts +13 -0
  827. package/build/types-ts3.8/integrations/tracing/koa/vendored/utils.d.ts +15 -0
  828. package/build/types-ts3.8/integrations/tracing/langchain/index.d.ts +16 -12
  829. package/build/types-ts3.8/integrations/tracing/langchain/instrumentation.d.ts +10 -1
  830. package/build/types-ts3.8/integrations/tracing/langgraph/index.d.ts +11 -8
  831. package/build/types-ts3.8/integrations/tracing/langgraph/instrumentation.d.ts +1 -1
  832. package/build/types-ts3.8/integrations/tracing/{lrumemoizer.d.ts → lrumemoizer/index.d.ts} +5 -3
  833. package/build/types-ts3.8/integrations/tracing/lrumemoizer/vendored/instrumentation.d.ts +6 -0
  834. package/build/{types/integrations/tracing/mongo.d.ts → types-ts3.8/integrations/tracing/mongo/index.d.ts} +22 -24
  835. package/build/types-ts3.8/integrations/tracing/mongo/vendored/instrumentation.d.ts +11 -0
  836. package/build/types-ts3.8/integrations/tracing/mongo/vendored/internal-types.d.ts +62 -0
  837. package/build/types-ts3.8/integrations/tracing/mongo/vendored/patches.d.ts +15 -0
  838. package/build/types-ts3.8/integrations/tracing/mongo/vendored/utils.d.ts +15 -0
  839. package/build/types-ts3.8/integrations/tracing/{mongoose.d.ts → mongoose/index.d.ts} +5 -3
  840. package/build/types-ts3.8/integrations/tracing/mongoose/vendored/mongoose-types.d.ts +33 -0
  841. package/build/types-ts3.8/integrations/tracing/mongoose/vendored/mongoose.d.ts +18 -0
  842. package/build/types-ts3.8/integrations/tracing/mongoose/vendored/utils.d.ts +4 -0
  843. package/build/types-ts3.8/integrations/tracing/{mysql.d.ts → mysql/index.d.ts} +5 -3
  844. package/build/types-ts3.8/integrations/tracing/mysql/vendored/instrumentation.d.ts +14 -0
  845. package/build/types-ts3.8/integrations/tracing/mysql/vendored/mysql-types.d.ts +78 -0
  846. package/build/types-ts3.8/integrations/tracing/mysql/vendored/semconv.d.ts +19 -0
  847. package/build/types-ts3.8/integrations/tracing/mysql/vendored/utils.d.ts +22 -0
  848. package/build/types-ts3.8/integrations/tracing/{mysql2.d.ts → mysql2/index.d.ts} +5 -3
  849. package/build/types-ts3.8/integrations/tracing/mysql2/vendored/instrumentation.d.ts +9 -0
  850. package/build/types-ts3.8/integrations/tracing/mysql2/vendored/mysql2-types.d.ts +39 -0
  851. package/build/types-ts3.8/integrations/tracing/mysql2/vendored/semconv.d.ts +3 -0
  852. package/build/types-ts3.8/integrations/tracing/mysql2/vendored/utils.d.ts +25 -0
  853. package/build/types-ts3.8/integrations/tracing/openai/index.d.ts +11 -8
  854. package/build/types-ts3.8/integrations/tracing/{postgres.d.ts → postgres/index.d.ts} +5 -3
  855. package/build/types-ts3.8/integrations/tracing/postgres/vendored/enums/AttributeNames.d.ts +6 -0
  856. package/build/types-ts3.8/integrations/tracing/postgres/vendored/enums/SpanNames.d.ts +6 -0
  857. package/build/types-ts3.8/integrations/tracing/postgres/vendored/instrumentation.d.ts +12 -0
  858. package/build/types-ts3.8/integrations/tracing/postgres/vendored/internal-types.d.ts +33 -0
  859. package/build/types-ts3.8/integrations/tracing/postgres/vendored/pg-pool-types.d.ts +20 -0
  860. package/build/types-ts3.8/integrations/tracing/postgres/vendored/pg-types.d.ts +54 -0
  861. package/build/types-ts3.8/integrations/tracing/postgres/vendored/semconv.d.ts +13 -0
  862. package/build/types-ts3.8/integrations/tracing/postgres/vendored/types.d.ts +11 -0
  863. package/build/types-ts3.8/integrations/tracing/postgres/vendored/utils.d.ts +56 -0
  864. package/build/types-ts3.8/integrations/tracing/postgresjs.d.ts +3 -1
  865. package/build/types-ts3.8/integrations/tracing/redis/cache.d.ts +22 -0
  866. package/build/types-ts3.8/integrations/tracing/redis/index.d.ts +28 -0
  867. package/build/types-ts3.8/integrations/tracing/redis/vendored/ioredis-instrumentation.d.ts +10 -0
  868. package/build/types-ts3.8/integrations/tracing/redis/vendored/redis-instrumentation.d.ts +16 -0
  869. package/build/types-ts3.8/integrations/tracing/redis/vendored/semconv.d.ts +4 -0
  870. package/build/types-ts3.8/integrations/tracing/redis/vendored/types.d.ts +24 -0
  871. package/build/types-ts3.8/integrations/tracing/{tedious.d.ts → tedious/index.d.ts} +5 -3
  872. package/build/types-ts3.8/integrations/tracing/tedious/vendored/instrumentation.d.ts +11 -0
  873. package/build/types-ts3.8/integrations/tracing/tedious/vendored/semconv.d.ts +19 -0
  874. package/build/types-ts3.8/integrations/tracing/tedious/vendored/tedious-types.d.ts +21 -0
  875. package/build/types-ts3.8/integrations/tracing/tedious/vendored/utils.d.ts +9 -0
  876. package/build/types-ts3.8/integrations/tracing/vercelai/constants.d.ts +1 -1
  877. package/build/types-ts3.8/integrations/tracing/vercelai/index.d.ts +3 -2
  878. package/build/types-ts3.8/integrations/tracing/vercelai/instrumentation.d.ts +2 -2
  879. package/build/types-ts3.8/integrations/tracing/vercelai/types.d.ts +11 -4
  880. package/build/types-ts3.8/sdk/diagnosticsChannelInjection.d.ts +41 -0
  881. package/build/types-ts3.8/sdk/experimentalUseDiagnosticsChannelInjection.d.ts +37 -0
  882. package/build/types-ts3.8/sdk/index.d.ts +18 -0
  883. package/build/types-ts3.8/sdk/initOtel.d.ts +3 -4
  884. package/build/types-ts3.8/utils/redisCache.d.ts +1 -1
  885. package/build/types-ts3.8/utils/setHttpServerSpanRouteAttribute.d.ts +9 -0
  886. package/changes.json +9 -5
  887. package/package.json +33 -41
  888. package/build/cjs/integrations/fs.js +0 -142
  889. package/build/cjs/integrations/fs.js.map +0 -1
  890. package/build/cjs/integrations/tracing/amqplib.js +0 -47
  891. package/build/cjs/integrations/tracing/amqplib.js.map +0 -1
  892. package/build/cjs/integrations/tracing/connect.js +0 -110
  893. package/build/cjs/integrations/tracing/connect.js.map +0 -1
  894. package/build/cjs/integrations/tracing/dataloader.js +0 -72
  895. package/build/cjs/integrations/tracing/dataloader.js.map +0 -1
  896. package/build/cjs/integrations/tracing/genericPool.js +0 -59
  897. package/build/cjs/integrations/tracing/genericPool.js.map +0 -1
  898. package/build/cjs/integrations/tracing/graphql.js +0 -127
  899. package/build/cjs/integrations/tracing/graphql.js.map +0 -1
  900. package/build/cjs/integrations/tracing/kafka.js +0 -48
  901. package/build/cjs/integrations/tracing/kafka.js.map +0 -1
  902. package/build/cjs/integrations/tracing/knex.js +0 -57
  903. package/build/cjs/integrations/tracing/knex.js.map +0 -1
  904. package/build/cjs/integrations/tracing/koa.js +0 -138
  905. package/build/cjs/integrations/tracing/koa.js.map +0 -1
  906. package/build/cjs/integrations/tracing/lrumemoizer.js +0 -37
  907. package/build/cjs/integrations/tracing/lrumemoizer.js.map +0 -1
  908. package/build/cjs/integrations/tracing/mongo.js +0 -93
  909. package/build/cjs/integrations/tracing/mongo.js.map +0 -1
  910. package/build/cjs/integrations/tracing/mongoose.js +0 -46
  911. package/build/cjs/integrations/tracing/mongoose.js.map +0 -1
  912. package/build/cjs/integrations/tracing/mysql.js +0 -38
  913. package/build/cjs/integrations/tracing/mysql.js.map +0 -1
  914. package/build/cjs/integrations/tracing/mysql2.js +0 -46
  915. package/build/cjs/integrations/tracing/mysql2.js.map +0 -1
  916. package/build/cjs/integrations/tracing/postgres.js +0 -48
  917. package/build/cjs/integrations/tracing/postgres.js.map +0 -1
  918. package/build/cjs/integrations/tracing/prisma.js +0 -203
  919. package/build/cjs/integrations/tracing/prisma.js.map +0 -1
  920. package/build/cjs/integrations/tracing/redis.js +0 -121
  921. package/build/cjs/integrations/tracing/redis.js.map +0 -1
  922. package/build/cjs/integrations/tracing/tedious.js +0 -67
  923. package/build/cjs/integrations/tracing/tedious.js.map +0 -1
  924. package/build/esm/integrations/fs.js +0 -140
  925. package/build/esm/integrations/fs.js.map +0 -1
  926. package/build/esm/integrations/tracing/amqplib.js +0 -44
  927. package/build/esm/integrations/tracing/amqplib.js.map +0 -1
  928. package/build/esm/integrations/tracing/connect.js +0 -106
  929. package/build/esm/integrations/tracing/connect.js.map +0 -1
  930. package/build/esm/integrations/tracing/dataloader.js +0 -69
  931. package/build/esm/integrations/tracing/dataloader.js.map +0 -1
  932. package/build/esm/integrations/tracing/genericPool.js +0 -56
  933. package/build/esm/integrations/tracing/genericPool.js.map +0 -1
  934. package/build/esm/integrations/tracing/graphql.js +0 -124
  935. package/build/esm/integrations/tracing/graphql.js.map +0 -1
  936. package/build/esm/integrations/tracing/kafka.js +0 -45
  937. package/build/esm/integrations/tracing/kafka.js.map +0 -1
  938. package/build/esm/integrations/tracing/knex.js +0 -54
  939. package/build/esm/integrations/tracing/knex.js.map +0 -1
  940. package/build/esm/integrations/tracing/koa.js +0 -134
  941. package/build/esm/integrations/tracing/koa.js.map +0 -1
  942. package/build/esm/integrations/tracing/lrumemoizer.js +0 -34
  943. package/build/esm/integrations/tracing/lrumemoizer.js.map +0 -1
  944. package/build/esm/integrations/tracing/mongo.js +0 -89
  945. package/build/esm/integrations/tracing/mongo.js.map +0 -1
  946. package/build/esm/integrations/tracing/mongoose.js +0 -43
  947. package/build/esm/integrations/tracing/mongoose.js.map +0 -1
  948. package/build/esm/integrations/tracing/mysql.js +0 -35
  949. package/build/esm/integrations/tracing/mysql.js.map +0 -1
  950. package/build/esm/integrations/tracing/mysql2.js +0 -43
  951. package/build/esm/integrations/tracing/mysql2.js.map +0 -1
  952. package/build/esm/integrations/tracing/postgres.js +0 -45
  953. package/build/esm/integrations/tracing/postgres.js.map +0 -1
  954. package/build/esm/integrations/tracing/prisma.js +0 -200
  955. package/build/esm/integrations/tracing/prisma.js.map +0 -1
  956. package/build/esm/integrations/tracing/redis.js +0 -117
  957. package/build/esm/integrations/tracing/redis.js.map +0 -1
  958. package/build/esm/integrations/tracing/tedious.js +0 -64
  959. package/build/esm/integrations/tracing/tedious.js.map +0 -1
  960. package/build/types/integrations/fs.d.ts +0 -24
  961. package/build/types/integrations/fs.d.ts.map +0 -1
  962. package/build/types/integrations/tracing/amqplib.d.ts.map +0 -1
  963. package/build/types/integrations/tracing/connect.d.ts.map +0 -1
  964. package/build/types/integrations/tracing/dataloader.d.ts.map +0 -1
  965. package/build/types/integrations/tracing/genericPool.d.ts.map +0 -1
  966. package/build/types/integrations/tracing/graphql.d.ts.map +0 -1
  967. package/build/types/integrations/tracing/kafka.d.ts.map +0 -1
  968. package/build/types/integrations/tracing/knex.d.ts.map +0 -1
  969. package/build/types/integrations/tracing/koa.d.ts.map +0 -1
  970. package/build/types/integrations/tracing/lrumemoizer.d.ts.map +0 -1
  971. package/build/types/integrations/tracing/mongo.d.ts.map +0 -1
  972. package/build/types/integrations/tracing/mongoose.d.ts.map +0 -1
  973. package/build/types/integrations/tracing/mysql.d.ts.map +0 -1
  974. package/build/types/integrations/tracing/mysql2.d.ts.map +0 -1
  975. package/build/types/integrations/tracing/postgres.d.ts.map +0 -1
  976. package/build/types/integrations/tracing/prisma/vendor/v5-tracing-helper.d.ts +0 -38
  977. package/build/types/integrations/tracing/prisma/vendor/v5-tracing-helper.d.ts.map +0 -1
  978. package/build/types/integrations/tracing/prisma/vendor/v6-tracing-helper.d.ts +0 -31
  979. package/build/types/integrations/tracing/prisma/vendor/v6-tracing-helper.d.ts.map +0 -1
  980. package/build/types/integrations/tracing/prisma.d.ts +0 -50
  981. package/build/types/integrations/tracing/prisma.d.ts.map +0 -1
  982. package/build/types/integrations/tracing/redis.d.ts +0 -41
  983. package/build/types/integrations/tracing/redis.d.ts.map +0 -1
  984. package/build/types/integrations/tracing/tedious.d.ts.map +0 -1
  985. package/build/types-ts3.8/integrations/fs.d.ts +0 -24
  986. package/build/types-ts3.8/integrations/tracing/prisma/vendor/v5-tracing-helper.d.ts +0 -44
  987. package/build/types-ts3.8/integrations/tracing/prisma/vendor/v6-tracing-helper.d.ts +0 -34
  988. package/build/types-ts3.8/integrations/tracing/prisma.d.ts +0 -50
  989. package/build/types-ts3.8/integrations/tracing/redis.d.ts +0 -41
@@ -1 +1 @@
1
- {"version":3,"file":"instrumentation.js","sources":["../../../../../src/integrations/tracing/openai/instrumentation.ts"],"sourcesContent":["import {\n InstrumentationBase,\n type InstrumentationConfig,\n type InstrumentationModuleDefinition,\n InstrumentationNodeModuleDefinition,\n} from '@opentelemetry/instrumentation';\nimport type { Integration, OpenAiClient, OpenAiOptions } from '@sentry/core';\nimport {\n _INTERNAL_shouldSkipAiProviderWrapping,\n instrumentOpenAiClient,\n OPENAI_INTEGRATION_NAME,\n SDK_VERSION,\n} from '@sentry/core';\n\nconst supportedVersions = ['>=4.0.0 <7'];\n\nexport interface OpenAiIntegration extends Integration {\n options: OpenAiOptions;\n}\n\ntype OpenAiInstrumentationOptions = InstrumentationConfig & OpenAiOptions;\n\n/**\n * Represents the patched shape of the OpenAI module export.\n */\ninterface PatchedModuleExports {\n [key: string]: unknown;\n OpenAI: abstract new (...args: unknown[]) => OpenAiClient;\n AzureOpenAI?: abstract new (...args: unknown[]) => OpenAiClient;\n}\n\n/**\n * Sentry OpenAI instrumentation using OpenTelemetry.\n */\nexport class SentryOpenAiInstrumentation extends InstrumentationBase<OpenAiInstrumentationOptions> {\n public constructor(config: OpenAiInstrumentationOptions = {}) {\n super('@sentry/instrumentation-openai', SDK_VERSION, config);\n }\n\n /**\n * Initializes the instrumentation by defining the modules to be patched.\n */\n public init(): InstrumentationModuleDefinition {\n const module = new InstrumentationNodeModuleDefinition('openai', supportedVersions, this._patch.bind(this));\n return module;\n }\n\n /**\n * Core patch logic applying instrumentation to the OpenAI and AzureOpenAI client constructors.\n */\n private _patch(exports: PatchedModuleExports): PatchedModuleExports | void {\n let result = exports;\n result = this._patchClient(result, 'OpenAI');\n result = this._patchClient(result, 'AzureOpenAI');\n return result;\n }\n\n /**\n * Patch logic applying instrumentation to the specified client constructor.\n */\n private _patchClient(exports: PatchedModuleExports, exportKey: 'OpenAI' | 'AzureOpenAI'): PatchedModuleExports {\n const Original = exports[exportKey];\n if (!Original) {\n return exports;\n }\n\n const config = this.getConfig();\n\n const WrappedOpenAI = function (this: unknown, ...args: unknown[]) {\n // Check if wrapping should be skipped (e.g., when LangChain is handling instrumentation)\n if (_INTERNAL_shouldSkipAiProviderWrapping(OPENAI_INTEGRATION_NAME)) {\n return Reflect.construct(Original, args) as OpenAiClient;\n }\n\n const instance = Reflect.construct(Original, args);\n\n return instrumentOpenAiClient(instance as OpenAiClient, config);\n } as unknown as abstract new (...args: unknown[]) => OpenAiClient;\n\n // Preserve static and prototype chains\n Object.setPrototypeOf(WrappedOpenAI, Original);\n Object.setPrototypeOf(WrappedOpenAI.prototype, Original.prototype);\n\n for (const key of Object.getOwnPropertyNames(Original)) {\n if (!['length', 'name', 'prototype'].includes(key)) {\n const descriptor = Object.getOwnPropertyDescriptor(Original, key);\n if (descriptor) {\n Object.defineProperty(WrappedOpenAI, key, descriptor);\n }\n }\n }\n\n // Constructor replacement - handle read-only properties\n // The OpenAI property might have only a getter, so use defineProperty\n try {\n exports[exportKey] = WrappedOpenAI;\n } catch {\n // If direct assignment fails, override the property descriptor\n Object.defineProperty(exports, exportKey, {\n value: WrappedOpenAI,\n writable: true,\n configurable: true,\n enumerable: true,\n });\n }\n\n // Wrap the default export if it points to the original constructor\n // Constructor replacement - handle read-only properties\n // The OpenAI property might have only a getter, so use defineProperty\n if (exports.default === Original) {\n try {\n exports.default = WrappedOpenAI;\n } catch {\n // If direct assignment fails, override the property descriptor\n Object.defineProperty(exports, 'default', {\n value: WrappedOpenAI,\n writable: true,\n configurable: true,\n enumerable: true,\n });\n }\n }\n return exports;\n }\n}\n"],"names":["InstrumentationBase","SDK_VERSION","InstrumentationNodeModuleDefinition","exports","_INTERNAL_shouldSkipAiProviderWrapping","OPENAI_INTEGRATION_NAME","instrumentOpenAiClient"],"mappings":";;;;;AAcA,MAAM,iBAAA,GAAoB,CAAC,YAAY,CAAC;;AAiBxC;AACA;AACA;AACO,MAAM,2BAAA,SAAoCA,mCAAmB,CAA+B;AACnG,GAAS,WAAW,CAAC,MAAM,GAAiC,EAAE,EAAE;AAChE,IAAI,KAAK,CAAC,gCAAgC,EAAEC,gBAAW,EAAE,MAAM,CAAC;AAChE,EAAE;;AAEF;AACA;AACA;AACA,GAAS,IAAI,GAAoC;AACjD,IAAI,MAAM,MAAA,GAAS,IAAIC,mDAAmC,CAAC,QAAQ,EAAE,iBAAiB,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC/G,IAAI,OAAO,MAAM;AACjB,EAAE;;AAEF;AACA;AACA;AACA,GAAU,MAAM,CAACC,SAAO,EAAqD;AAC7E,IAAI,IAAI,MAAA,GAASA,SAAO;AACxB,IAAI,MAAA,GAAS,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC;AAChD,IAAI,MAAA,GAAS,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,aAAa,CAAC;AACrD,IAAI,OAAO,MAAM;AACjB,EAAE;;AAEF;AACA;AACA;AACA,GAAU,YAAY,CAACA,SAAO,EAAwB,SAAS,EAAkD;AACjH,IAAI,MAAM,QAAA,GAAWA,SAAO,CAAC,SAAS,CAAC;AACvC,IAAI,IAAI,CAAC,QAAQ,EAAE;AACnB,MAAM,OAA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;AACtB,QAAQ,YAAY,EAAE,IAAI;AAC1B,QAAQ,UAAU,EAAE,IAAI;AACxB,OAAO,CAAC;AACR,IAAI;;AAEJ;AACA;AACA;AACA,IAAI,IAAIA,SAAO,CAAC,OAAA,KAAY,QAAQ,EAAE;AACtC,MAAM,IAAI;AACV,QAAQA,SAAO,CAAC,OAAA,GAAU,aAAa;AACvC,MAAM,EAAE,MAAM;AACd;AACA,QAAQ,MAAM,CAAC,cAAc,CAACA,SAAO,EAAE,SAAS,EAAE;AAClD,UAAU,KAAK,EAAE,aAAa;AAC9B,UAAU,QAAQ,EAAE,IAAI;AACxB,UAAU,YAAY,EAAE,IAAI;AAC5B,UAAU,UAAU,EAAE,IAAI;AAC1B,SAAS,CAAC;AACV,MAAM;AACN,IAAI;AACJ,IAAI,OAAOA,SAAO;AAClB,EAAE;AACF;;;;"}
1
+ {"version":3,"file":"instrumentation.js","sources":["../../../../../src/integrations/tracing/openai/instrumentation.ts"],"sourcesContent":["import {\n InstrumentationBase,\n type InstrumentationConfig,\n type InstrumentationModuleDefinition,\n InstrumentationNodeModuleDefinition,\n} from '@opentelemetry/instrumentation';\nimport type { Integration, OpenAiClient, OpenAiOptions } from '@sentry/core';\nimport {\n _INTERNAL_shouldSkipAiProviderWrapping,\n instrumentOpenAiClient,\n OPENAI_INTEGRATION_NAME,\n SDK_VERSION,\n} from '@sentry/core';\n\nconst supportedVersions = ['>=4.0.0 <7'];\n\nexport interface OpenAiIntegration extends Integration {\n options: OpenAiOptions;\n}\n\ntype OpenAiInstrumentationOptions = InstrumentationConfig & OpenAiOptions;\n\n/**\n * Represents the patched shape of the OpenAI module export.\n */\ninterface PatchedModuleExports {\n [key: string]: unknown;\n OpenAI: abstract new (...args: unknown[]) => OpenAiClient;\n AzureOpenAI?: abstract new (...args: unknown[]) => OpenAiClient;\n}\n\n/**\n * Sentry OpenAI instrumentation using OpenTelemetry.\n */\nexport class SentryOpenAiInstrumentation extends InstrumentationBase<OpenAiInstrumentationOptions> {\n public constructor(config: OpenAiInstrumentationOptions = {}) {\n super('@sentry/instrumentation-openai', SDK_VERSION, config);\n }\n\n /**\n * Initializes the instrumentation by defining the modules to be patched.\n */\n public init(): InstrumentationModuleDefinition {\n const module = new InstrumentationNodeModuleDefinition('openai', supportedVersions, this._patch.bind(this));\n return module;\n }\n\n /**\n * Core patch logic applying instrumentation to the OpenAI and AzureOpenAI client constructors.\n */\n private _patch(exports: PatchedModuleExports): PatchedModuleExports | void {\n let result = exports;\n result = this._patchClient(result, 'OpenAI');\n result = this._patchClient(result, 'AzureOpenAI');\n return result;\n }\n\n /**\n * Patch logic applying instrumentation to the specified client constructor.\n */\n private _patchClient(exports: PatchedModuleExports, exportKey: 'OpenAI' | 'AzureOpenAI'): PatchedModuleExports {\n const Original = exports[exportKey];\n if (!Original) {\n return exports;\n }\n\n const config = this.getConfig();\n\n const WrappedOpenAI = function (this: unknown, ...args: unknown[]) {\n // Check if wrapping should be skipped (e.g., when LangChain is handling instrumentation)\n if (_INTERNAL_shouldSkipAiProviderWrapping(OPENAI_INTEGRATION_NAME)) {\n return Reflect.construct(Original, args) as OpenAiClient;\n }\n\n const instance = Reflect.construct(Original, args);\n\n return instrumentOpenAiClient(instance as OpenAiClient, config);\n } as unknown as abstract new (...args: unknown[]) => OpenAiClient;\n\n // Preserve static and prototype chains\n Object.setPrototypeOf(WrappedOpenAI, Original);\n Object.setPrototypeOf(WrappedOpenAI.prototype, Original.prototype);\n\n for (const key of Object.getOwnPropertyNames(Original)) {\n if (!['length', 'name', 'prototype'].includes(key)) {\n const descriptor = Object.getOwnPropertyDescriptor(Original, key);\n if (descriptor) {\n Object.defineProperty(WrappedOpenAI, key, descriptor);\n }\n }\n }\n\n // Constructor replacement - handle read-only properties\n // The OpenAI property might have only a getter, so use defineProperty\n try {\n exports[exportKey] = WrappedOpenAI;\n } catch {\n // If direct assignment fails, override the property descriptor\n Object.defineProperty(exports, exportKey, {\n value: WrappedOpenAI,\n writable: true,\n configurable: true,\n enumerable: true,\n });\n }\n\n // Wrap the default export if it points to the original constructor\n // Constructor replacement - handle read-only properties\n // The OpenAI property might have only a getter, so use defineProperty\n if (exports.default === Original) {\n try {\n exports.default = WrappedOpenAI;\n } catch {\n // If direct assignment fails, override the property descriptor\n Object.defineProperty(exports, 'default', {\n value: WrappedOpenAI,\n writable: true,\n configurable: true,\n enumerable: true,\n });\n }\n }\n return exports;\n }\n}\n"],"names":["InstrumentationBase","SDK_VERSION","InstrumentationNodeModuleDefinition","_INTERNAL_shouldSkipAiProviderWrapping","OPENAI_INTEGRATION_NAME","instrumentOpenAiClient"],"mappings":";;;;;AAcA,MAAM,iBAAA,GAAoB,CAAC,YAAY,CAAA;AAoBhC,MAAM,oCAAoCA,mCAAA,CAAkD;AAAA,EAC1F,WAAA,CAAY,MAAA,GAAuC,EAAC,EAAG;AAC5D,IAAA,KAAA,CAAM,gCAAA,EAAkCC,kBAAa,MAAM,CAAA;AAAA,EAC7D;AAAA;AAAA;AAAA;AAAA,EAKO,IAAA,GAAwC;AAC7C,IAAA,MAAM,MAAA,GAAS,IAAIC,mDAAA,CAAoC,QAAA,EAAU,mBAAmB,IAAA,CAAK,MAAA,CAAO,IAAA,CAAK,IAAI,CAAC,CAAA;AAC1G,IAAA,OAAO,MAAA;AAAA,EACT;AAAA;AAAA;AAAA;AAAA,EAKQ,OAAO,OAAA,EAA4D;AACzE,IAAA,IAAI,MAAA,GAAS,OAAA;AACb,IAAA,MAAA,GAAS,IAAA,CAAK,YAAA,CAAa,MAAA,EAAQ,QAAQ,CAAA;AAC3C,IAAA,MAAA,GAAS,IAAA,CAAK,YAAA,CAAa,MAAA,EAAQ,aAAa,CAAA;AAChD,IAAA,OAAO,MAAA;AAAA,EACT;AAAA;AAAA;AAAA;AAAA,EAKQ,YAAA,CAAa,SAA+B,SAAA,EAA2D;AAC7G,IAAA,MAAM,QAAA,GAAW,QAAQ,SAAS,CAAA;AAClC,IAAA,IAAI,CAAC,QAAA,EAAU;AACb,MAAA,OAAO,O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IACH;AAKA,IAAA,IAAI,OAAA,CAAQ,YAAY,QAAA,EAAU;AAChC,MAAA,IAAI;AACF,QAAA,OAAA,CAAQ,OAAA,GAAU,aAAA;AAAA,MACpB,CAAA,CAAA,MAAQ;AAEN,QAAA,MAAA,CAAO,cAAA,CAAe,SAAS,SAAA,EAAW;AAAA,UACxC,KAAA,EAAO,aAAA;AAAA,UACP,QAAA,EAAU,IAAA;AAAA,UACV,YAAA,EAAc,IAAA;AAAA,UACd,UAAA,EAAY;AAAA,SACb,CAAA;AAAA,MACH;AAAA,IACF;AACA,IAAA,OAAO,OAAA;AAAA,EACT;AACF;;;;"}
@@ -0,0 +1,27 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const instrumentation = require('./vendored/instrumentation.js');
4
+ const core = require('@sentry/core');
5
+ const nodeCore = require('@sentry/node-core');
6
+
7
+ const INTEGRATION_NAME = "Postgres";
8
+ const instrumentPostgres = nodeCore.generateInstrumentOnce(
9
+ INTEGRATION_NAME,
10
+ instrumentation.PgInstrumentation,
11
+ (options) => ({
12
+ ignoreConnectSpans: options?.ignoreConnectSpans ?? false
13
+ })
14
+ );
15
+ const _postgresIntegration = ((options) => {
16
+ return {
17
+ name: INTEGRATION_NAME,
18
+ setupOnce() {
19
+ instrumentPostgres(options);
20
+ }
21
+ };
22
+ });
23
+ const postgresIntegration = core.defineIntegration(_postgresIntegration);
24
+
25
+ exports.instrumentPostgres = instrumentPostgres;
26
+ exports.postgresIntegration = postgresIntegration;
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/postgres/index.ts"],"sourcesContent":["import { PgInstrumentation } from './vendored/instrumentation';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { generateInstrumentOnce } from '@sentry/node-core';\n\ninterface PostgresIntegrationOptions {\n ignoreConnectSpans?: boolean;\n}\n\nconst INTEGRATION_NAME = 'Postgres' as const;\n\nexport const instrumentPostgres = generateInstrumentOnce(\n INTEGRATION_NAME,\n PgInstrumentation,\n (options?: PostgresIntegrationOptions) => ({\n ignoreConnectSpans: options?.ignoreConnectSpans ?? false,\n }),\n);\n\nconst _postgresIntegration = ((options?: PostgresIntegrationOptions) => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentPostgres(options);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [pg](https://www.npmjs.com/package/pg) library.\n *\n * For more information, see the [`postgresIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/postgres/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.postgresIntegration()],\n * });\n * ```\n */\nexport const postgresIntegration = defineIntegration(_postgresIntegration);\n"],"names":["generateInstrumentOnce","PgInstrumentation","defineIntegration"],"mappings":";;;;;;AASA,MAAM,gBAAA,GAAmB,UAAA;AAElB,MAAM,kBAAA,GAAqBA,+BAAA;AAAA,EAChC,gBAAA;AAAA,EACAC,iCAAA;AAAA,EACA,CAAC,OAAA,MAA0C;AAAA,IACzC,kBAAA,EAAoB,SAAS,kBAAA,IAAsB;AAAA,GACrD;AACF;AAEA,MAAM,oBAAA,IAAwB,CAAC,OAAA,KAAyC;AACtE,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AACV,MAAA,kBAAA,CAAmB,OAAO,CAAA;AAAA,IAC5B;AAAA,GACF;AACF,CAAA,CAAA;AAgBO,MAAM,mBAAA,GAAsBC,uBAAkB,oBAAoB;;;;;"}
@@ -0,0 +1,11 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ var AttributeNames = /* @__PURE__ */ ((AttributeNames2) => {
4
+ AttributeNames2["PG_PLAN"] = "db.postgresql.plan";
5
+ AttributeNames2["IDLE_TIMEOUT_MILLIS"] = "db.postgresql.idle.timeout.millis";
6
+ AttributeNames2["MAX_CLIENT"] = "db.postgresql.max.client";
7
+ return AttributeNames2;
8
+ })(AttributeNames || {});
9
+
10
+ exports.AttributeNames = AttributeNames;
11
+ //# sourceMappingURL=AttributeNames.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AttributeNames.js","sources":["../../../../../../../src/integrations/tracing/postgres/vendored/enums/AttributeNames.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-pg\n * - Upstream version: @opentelemetry/instrumentation-pg@0.70.0\n */\n\n// Postgresql specific attributes not covered by semantic conventions\nexport enum AttributeNames {\n PG_PLAN = 'db.postgresql.plan',\n IDLE_TIMEOUT_MILLIS = 'db.postgresql.idle.timeout.millis',\n MAX_CLIENT = 'db.postgresql.max.client',\n}\n"],"names":["AttributeNames"],"mappings":";;AAUO,IAAK,cAAA,qBAAAA,eAAAA,KAAL;AACL,EAAAA,gBAAA,SAAA,CAAA,GAAU,oBAAA;AACV,EAAAA,gBAAA,qBAAA,CAAA,GAAsB,mCAAA;AACtB,EAAAA,gBAAA,YAAA,CAAA,GAAa,0BAAA;AAHH,EAAA,OAAAA,eAAAA;AAAA,CAAA,EAAA,cAAA,IAAA,EAAA;;;;"}
@@ -0,0 +1,11 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ var SpanNames = /* @__PURE__ */ ((SpanNames2) => {
4
+ SpanNames2["QUERY_PREFIX"] = "pg.query";
5
+ SpanNames2["CONNECT"] = "pg.connect";
6
+ SpanNames2["POOL_CONNECT"] = "pg-pool.connect";
7
+ return SpanNames2;
8
+ })(SpanNames || {});
9
+
10
+ exports.SpanNames = SpanNames;
11
+ //# sourceMappingURL=SpanNames.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SpanNames.js","sources":["../../../../../../../src/integrations/tracing/postgres/vendored/enums/SpanNames.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-pg\n * - Upstream version: @opentelemetry/instrumentation-pg@0.70.0\n */\n\n// Contains span names produced by instrumentation\nexport enum SpanNames {\n QUERY_PREFIX = 'pg.query',\n CONNECT = 'pg.connect',\n POOL_CONNECT = 'pg-pool.connect',\n}\n"],"names":["SpanNames"],"mappings":";;AAUO,IAAK,SAAA,qBAAAA,UAAAA,KAAL;AACL,EAAAA,WAAA,cAAA,CAAA,GAAe,UAAA;AACf,EAAAA,WAAA,SAAA,CAAA,GAAU,YAAA;AACV,EAAAA,WAAA,cAAA,CAAA,GAAe,iBAAA;AAHL,EAAA,OAAAA,UAAAA;AAAA,CAAA,EAAA,SAAA,IAAA,EAAA;;;;"}
@@ -0,0 +1,225 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const instrumentation = require('@opentelemetry/instrumentation');
4
+ const core = require('@sentry/core');
5
+ const InstrumentationNodeModuleFile = require('../../InstrumentationNodeModuleFile.js');
6
+ const SpanNames = require('./enums/SpanNames.js');
7
+ const utils = require('./utils.js');
8
+
9
+ const PACKAGE_NAME = "@sentry/instrumentation-pg";
10
+ function extractModuleExports(module) {
11
+ return module[Symbol.toStringTag] === "Module" ? module.default : module;
12
+ }
13
+ function bindCallbackToSpan(parentSpan, callback) {
14
+ return function(...args) {
15
+ return core.withActiveSpan(parentSpan, () => callback.apply(this, args));
16
+ };
17
+ }
18
+ class PgInstrumentation extends instrumentation.InstrumentationBase {
19
+ constructor(config = {}) {
20
+ super(PACKAGE_NAME, core.SDK_VERSION, config);
21
+ }
22
+ init() {
23
+ const SUPPORTED_PG_VERSIONS = [">=8.0.3 <9"];
24
+ const SUPPORTED_PG_POOL_VERSIONS = [">=2.0.0 <4"];
25
+ const modulePgNativeClient = new InstrumentationNodeModuleFile.InstrumentationNodeModuleFile(
26
+ "pg/lib/native/client.js",
27
+ SUPPORTED_PG_VERSIONS,
28
+ this._patchPgClient.bind(this),
29
+ this._unpatchPgClient.bind(this)
30
+ );
31
+ const modulePgClient = new InstrumentationNodeModuleFile.InstrumentationNodeModuleFile(
32
+ "pg/lib/client.js",
33
+ SUPPORTED_PG_VERSIONS,
34
+ this._patchPgClient.bind(this),
35
+ this._unpatchPgClient.bind(this)
36
+ );
37
+ const modulePG = new instrumentation.InstrumentationNodeModuleDefinition(
38
+ "pg",
39
+ SUPPORTED_PG_VERSIONS,
40
+ (module) => {
41
+ const moduleExports = extractModuleExports(module);
42
+ this._patchPgClient(moduleExports.Client);
43
+ return module;
44
+ },
45
+ (module) => {
46
+ const moduleExports = extractModuleExports(module);
47
+ this._unpatchPgClient(moduleExports.Client);
48
+ return module;
49
+ },
50
+ [modulePgClient, modulePgNativeClient]
51
+ );
52
+ const modulePGPool = new instrumentation.InstrumentationNodeModuleDefinition(
53
+ "pg-pool",
54
+ SUPPORTED_PG_POOL_VERSIONS,
55
+ (module) => {
56
+ const moduleExports = extractModuleExports(module);
57
+ if (instrumentation.isWrapped(moduleExports.prototype.connect)) {
58
+ this._unwrap(moduleExports.prototype, "connect");
59
+ }
60
+ this._wrap(moduleExports.prototype, "connect", this._getPoolConnectPatch());
61
+ return moduleExports;
62
+ },
63
+ (module) => {
64
+ const moduleExports = extractModuleExports(module);
65
+ if (instrumentation.isWrapped(moduleExports.prototype.connect)) {
66
+ this._unwrap(moduleExports.prototype, "connect");
67
+ }
68
+ }
69
+ );
70
+ return [modulePG, modulePGPool];
71
+ }
72
+ _patchPgClient(module) {
73
+ if (!module) {
74
+ return;
75
+ }
76
+ const moduleExports = extractModuleExports(module);
77
+ if (instrumentation.isWrapped(moduleExports.prototype.query)) {
78
+ this._unwrap(moduleExports.prototype, "query");
79
+ }
80
+ if (instrumentation.isWrapped(moduleExports.prototype.connect)) {
81
+ this._unwrap(moduleExports.prototype, "connect");
82
+ }
83
+ this._wrap(moduleExports.prototype, "query", this._getClientQueryPatch());
84
+ this._wrap(moduleExports.prototype, "connect", this._getClientConnectPatch());
85
+ return module;
86
+ }
87
+ _unpatchPgClient(module) {
88
+ const moduleExports = extractModuleExports(module);
89
+ if (instrumentation.isWrapped(moduleExports.prototype.query)) {
90
+ this._unwrap(moduleExports.prototype, "query");
91
+ }
92
+ if (instrumentation.isWrapped(moduleExports.prototype.connect)) {
93
+ this._unwrap(moduleExports.prototype, "connect");
94
+ }
95
+ return module;
96
+ }
97
+ _getClientConnectPatch() {
98
+ const plugin = this;
99
+ return (original) => {
100
+ return function connect(callback) {
101
+ if (utils.shouldSkipInstrumentation() || plugin.getConfig().ignoreConnectSpans) {
102
+ return original.call(this, callback);
103
+ }
104
+ const span = core.startInactiveSpan({
105
+ name: SpanNames.SpanNames.CONNECT,
106
+ kind: core.SPAN_KIND.CLIENT,
107
+ attributes: utils.getSemanticAttributesFromConnection(this)
108
+ });
109
+ let cb = callback;
110
+ if (cb) {
111
+ const parentSpan = core.getActiveSpan();
112
+ cb = utils.patchClientConnectCallback(span, cb);
113
+ if (parentSpan) {
114
+ cb = bindCallbackToSpan(parentSpan, cb);
115
+ }
116
+ }
117
+ const connectResult = core.withActiveSpan(span, () => {
118
+ return original.call(this, cb);
119
+ });
120
+ return handleConnectResult(span, connectResult);
121
+ };
122
+ };
123
+ }
124
+ _getClientQueryPatch() {
125
+ return (original) => {
126
+ this._diag.debug("Patching pg.Client.prototype.query");
127
+ return function query(...args) {
128
+ if (utils.shouldSkipInstrumentation()) {
129
+ return original.apply(this, args);
130
+ }
131
+ const arg0 = args[0];
132
+ const firstArgIsString = typeof arg0 === "string";
133
+ const firstArgIsQueryObjectWithText = utils.isObjectWithTextString(arg0);
134
+ const queryConfig = firstArgIsString ? {
135
+ text: arg0,
136
+ values: Array.isArray(args[1]) ? args[1] : void 0
137
+ } : firstArgIsQueryObjectWithText ? {
138
+ ...arg0,
139
+ name: arg0.name,
140
+ text: arg0.text,
141
+ values: arg0.values ?? (Array.isArray(args[1]) ? args[1] : void 0)
142
+ } : void 0;
143
+ const span = utils.handleConfigQuery.call(this, queryConfig);
144
+ if (args.length > 0) {
145
+ const parentSpan = core.getActiveSpan();
146
+ if (typeof args[args.length - 1] === "function") {
147
+ args[args.length - 1] = utils.patchCallback(span, args[args.length - 1]);
148
+ if (parentSpan) {
149
+ args[args.length - 1] = bindCallbackToSpan(parentSpan, args[args.length - 1]);
150
+ }
151
+ } else if (typeof queryConfig?.callback === "function") {
152
+ let callback = utils.patchCallback(span, queryConfig.callback);
153
+ if (parentSpan) {
154
+ callback = bindCallbackToSpan(parentSpan, callback);
155
+ }
156
+ args[0].callback = callback;
157
+ }
158
+ }
159
+ let result;
160
+ try {
161
+ result = original.apply(this, args);
162
+ } catch (e) {
163
+ span.setStatus({ code: core.SPAN_STATUS_ERROR, message: utils.getErrorMessage(e) });
164
+ span.end();
165
+ throw e;
166
+ }
167
+ if (result instanceof Promise) {
168
+ return result.then((result2) => {
169
+ span.end();
170
+ return result2;
171
+ }).catch((error) => {
172
+ span.setStatus({ code: core.SPAN_STATUS_ERROR, message: utils.getErrorMessage(error) });
173
+ span.end();
174
+ return Promise.reject(error);
175
+ });
176
+ }
177
+ return result;
178
+ };
179
+ };
180
+ }
181
+ _getPoolConnectPatch() {
182
+ const plugin = this;
183
+ return (originalConnect) => {
184
+ return function connect(callback) {
185
+ if (utils.shouldSkipInstrumentation() || plugin.getConfig().ignoreConnectSpans) {
186
+ return originalConnect.call(this, callback);
187
+ }
188
+ const span = core.startInactiveSpan({
189
+ name: SpanNames.SpanNames.POOL_CONNECT,
190
+ kind: core.SPAN_KIND.CLIENT,
191
+ attributes: utils.getSemanticAttributesFromPoolConnection(this.options)
192
+ });
193
+ let cb = callback;
194
+ if (cb) {
195
+ const parentSpan = core.getActiveSpan();
196
+ cb = utils.patchCallbackPGPool(span, cb);
197
+ if (parentSpan) {
198
+ cb = bindCallbackToSpan(parentSpan, cb);
199
+ }
200
+ }
201
+ const connectResult = core.withActiveSpan(span, () => {
202
+ return originalConnect.call(this, cb);
203
+ });
204
+ return handleConnectResult(span, connectResult);
205
+ };
206
+ };
207
+ }
208
+ }
209
+ function handleConnectResult(span, connectResult) {
210
+ if (!(connectResult instanceof Promise)) {
211
+ return connectResult;
212
+ }
213
+ const connectResultPromise = connectResult;
214
+ return connectResultPromise.then((result) => {
215
+ span.end();
216
+ return result;
217
+ }).catch((error) => {
218
+ span.setStatus({ code: core.SPAN_STATUS_ERROR, message: utils.getErrorMessage(error) });
219
+ span.end();
220
+ return Promise.reject(error);
221
+ });
222
+ }
223
+
224
+ exports.PgInstrumentation = PgInstrumentation;
225
+ //# sourceMappingURL=instrumentation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instrumentation.js","sources":["../../../../../../src/integrations/tracing/postgres/vendored/instrumentation.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-pg\n * - Upstream version: @opentelemetry/instrumentation-pg@0.70.0\n * - Types from `pg` and `pg-pool` packages inlined as simplified interfaces\n * - Refactored to use Sentry's span APIs instead of OpenTelemetry tracing APIs\n * - Dropped the OTel metrics (no MeterProvider is wired up), the `SemconvStability`\n * dual-emission, and config the SDK never passes (request/response hooks,\n * enhancedDatabaseReporting, addSqlCommenterCommentToQueries)\n */\n\nimport { InstrumentationBase, InstrumentationNodeModuleDefinition, isWrapped } from '@opentelemetry/instrumentation';\nimport type { Span } from '@sentry/core';\nimport {\n getActiveSpan,\n SDK_VERSION,\n SPAN_KIND,\n SPAN_STATUS_ERROR,\n startInactiveSpan,\n withActiveSpan,\n} from '@sentry/core';\nimport { InstrumentationNodeModuleFile } from '../../InstrumentationNodeModuleFile';\nimport { SpanNames } from './enums/SpanNames';\nimport type {\n PgClientConnect,\n PgClientExtended,\n PgPoolCallback,\n PgPoolExtended,\n PostgresCallback,\n} from './internal-types';\nimport type { PgInstrumentationConfig } from './types';\nimport * as utils from './utils';\n\nconst PACKAGE_NAME = '@sentry/instrumentation-pg';\n\nfunction extractModuleExports(module: any): any {\n return module[Symbol.toStringTag] === 'Module'\n ? module.default // ESM\n : module; // CommonJS\n}\n\n/**\n * Binds `callback` to `parentSpan`, so that the span is active again whenever the\n * (deferred) callback runs. This mirrors the upstream `context.bind(context.active(), callback)`:\n * `pg` invokes callbacks outside of the original async scope (e.g. for pooled connections), so we\n * re-establish the trace context to keep spans created inside the callback correctly parented.\n */\nfunction bindCallbackToSpan<T extends (...args: any[]) => any>(parentSpan: Span, callback: T): T {\n return function (this: unknown, ...args: any[]): unknown {\n return withActiveSpan(parentSpan, () => callback.apply(this, args));\n } as T;\n}\n\nexport class PgInstrumentation extends InstrumentationBase<PgInstrumentationConfig> {\n public constructor(config: PgInstrumentationConfig = {}) {\n super(PACKAGE_NAME, SDK_VERSION, config);\n }\n\n protected init(): InstrumentationNodeModuleDefinition[] {\n const SUPPORTED_PG_VERSIONS = ['>=8.0.3 <9'];\n const SUPPORTED_PG_POOL_VERSIONS = ['>=2.0.0 <4'];\n\n const modulePgNativeClient = new InstrumentationNodeModuleFile(\n 'pg/lib/native/client.js',\n SUPPORTED_PG_VERSIONS,\n this._patchPgClient.bind(this),\n this._unpatchPgClient.bind(this),\n );\n\n const modulePgClient = new InstrumentationNodeModuleFile(\n 'pg/lib/client.js',\n SUPPORTED_PG_VERSIONS,\n this._patchPgClient.bind(this),\n this._unpatchPgClient.bind(this),\n );\n\n const modulePG = new InstrumentationNodeModuleDefinition(\n 'pg',\n SUPPORTED_PG_VERSIONS,\n (module: any) => {\n const moduleExports = extractModuleExports(module);\n\n this._patchPgClient(moduleExports.Client);\n return module;\n },\n (module: any) => {\n const moduleExports = extractModuleExports(module);\n\n this._unpatchPgClient(moduleExports.Client);\n return module;\n },\n [modulePgClient, modulePgNativeClient],\n );\n\n const modulePGPool = new InstrumentationNodeModuleDefinition(\n 'pg-pool',\n SUPPORTED_PG_POOL_VERSIONS,\n (module: any) => {\n const moduleExports = extractModuleExports(module);\n if (isWrapped(moduleExports.prototype.connect)) {\n this._unwrap(moduleExports.prototype, 'connect');\n }\n this._wrap(moduleExports.prototype, 'connect', this._getPoolConnectPatch());\n return moduleExports;\n },\n (module: any) => {\n const moduleExports = extractModuleExports(module);\n if (isWrapped(moduleExports.prototype.connect)) {\n this._unwrap(moduleExports.prototype, 'connect');\n }\n },\n );\n\n return [modulePG, modulePGPool];\n }\n\n private _patchPgClient(module: any): any {\n if (!module) {\n return;\n }\n\n const moduleExports = extractModuleExports(module);\n\n if (isWrapped(moduleExports.prototype.query)) {\n this._unwrap(moduleExports.prototype, 'query');\n }\n\n if (isWrapped(moduleExports.prototype.connect)) {\n this._unwrap(moduleExports.prototype, 'connect');\n }\n\n this._wrap(moduleExports.prototype, 'query', this._getClientQueryPatch());\n\n this._wrap(moduleExports.prototype, 'connect', this._getClientConnectPatch());\n\n return module;\n }\n\n private _unpatchPgClient(module: any): any {\n const moduleExports = extractModuleExports(module);\n\n if (isWrapped(moduleExports.prototype.query)) {\n this._unwrap(moduleExports.prototype, 'query');\n }\n\n if (isWrapped(moduleExports.prototype.connect)) {\n this._unwrap(moduleExports.prototype, 'connect');\n }\n\n return module;\n }\n\n private _getClientConnectPatch() {\n const plugin = this;\n return (original: PgClientConnect) => {\n return function connect(this: PgClientExtended, callback?: (...args: unknown[]) => void) {\n if (utils.shouldSkipInstrumentation() || plugin.getConfig().ignoreConnectSpans) {\n return original.call(this, callback);\n }\n\n const span = startInactiveSpan({\n name: SpanNames.CONNECT,\n kind: SPAN_KIND.CLIENT,\n attributes: utils.getSemanticAttributesFromConnection(this),\n });\n\n let cb = callback;\n if (cb) {\n const parentSpan = getActiveSpan();\n cb = utils.patchClientConnectCallback(span, cb);\n if (parentSpan) {\n cb = bindCallbackToSpan(parentSpan, cb);\n }\n }\n\n const connectResult: unknown = withActiveSpan(span, () => {\n return original.call(this, cb);\n });\n\n return handleConnectResult(span, connectResult);\n };\n };\n }\n\n private _getClientQueryPatch() {\n return (original: (...args: any[]) => any) => {\n this._diag.debug('Patching pg.Client.prototype.query');\n return function query(this: PgClientExtended, ...args: unknown[]) {\n if (utils.shouldSkipInstrumentation()) {\n return original.apply(this, args as never);\n }\n\n // client.query(text, cb?), client.query(text, values, cb?), and\n // client.query(configObj, cb?) are all valid signatures. We construct\n // a queryConfig obj from all (valid) signatures to build the span in a\n // unified way. We verify that we at least have query text, and code\n // defensively when dealing with `queryConfig` after that (to handle all\n // the other invalid cases, like a non-array for values being provided).\n // The type casts here reflect only what we've actually validated.\n const arg0 = args[0];\n const firstArgIsString = typeof arg0 === 'string';\n const firstArgIsQueryObjectWithText = utils.isObjectWithTextString(arg0);\n\n const queryConfig = firstArgIsString\n ? {\n text: arg0,\n values: Array.isArray(args[1]) ? args[1] : undefined,\n }\n : firstArgIsQueryObjectWithText\n ? {\n ...(arg0 as any),\n name: arg0.name,\n text: arg0.text,\n values: (arg0 as any).values ?? (Array.isArray(args[1]) ? args[1] : undefined),\n }\n : undefined;\n\n const span = utils.handleConfigQuery.call(this, queryConfig);\n\n // Bind callback (if any) to parent span (if any)\n if (args.length > 0) {\n const parentSpan = getActiveSpan();\n if (typeof args[args.length - 1] === 'function') {\n // Patch ParameterQuery callback\n args[args.length - 1] = utils.patchCallback(span, args[args.length - 1] as PostgresCallback);\n\n // If a parent span exists, bind the callback\n if (parentSpan) {\n args[args.length - 1] = bindCallbackToSpan(parentSpan, args[args.length - 1] as PostgresCallback);\n }\n } else if (typeof queryConfig?.callback === 'function') {\n // Patch ConfigQuery callback\n let callback = utils.patchCallback(span, queryConfig.callback as PostgresCallback);\n\n // If a parent span existed, bind the callback\n if (parentSpan) {\n callback = bindCallbackToSpan(parentSpan, callback);\n }\n\n (args[0] as { callback?: PostgresCallback }).callback = callback;\n }\n }\n\n let result: unknown;\n try {\n result = original.apply(this, args as never);\n } catch (e: unknown) {\n span.setStatus({ code: SPAN_STATUS_ERROR, message: utils.getErrorMessage(e) });\n span.end();\n throw e;\n }\n\n // Bind promise to parent span and end the span\n if (result instanceof Promise) {\n return result\n .then((result: unknown) => {\n span.end();\n return result;\n })\n .catch((error: unknown) => {\n span.setStatus({ code: SPAN_STATUS_ERROR, message: utils.getErrorMessage(error) });\n span.end();\n return Promise.reject(error);\n });\n }\n\n // else returns void\n return result; // void\n };\n };\n }\n\n private _getPoolConnectPatch() {\n const plugin = this;\n return (originalConnect: (...args: any[]) => any) => {\n return function connect(this: PgPoolExtended, callback?: PgPoolCallback) {\n if (utils.shouldSkipInstrumentation() || plugin.getConfig().ignoreConnectSpans) {\n return originalConnect.call(this, callback);\n }\n\n const span = startInactiveSpan({\n name: SpanNames.POOL_CONNECT,\n kind: SPAN_KIND.CLIENT,\n attributes: utils.getSemanticAttributesFromPoolConnection(this.options),\n });\n\n let cb = callback;\n if (cb) {\n const parentSpan = getActiveSpan();\n cb = utils.patchCallbackPGPool(span, cb);\n // If a parent span exists, bind the callback\n if (parentSpan) {\n cb = bindCallbackToSpan(parentSpan, cb);\n }\n }\n\n const connectResult: unknown = withActiveSpan(span, () => {\n return originalConnect.call(this, cb);\n });\n\n return handleConnectResult(span, connectResult);\n };\n };\n }\n}\n\nfunction handleConnectResult(span: Span, connectResult: unknown): unknown {\n if (!(connectResult instanceof Promise)) {\n return connectResult;\n }\n\n const connectResultPromise = connectResult as Promise<unknown>;\n // The caller's continuation after `await client.connect()` keeps its trace context via the\n // SDK's async context propagation, so we don't need to re-bind the returned promise.\n return connectResultPromise\n .then(result => {\n span.end();\n return result;\n })\n .catch((error: unknown) => {\n span.setStatus({ code: SPAN_STATUS_ERROR, message: utils.getErrorMessage(error) });\n span.end();\n return Promise.reject(error);\n });\n}\n"],"names":["withActiveSpan","InstrumentationBase","SDK_VERSION","InstrumentationNodeModuleFile","InstrumentationNodeModuleDefinition","isWrapped","utils.shouldSkipInstrumentation","startInactiveSpan","SpanNames","SPAN_KIND","utils.getSemanticAttributesFromConnection","getActiveSpan","utils.patchClientConnectCallback","utils.isObjectWithTextString","utils.handleConfigQuery","utils.patchCallback","SPAN_STATUS_ERROR","utils.getErrorMessage","result","utils.getSemanticAttributesFromPoolConnection","utils.patchCallbackPGPool"],"mappings":";;;;;;;;AAoCA,MAAM,YAAA,GAAe,4BAAA;AAErB,SAAS,qBAAqB,MAAA,EAAkB;AAC9C,EAAA,OAAO,OAAO,MAAA,CAAO,WAAW,CAAA,KAAM,QAAA,GAClC,OAAO,OAAA,GACP,MAAA;AACN;AAQA,SAAS,kBAAA,CAAsD,YAAkB,QAAA,EAAgB;AAC/F,EAAA,OAAO,YAA4B,IAAA,EAAsB;AACvD,IAAA,OAAOA,oBAAe,UAAA,EAAY,MAAM,SAAS,KAAA,CAAM,IAAA,EAAM,IAAI,CAAC,CAAA;AAAA,EACpE,CAAA;AACF;AAEO,MAAM,0BAA0BC,mCAAA,CAA6C;AAAA,EAC3E,WAAA,CAAY,MAAA,GAAkC,EAAC,EAAG;AACvD,IAAA,KAAA,CAAM,YAAA,EAAcC,kBAAa,MAAM,CAAA;AAAA,EACzC;AAAA,EAEU,IAAA,GAA8C;AACtD,IAAA,MAAM,qBAAA,GAAwB,CAAC,YAAY,CAAA;AAC3C,IAAA,MAAM,0BAAA,GAA6B,CAAC,YAAY,CAAA;AAEhD,IAAA,MAAM,uBAAuB,IAAIC,2DAAA;AAAA,MAC/B,yBAAA;AAAA,MACA,qBAAA;AAAA,MACA,IAAA,CAAK,cAAA,CAAe,IAAA,CAAK,IAAI,CAAA;AAAA,MAC7B,IAAA,CAAK,gBAAA,CAAiB,IAAA,CAAK,IAAI;AAAA,KACjC;AAEA,IAAA,MAAM,iBAAiB,IAAIA,2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AAAA,EACT;AAEA,EAAA,MAAM,oBAAA,GAAuB,aAAA;AAG7B,EAAA,OAAO,oBAAA,CACJ,KAAK,CAAA,MAAA,KAAU;AACd,IAAA,IAAA,CAAK,GAAA,EAAI;AACT,IAAA,OAAO,MAAA;AAAA,EACT,CAAC,CAAA,CACA,KAAA,CAAM,CAAC,KAAA,KAAmB;AACzB,IAAA,IAAA,CAAK,SAAA,CAAU,EAAE,IAAA,EAAMgB,sBAAA,EAAmB,SAASC,qBAAM,CAAgB,KAAK,CAAA,EAAG,CAAA;AACjF,IAAA,IAAA,CAAK,GAAA,EAAI;AACT,IAAA,OAAO,OAAA,CAAQ,OAAO,KAAK,CAAA;AAAA,EAC7B,CAAC,CAAA;AACL;;;;"}
@@ -0,0 +1,8 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const ATTR_DB_CONNECTION_STRING = "db.connection_string";
4
+ const DB_SYSTEM_VALUE_POSTGRESQL = "postgresql";
5
+
6
+ exports.ATTR_DB_CONNECTION_STRING = ATTR_DB_CONNECTION_STRING;
7
+ exports.DB_SYSTEM_VALUE_POSTGRESQL = DB_SYSTEM_VALUE_POSTGRESQL;
8
+ //# sourceMappingURL=semconv.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"semconv.js","sources":["../../../../../../src/integrations/tracing/postgres/vendored/semconv.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-pg\n * - Upstream version: @opentelemetry/instrumentation-pg@0.70.0\n * - Trimmed to the (old) semantic conventions the SDK actually emits\n */\n\n/*\n * This file contains a copy of unstable semantic convention definitions\n * used by this package.\n * @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv\n */\n\n/**\n * Deprecated, use `server.address`, `server.port` attributes instead.\n *\n * @example \"Server=(localdb)\\\\v11.0;Integrated Security=true;\"\n *\n * @deprecated Replaced by `server.address` and `server.port`.\n */\nexport const ATTR_DB_CONNECTION_STRING = 'db.connection_string' as const;\n\n/**\n * Enum value \"postgresql\" for attribute `db.system`.\n */\nexport const DB_SYSTEM_VALUE_POSTGRESQL = 'postgresql' as const;\n"],"names":[],"mappings":";;AAuBO,MAAM,yBAAA,GAA4B;AAKlC,MAAM,0BAAA,GAA6B;;;;;"}
@@ -0,0 +1,151 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const core = require('@sentry/core');
4
+ const AttributeNames = require('./enums/AttributeNames.js');
5
+ const SpanNames = require('./enums/SpanNames.js');
6
+ const semconv = require('./semconv.js');
7
+ const attributes = require('@sentry/conventions/attributes');
8
+
9
+ const ORIGIN = "auto.db.otel.postgres";
10
+ function getQuerySpanName(dbName, queryConfig) {
11
+ if (!queryConfig) return SpanNames.SpanNames.QUERY_PREFIX;
12
+ const command = typeof queryConfig.name === "string" && queryConfig.name ? queryConfig.name : parseNormalizedOperationName(queryConfig.text);
13
+ return `${SpanNames.SpanNames.QUERY_PREFIX}:${command}${dbName ? ` ${dbName}` : ""}`;
14
+ }
15
+ function parseNormalizedOperationName(queryText) {
16
+ const trimmedQuery = queryText.trim();
17
+ const indexOfFirstSpace = trimmedQuery.indexOf(" ");
18
+ let sqlCommand = indexOfFirstSpace === -1 ? trimmedQuery : trimmedQuery.slice(0, indexOfFirstSpace);
19
+ sqlCommand = sqlCommand.toUpperCase();
20
+ return sqlCommand.endsWith(";") ? sqlCommand.slice(0, -1) : sqlCommand;
21
+ }
22
+ function parseAndMaskConnectionString(connectionString) {
23
+ try {
24
+ const url = new URL(connectionString);
25
+ url.username = "";
26
+ url.password = "";
27
+ return url.toString();
28
+ } catch {
29
+ return "postgresql://localhost:5432/";
30
+ }
31
+ }
32
+ function getConnectionString(params) {
33
+ if ("connectionString" in params && params.connectionString) {
34
+ return parseAndMaskConnectionString(params.connectionString);
35
+ }
36
+ const host = params.host || "localhost";
37
+ const port = params.port || 5432;
38
+ const database = params.database || "";
39
+ return `postgresql://${host}:${port}/${database}`;
40
+ }
41
+ function getPort(port) {
42
+ if (Number.isInteger(port)) {
43
+ return port;
44
+ }
45
+ return void 0;
46
+ }
47
+ function getSemanticAttributesFromConnection(params) {
48
+ return {
49
+ [attributes.DB_SYSTEM]: semconv.DB_SYSTEM_VALUE_POSTGRESQL,
50
+ [attributes.DB_NAME]: params.database,
51
+ [semconv.ATTR_DB_CONNECTION_STRING]: getConnectionString(params),
52
+ [attributes.DB_USER]: params.user,
53
+ [attributes.NET_PEER_NAME]: params.host,
54
+ // required
55
+ [attributes.NET_PEER_PORT]: getPort(params.port)
56
+ };
57
+ }
58
+ function getSemanticAttributesFromPoolConnection(params) {
59
+ let url;
60
+ try {
61
+ url = params.connectionString ? new URL(params.connectionString) : void 0;
62
+ } catch {
63
+ url = void 0;
64
+ }
65
+ return {
66
+ [AttributeNames.AttributeNames.IDLE_TIMEOUT_MILLIS]: params.idleTimeoutMillis,
67
+ [AttributeNames.AttributeNames.MAX_CLIENT]: params.maxClient,
68
+ [attributes.DB_SYSTEM]: semconv.DB_SYSTEM_VALUE_POSTGRESQL,
69
+ [attributes.DB_NAME]: url?.pathname.slice(1) ?? params.database,
70
+ [semconv.ATTR_DB_CONNECTION_STRING]: getConnectionString(params),
71
+ [attributes.NET_PEER_NAME]: url?.hostname ?? params.host,
72
+ [attributes.NET_PEER_PORT]: Number(url?.port) || getPort(params.port),
73
+ [attributes.DB_USER]: url?.username ?? params.user
74
+ };
75
+ }
76
+ function shouldSkipInstrumentation() {
77
+ return core.getActiveSpan() === void 0;
78
+ }
79
+ function handleConfigQuery(queryConfig) {
80
+ const { connectionParameters } = this;
81
+ const dbName = connectionParameters.database;
82
+ const spanName = getQuerySpanName(dbName, queryConfig);
83
+ const span = core.startInactiveSpan({
84
+ name: spanName,
85
+ kind: core.SPAN_KIND.CLIENT,
86
+ attributes: {
87
+ ...getSemanticAttributesFromConnection(connectionParameters),
88
+ [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN
89
+ }
90
+ });
91
+ if (!queryConfig) {
92
+ return span;
93
+ }
94
+ if (queryConfig.text) {
95
+ span.setAttribute(attributes.DB_STATEMENT, queryConfig.text);
96
+ }
97
+ if (typeof queryConfig.name === "string") {
98
+ span.setAttribute(AttributeNames.AttributeNames.PG_PLAN, queryConfig.name);
99
+ }
100
+ return span;
101
+ }
102
+ function patchCallback(span, cb) {
103
+ return function patchedCallback(err, res) {
104
+ if (err) {
105
+ span.setStatus({ code: core.SPAN_STATUS_ERROR, message: err.message });
106
+ }
107
+ span.end();
108
+ cb.call(this, err, res);
109
+ };
110
+ }
111
+ function patchCallbackPGPool(span, cb) {
112
+ return function patchedCallback(err, res, done) {
113
+ if (err) {
114
+ span.setStatus({ code: core.SPAN_STATUS_ERROR, message: err.message });
115
+ }
116
+ span.end();
117
+ cb.call(this, err, res, done);
118
+ };
119
+ }
120
+ function patchClientConnectCallback(span, cb) {
121
+ return function patchedClientConnectCallback(...args) {
122
+ const err = args[0];
123
+ if (err instanceof Error) {
124
+ span.setStatus({ code: core.SPAN_STATUS_ERROR, message: err.message });
125
+ }
126
+ span.end();
127
+ cb.apply(this, args);
128
+ };
129
+ }
130
+ function getErrorMessage(e) {
131
+ return typeof e === "object" && e !== null && "message" in e ? String(e.message) : void 0;
132
+ }
133
+ function isObjectWithTextString(it) {
134
+ return typeof it === "object" && typeof it?.text === "string";
135
+ }
136
+
137
+ exports.ORIGIN = ORIGIN;
138
+ exports.getConnectionString = getConnectionString;
139
+ exports.getErrorMessage = getErrorMessage;
140
+ exports.getQuerySpanName = getQuerySpanName;
141
+ exports.getSemanticAttributesFromConnection = getSemanticAttributesFromConnection;
142
+ exports.getSemanticAttributesFromPoolConnection = getSemanticAttributesFromPoolConnection;
143
+ exports.handleConfigQuery = handleConfigQuery;
144
+ exports.isObjectWithTextString = isObjectWithTextString;
145
+ exports.parseAndMaskConnectionString = parseAndMaskConnectionString;
146
+ exports.parseNormalizedOperationName = parseNormalizedOperationName;
147
+ exports.patchCallback = patchCallback;
148
+ exports.patchCallbackPGPool = patchCallbackPGPool;
149
+ exports.patchClientConnectCallback = patchClientConnectCallback;
150
+ exports.shouldSkipInstrumentation = shouldSkipInstrumentation;
151
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sources":["../../../../../../src/integrations/tracing/postgres/vendored/utils.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-pg\n * - Upstream version: @opentelemetry/instrumentation-pg@0.70.0\n * - Types from `pg` package inlined as simplified interfaces\n * - Refactored to use Sentry's span APIs instead of OpenTelemetry tracing APIs\n */\n\nimport type { Span, SpanAttributes } from '@sentry/core';\nimport {\n getActiveSpan,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SPAN_KIND,\n SPAN_STATUS_ERROR,\n startInactiveSpan,\n} from '@sentry/core';\nimport { AttributeNames } from './enums/AttributeNames';\nimport { SpanNames } from './enums/SpanNames';\nimport type {\n PgClientExtended,\n PgParsedConnectionParams,\n PgPoolCallback,\n PgPoolExtended,\n PgPoolOptionsParams,\n PostgresCallback,\n} from './internal-types';\nimport type { PgClient } from './pg-types';\nimport { ATTR_DB_CONNECTION_STRING, DB_SYSTEM_VALUE_POSTGRESQL } from './semconv';\nimport {\n DB_NAME,\n DB_STATEMENT,\n DB_SYSTEM,\n DB_USER,\n NET_PEER_NAME,\n NET_PEER_PORT,\n} from '@sentry/conventions/attributes';\n\n/* oxlint-disable typescript/no-deprecated */\n\nexport const ORIGIN = 'auto.db.otel.postgres';\n\n/**\n * Helper function to get a low cardinality span name from whatever info we have\n * about the query.\n *\n * This is tricky, because we don't have most of the information (table name,\n * operation name, etc) the spec recommends using to build a low-cardinality\n * value w/o parsing. So, we use db.name and assume that, if the query's a named\n * prepared statement, those `name` values will be low cardinality. If we don't\n * have a named prepared statement, we try to parse an operation (despite the\n * spec's warnings).\n *\n * @params dbName The name of the db against which this query is being issued,\n * which could be missing if no db name was given at the time that the\n * connection was established.\n * @params queryConfig Information we have about the query being issued, typed\n * to reflect only the validation we've actually done on the args to\n * `client.query()`. This will be undefined if `client.query()` was called\n * with invalid arguments.\n */\nexport function getQuerySpanName(dbName: string | undefined, queryConfig?: { text: string; name?: unknown }): string {\n // NB: when the query config is invalid, we omit the dbName too, so that\n // someone (or some tool) reading the span name doesn't misinterpret the\n // dbName as being a prepared statement or sql commit name.\n if (!queryConfig) return SpanNames.QUERY_PREFIX;\n\n // Either the name of a prepared statement; or an attempted parse\n // of the SQL command, normalized to uppercase; or unknown.\n const command =\n typeof queryConfig.name === 'string' && queryConfig.name\n ? queryConfig.name\n : parseNormalizedOperationName(queryConfig.text);\n\n return `${SpanNames.QUERY_PREFIX}:${command}${dbName ? ` ${dbName}` : ''}`;\n}\n\nexport function parseNormalizedOperationName(queryText: string): string {\n // Trim the query text to handle leading/trailing whitespace\n const trimmedQuery = queryText.trim();\n const indexOfFirstSpace = trimmedQuery.indexOf(' ');\n let sqlCommand = indexOfFirstSpace === -1 ? trimmedQuery : trimmedQuery.slice(0, indexOfFirstSpace);\n sqlCommand = sqlCommand.toUpperCase();\n\n // Handle query text being \"COMMIT;\", which has an extra semicolon before the space.\n return sqlCommand.endsWith(';') ? sqlCommand.slice(0, -1) : sqlCommand;\n}\n\nexport function parseAndMaskConnectionString(connectionString: string): string {\n try {\n // Parse the connection string\n const url = new URL(connectionString);\n\n // Remove all auth information (username and password)\n url.username = '';\n url.password = '';\n\n return url.toString();\n } catch {\n // If parsing fails, return a generic connection string\n return 'postgresql://localhost:5432/';\n }\n}\n\nexport function getConnectionString(params: PgParsedConnectionParams | PgPoolOptionsParams): string {\n if ('connectionString' in params && params.connectionString) {\n return parseAndMaskConnectionString(params.connectionString);\n }\n const host = params.host || 'localhost';\n const port = params.port || 5432;\n const database = params.database || '';\n return `postgresql://${host}:${port}/${database}`;\n}\n\nfunction getPort(port: number | undefined): number | undefined {\n // Port may be NaN as parseInt() is used on the value, passing null will result in NaN being parsed.\n // https://github.com/brianc/node-postgres/blob/2a8efbee09a284be12748ed3962bc9b816965e36/packages/pg/lib/connection-parameters.js#L66\n if (Number.isInteger(port)) {\n return port;\n }\n\n // Unable to find the default used in pg code, so falling back to 'undefined'.\n return undefined;\n}\n\nexport function getSemanticAttributesFromConnection(params: PgParsedConnectionParams): SpanAttributes {\n return {\n [DB_SYSTEM]: DB_SYSTEM_VALUE_POSTGRESQL,\n [DB_NAME]: params.database,\n [ATTR_DB_CONNECTION_STRING]: getConnectionString(params),\n [DB_USER]: params.user,\n [NET_PEER_NAME]: params.host, // required\n [NET_PEER_PORT]: getPort(params.port),\n };\n}\n\nexport function getSemanticAttributesFromPoolConnection(params: PgPoolOptionsParams): SpanAttributes {\n let url: URL | undefined;\n try {\n url = params.connectionString ? new URL(params.connectionString) : undefined;\n } catch {\n url = undefined;\n }\n\n return {\n [AttributeNames.IDLE_TIMEOUT_MILLIS]: params.idleTimeoutMillis,\n [AttributeNames.MAX_CLIENT]: params.maxClient,\n [DB_SYSTEM]: DB_SYSTEM_VALUE_POSTGRESQL,\n [DB_NAME]: url?.pathname.slice(1) ?? params.database,\n [ATTR_DB_CONNECTION_STRING]: getConnectionString(params),\n [NET_PEER_NAME]: url?.hostname ?? params.host,\n [NET_PEER_PORT]: Number(url?.port) || getPort(params.port),\n [DB_USER]: url?.username ?? params.user,\n };\n}\n\n/**\n * The SDK always requires a parent span (it sets `requireParentSpan: true`), so\n * we only instrument when there is an active span to parent the new span under.\n */\nexport function shouldSkipInstrumentation(): boolean {\n return getActiveSpan() === undefined;\n}\n\n// Create an (inactive) span from our normalized queryConfig object,\n// or return a basic span if no queryConfig was given/could be created.\nexport function handleConfigQuery(\n this: PgClientExtended,\n queryConfig?: { text: string; values?: unknown; name?: unknown },\n): Span {\n // Create child span.\n const { connectionParameters } = this;\n const dbName = connectionParameters.database;\n\n const spanName = getQuerySpanName(dbName, queryConfig);\n const span = startInactiveSpan({\n name: spanName,\n kind: SPAN_KIND.CLIENT,\n attributes: {\n ...getSemanticAttributesFromConnection(connectionParameters),\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN,\n },\n });\n\n if (!queryConfig) {\n return span;\n }\n\n // Set attributes\n if (queryConfig.text) {\n span.setAttribute(DB_STATEMENT, queryConfig.text);\n }\n\n // Set plan name attribute, if present\n if (typeof queryConfig.name === 'string') {\n span.setAttribute(AttributeNames.PG_PLAN, queryConfig.name);\n }\n\n return span;\n}\n\nexport function patchCallback(span: Span, cb: PostgresCallback): PostgresCallback {\n return function patchedCallback(this: PgClientExtended, err: Error, res: object) {\n if (err) {\n span.setStatus({ code: SPAN_STATUS_ERROR, message: err.message });\n }\n span.end();\n cb.call(this, err, res);\n };\n}\n\nexport function patchCallbackPGPool(span: Span, cb: PgPoolCallback): PgPoolCallback {\n return function patchedCallback(this: PgPoolExtended, err: Error, res: object, done: any) {\n if (err) {\n span.setStatus({ code: SPAN_STATUS_ERROR, message: err.message });\n }\n span.end();\n cb.call(this, err, res, done);\n };\n}\n\nexport function patchClientConnectCallback(span: Span, cb: (...args: unknown[]) => void): (...args: unknown[]) => void {\n return function patchedClientConnectCallback(this: PgClient, ...args: unknown[]) {\n const err = args[0];\n if (err instanceof Error) {\n span.setStatus({ code: SPAN_STATUS_ERROR, message: err.message });\n }\n span.end();\n cb.apply(this, args);\n };\n}\n\n/**\n * Attempt to get a message string from a thrown value, while being quite\n * defensive, to recognize the fact that, in JS, any kind of value (even\n * primitives) can be thrown.\n */\nexport function getErrorMessage(e: unknown): string | undefined {\n return typeof e === 'object' && e !== null && 'message' in e\n ? String((e as { message?: unknown }).message)\n : undefined;\n}\n\nexport function isObjectWithTextString(it: unknown): it is ObjectWithText {\n return typeof it === 'object' && typeof (it as null | { text?: unknown })?.text === 'string';\n}\n\nexport type ObjectWithText = {\n text: string;\n [k: string]: unknown;\n};\n"],"names":["SpanNames","DB_SYSTEM","DB_SYSTEM_VALUE_POSTGRESQL","DB_NAME","ATTR_DB_CONNECTION_STRING","DB_USER","NET_PEER_NAME","NET_PEER_PORT","AttributeNames","getActiveSpan","startInactiveSpan","SPAN_KIND","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","DB_STATEMENT","SPAN_STATUS_ERROR"],"mappings":";;;;;;;;AA0CO,MAAM,MAAA,GAAS;AAqBf,SAAS,gBAAA,CAAiB,QAA4B,WAAA,EAAwD;AAInH,EAAA,IAAI,CAAC,WAAA,EAAa,OAAOA,mBAAA,CAAU,YAAA;AAInC,EAAA,MAAM,OAAA,GACJ,OAAO,WAAA,CAAY,IAAA,KAAS,QAAA,IAAY,WAAA,CAAY,IAAA,GAChD,WAAA,CAAY,IAAA,GACZ,4BAAA,CAA6B,WAAA,CAAY,IAAI,CAAA;AAEnD,EAAA,OAAO,CAAA,EAAGA,mBAAA,CAAU,YAAY,CAAA,CAAA,EAAI,OAAO,GAAG,MAAA,GAAS,CAAA,CAAA,EAAI,MAAM,CAAA,CAAA,GAAK,EAAE,CAAA,CAAA;AAC1E;AAEO,SAAS,6BAA6B,SAAA,EAA2B;AAEtE,EAAA,MAAM,YAAA,GAAe,UAAU,IAAA,EAAK;AACpC,EAAA,MAAM,iBAAA,GAAoB,YAAA,CAAa,OAAA,CAAQ,GAAG,CAAA;AAClD,EAAA,IAAI,aAAa,iBAAA,KAAsB,EAAA,GAAK,eAAe,YAAA,CAAa,KAAA,CAAM,GAAG,iBAAiB,CAAA;AAClG,EAAA,UAAA,GAAa,WAAW,WAAA,EAAY;AAGpC,EAAA,OAAO,UAAA,CAAW,SAAS,GAAG,CAAA,GAAI,WAAW,KAAA,CAAM,CAAA,EAAG,E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