@sentry/core 10.51.0 → 10.52.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (195) hide show
  1. package/build/cjs/client.js +6 -2
  2. package/build/cjs/client.js.map +1 -1
  3. package/build/cjs/fetch.js +7 -4
  4. package/build/cjs/fetch.js.map +1 -1
  5. package/build/cjs/index.js +27 -8
  6. package/build/cjs/index.js.map +1 -1
  7. package/build/cjs/integrations/express/index.js +2 -4
  8. package/build/cjs/integrations/express/index.js.map +1 -1
  9. package/build/cjs/integrations/express/utils.js +0 -7
  10. package/build/cjs/integrations/express/utils.js.map +1 -1
  11. package/build/cjs/integrations/http/add-outgoing-request-breadcrumb.js +43 -0
  12. package/build/cjs/integrations/http/add-outgoing-request-breadcrumb.js.map +1 -0
  13. package/build/cjs/integrations/http/client-patch.js +113 -0
  14. package/build/cjs/integrations/http/client-patch.js.map +1 -0
  15. package/build/cjs/integrations/http/client-subscriptions.js +166 -0
  16. package/build/cjs/integrations/http/client-subscriptions.js.map +1 -0
  17. package/build/cjs/integrations/http/constants.js +10 -0
  18. package/build/cjs/integrations/http/constants.js.map +1 -0
  19. package/build/cjs/integrations/http/double-wrap-warning.js +29 -0
  20. package/build/cjs/integrations/http/double-wrap-warning.js.map +1 -0
  21. package/build/cjs/integrations/http/get-outgoing-span-data.js +88 -0
  22. package/build/cjs/integrations/http/get-outgoing-span-data.js.map +1 -0
  23. package/build/cjs/integrations/http/get-request-url.js +54 -0
  24. package/build/cjs/integrations/http/get-request-url.js.map +1 -0
  25. package/build/cjs/integrations/http/inject-trace-propagation-headers.js +81 -0
  26. package/build/cjs/integrations/http/inject-trace-propagation-headers.js.map +1 -0
  27. package/build/cjs/integrations/requestdata.js +85 -3
  28. package/build/cjs/integrations/requestdata.js.map +1 -1
  29. package/build/cjs/logs/envelope.js +12 -2
  30. package/build/cjs/logs/envelope.js.map +1 -1
  31. package/build/cjs/logs/internal.js +7 -1
  32. package/build/cjs/logs/internal.js.map +1 -1
  33. package/build/cjs/metrics/envelope.js +15 -2
  34. package/build/cjs/metrics/envelope.js.map +1 -1
  35. package/build/cjs/metrics/internal.js +7 -1
  36. package/build/cjs/metrics/internal.js.map +1 -1
  37. package/build/cjs/tracing/spans/captureSpan.js +58 -23
  38. package/build/cjs/tracing/spans/captureSpan.js.map +1 -1
  39. package/build/cjs/tracing/trace.js +1 -0
  40. package/build/cjs/tracing/trace.js.map +1 -1
  41. package/build/cjs/tracing/vercel-ai/constants.js +8 -0
  42. package/build/cjs/tracing/vercel-ai/constants.js.map +1 -1
  43. package/build/cjs/tracing/vercel-ai/index.js +93 -14
  44. package/build/cjs/tracing/vercel-ai/index.js.map +1 -1
  45. package/build/cjs/utils/baggage.js +73 -0
  46. package/build/cjs/utils/baggage.js.map +1 -1
  47. package/build/cjs/utils/chain-and-copy-promiselike.js +1 -0
  48. package/build/cjs/utils/chain-and-copy-promiselike.js.map +1 -1
  49. package/build/cjs/utils/get-default-export.js +32 -0
  50. package/build/cjs/utils/get-default-export.js.map +1 -0
  51. package/build/cjs/utils/request.js +129 -0
  52. package/build/cjs/utils/request.js.map +1 -1
  53. package/build/cjs/utils/spanUtils.js +1 -1
  54. package/build/cjs/utils/spanUtils.js.map +1 -1
  55. package/build/cjs/utils/version.js +1 -1
  56. package/build/esm/client.js +6 -2
  57. package/build/esm/client.js.map +1 -1
  58. package/build/esm/fetch.js +7 -4
  59. package/build/esm/fetch.js.map +1 -1
  60. package/build/esm/index.js +8 -3
  61. package/build/esm/index.js.map +1 -1
  62. package/build/esm/integrations/express/index.js +3 -5
  63. package/build/esm/integrations/express/index.js.map +1 -1
  64. package/build/esm/integrations/express/utils.js +1 -7
  65. package/build/esm/integrations/express/utils.js.map +1 -1
  66. package/build/esm/integrations/http/add-outgoing-request-breadcrumb.js +41 -0
  67. package/build/esm/integrations/http/add-outgoing-request-breadcrumb.js.map +1 -0
  68. package/build/esm/integrations/http/client-patch.js +111 -0
  69. package/build/esm/integrations/http/client-patch.js.map +1 -0
  70. package/build/esm/integrations/http/client-subscriptions.js +164 -0
  71. package/build/esm/integrations/http/client-subscriptions.js.map +1 -0
  72. package/build/esm/integrations/http/constants.js +6 -0
  73. package/build/esm/integrations/http/constants.js.map +1 -0
  74. package/build/esm/integrations/http/double-wrap-warning.js +26 -0
  75. package/build/esm/integrations/http/double-wrap-warning.js.map +1 -0
  76. package/build/esm/integrations/http/get-outgoing-span-data.js +85 -0
  77. package/build/esm/integrations/http/get-outgoing-span-data.js.map +1 -0
  78. package/build/esm/integrations/http/get-request-url.js +49 -0
  79. package/build/esm/integrations/http/get-request-url.js.map +1 -0
  80. package/build/esm/integrations/http/inject-trace-propagation-headers.js +79 -0
  81. package/build/esm/integrations/http/inject-trace-propagation-headers.js.map +1 -0
  82. package/build/esm/integrations/requestdata.js +85 -3
  83. package/build/esm/integrations/requestdata.js.map +1 -1
  84. package/build/esm/logs/envelope.js +12 -2
  85. package/build/esm/logs/envelope.js.map +1 -1
  86. package/build/esm/logs/internal.js +7 -1
  87. package/build/esm/logs/internal.js.map +1 -1
  88. package/build/esm/metrics/envelope.js +15 -2
  89. package/build/esm/metrics/envelope.js.map +1 -1
  90. package/build/esm/metrics/internal.js +7 -1
  91. package/build/esm/metrics/internal.js.map +1 -1
  92. package/build/esm/package.json +1 -1
  93. package/build/esm/tracing/spans/captureSpan.js +58 -23
  94. package/build/esm/tracing/spans/captureSpan.js.map +1 -1
  95. package/build/esm/tracing/trace.js +1 -1
  96. package/build/esm/tracing/trace.js.map +1 -1
  97. package/build/esm/tracing/vercel-ai/constants.js +8 -1
  98. package/build/esm/tracing/vercel-ai/constants.js.map +1 -1
  99. package/build/esm/tracing/vercel-ai/index.js +95 -17
  100. package/build/esm/tracing/vercel-ai/index.js.map +1 -1
  101. package/build/esm/utils/baggage.js +73 -1
  102. package/build/esm/utils/baggage.js.map +1 -1
  103. package/build/esm/utils/chain-and-copy-promiselike.js +1 -0
  104. package/build/esm/utils/chain-and-copy-promiselike.js.map +1 -1
  105. package/build/esm/utils/get-default-export.js +30 -0
  106. package/build/esm/utils/get-default-export.js.map +1 -0
  107. package/build/esm/utils/request.js +127 -1
  108. package/build/esm/utils/request.js.map +1 -1
  109. package/build/esm/utils/spanUtils.js +1 -1
  110. package/build/esm/utils/spanUtils.js.map +1 -1
  111. package/build/esm/utils/version.js +1 -1
  112. package/build/types/client.d.ts.map +1 -1
  113. package/build/types/fetch.d.ts.map +1 -1
  114. package/build/types/index.d.ts +13 -4
  115. package/build/types/index.d.ts.map +1 -1
  116. package/build/types/integrations/express/index.d.ts.map +1 -1
  117. package/build/types/integrations/express/utils.d.ts +1 -5
  118. package/build/types/integrations/express/utils.d.ts.map +1 -1
  119. package/build/types/integrations/http/add-outgoing-request-breadcrumb.d.ts +6 -0
  120. package/build/types/integrations/http/add-outgoing-request-breadcrumb.d.ts.map +1 -0
  121. package/build/types/integrations/http/client-patch.d.ts +46 -0
  122. package/build/types/integrations/http/client-patch.d.ts.map +1 -0
  123. package/build/types/integrations/http/client-subscriptions.d.ts +21 -0
  124. package/build/types/integrations/http/client-subscriptions.d.ts.map +1 -0
  125. package/build/types/integrations/http/constants.d.ts +6 -0
  126. package/build/types/integrations/http/constants.d.ts.map +1 -0
  127. package/build/types/integrations/http/double-wrap-warning.d.ts +4 -0
  128. package/build/types/integrations/http/double-wrap-warning.d.ts.map +1 -0
  129. package/build/types/integrations/http/get-outgoing-span-data.d.ts +13 -0
  130. package/build/types/integrations/http/get-outgoing-span-data.d.ts.map +1 -0
  131. package/build/types/integrations/http/get-request-url.d.ts +10 -0
  132. package/build/types/integrations/http/get-request-url.d.ts.map +1 -0
  133. package/build/types/integrations/http/index.d.ts +4 -0
  134. package/build/types/integrations/http/index.d.ts.map +1 -0
  135. package/build/types/integrations/http/inject-trace-propagation-headers.d.ts +12 -0
  136. package/build/types/integrations/http/inject-trace-propagation-headers.d.ts.map +1 -0
  137. package/build/types/integrations/http/types.d.ts +249 -0
  138. package/build/types/integrations/http/types.d.ts.map +1 -0
  139. package/build/types/integrations/requestdata.d.ts.map +1 -1
  140. package/build/types/logs/envelope.d.ts +5 -2
  141. package/build/types/logs/envelope.d.ts.map +1 -1
  142. package/build/types/logs/internal.d.ts.map +1 -1
  143. package/build/types/metrics/envelope.d.ts +5 -2
  144. package/build/types/metrics/envelope.d.ts.map +1 -1
  145. package/build/types/metrics/internal.d.ts.map +1 -1
  146. package/build/types/tracing/index.d.ts +1 -1
  147. package/build/types/tracing/index.d.ts.map +1 -1
  148. package/build/types/tracing/spans/captureSpan.d.ts +4 -4
  149. package/build/types/tracing/spans/captureSpan.d.ts.map +1 -1
  150. package/build/types/tracing/trace.d.ts +1 -0
  151. package/build/types/tracing/trace.d.ts.map +1 -1
  152. package/build/types/tracing/vercel-ai/constants.d.ts +1 -0
  153. package/build/types/tracing/vercel-ai/constants.d.ts.map +1 -1
  154. package/build/types/tracing/vercel-ai/index.d.ts +9 -0
  155. package/build/types/tracing/vercel-ai/index.d.ts.map +1 -1
  156. package/build/types/types-hoist/log.d.ts +5 -0
  157. package/build/types/types-hoist/log.d.ts.map +1 -1
  158. package/build/types/types-hoist/metric.d.ts +5 -0
  159. package/build/types/types-hoist/metric.d.ts.map +1 -1
  160. package/build/types/types-hoist/webfetchapi.d.ts +2 -0
  161. package/build/types/types-hoist/webfetchapi.d.ts.map +1 -1
  162. package/build/types/utils/baggage.d.ts +13 -0
  163. package/build/types/utils/baggage.d.ts.map +1 -1
  164. package/build/types/utils/get-default-export.d.ts +22 -0
  165. package/build/types/utils/get-default-export.d.ts.map +1 -0
  166. package/build/types/utils/request.d.ts +30 -0
  167. package/build/types/utils/request.d.ts.map +1 -1
  168. package/build/types/utils/spanUtils.d.ts +1 -1
  169. package/build/types-ts3.8/index.d.ts +13 -4
  170. package/build/types-ts3.8/integrations/express/utils.d.ts +1 -5
  171. package/build/types-ts3.8/integrations/http/add-outgoing-request-breadcrumb.d.ts +6 -0
  172. package/build/types-ts3.8/integrations/http/client-patch.d.ts +46 -0
  173. package/build/types-ts3.8/integrations/http/client-subscriptions.d.ts +21 -0
  174. package/build/types-ts3.8/integrations/http/constants.d.ts +6 -0
  175. package/build/types-ts3.8/integrations/http/double-wrap-warning.d.ts +4 -0
  176. package/build/types-ts3.8/integrations/http/get-outgoing-span-data.d.ts +13 -0
  177. package/build/types-ts3.8/integrations/http/get-request-url.d.ts +10 -0
  178. package/build/types-ts3.8/integrations/http/index.d.ts +4 -0
  179. package/build/types-ts3.8/integrations/http/inject-trace-propagation-headers.d.ts +12 -0
  180. package/build/types-ts3.8/integrations/http/types.d.ts +252 -0
  181. package/build/types-ts3.8/logs/envelope.d.ts +5 -2
  182. package/build/types-ts3.8/metrics/envelope.d.ts +5 -2
  183. package/build/types-ts3.8/tracing/index.d.ts +1 -1
  184. package/build/types-ts3.8/tracing/spans/captureSpan.d.ts +4 -4
  185. package/build/types-ts3.8/tracing/trace.d.ts +1 -0
  186. package/build/types-ts3.8/tracing/vercel-ai/constants.d.ts +1 -0
  187. package/build/types-ts3.8/tracing/vercel-ai/index.d.ts +9 -0
  188. package/build/types-ts3.8/types-hoist/log.d.ts +5 -0
  189. package/build/types-ts3.8/types-hoist/metric.d.ts +5 -0
  190. package/build/types-ts3.8/types-hoist/webfetchapi.d.ts +2 -0
  191. package/build/types-ts3.8/utils/baggage.d.ts +13 -0
  192. package/build/types-ts3.8/utils/get-default-export.d.ts +22 -0
  193. package/build/types-ts3.8/utils/request.d.ts +30 -0
  194. package/build/types-ts3.8/utils/spanUtils.d.ts +1 -1
  195. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tracing/vercel-ai/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAqa3C;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAI1D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tracing/vercel-ai/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAyO3C;;GAEG;AACH;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CA2FvF;AAkKD;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAO1D"}
@@ -52,6 +52,11 @@ export interface SerializedLog {
52
52
  severity_number?: Log['severityNumber'];
53
53
  }
54
54
  export type SerializedLogContainer = {
55
+ version?: number;
56
+ ingest_settings?: {
57
+ infer_ip?: 'auto' | 'never';
58
+ infer_user_agent?: 'auto' | 'never';
59
+ };
55
60
  items: Array<SerializedLog>;
56
61
  };
57
62
  //# sourceMappingURL=log.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../../src/types-hoist/log.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAE1D,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;AAEvF,MAAM,WAAW,GAAG;IAClB;;;;;;;;OAQG;IACH,KAAK,EAAE,gBAAgB,CAAC;IAExB;;OAEG;IACH,OAAO,EAAE,mBAAmB,CAAC;IAE7B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAErC;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,KAAK,EAAE,gBAAgB,CAAC;IAExB;;OAEG;IAC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G;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE;QAChB,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;QAC5B,gBAAgB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;KACrC,CAAC;IACF,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;CAC7B,CAAC"}
@@ -61,6 +61,11 @@ export interface SerializedMetric {
61
61
  attributes?: Attributes;
62
62
  }
63
63
  export type SerializedMetricContainer = {
64
+ version?: number;
65
+ ingest_settings?: {
66
+ infer_ip?: 'auto' | 'never';
67
+ infer_user_agent?: 'auto' | 'never';
68
+ };
64
69
  items: Array<SerializedMetric>;
65
70
  };
66
71
  //# sourceMappingURL=metric.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"metric.d.ts","sourceRoot":"","sources":["../../../src/types-hoist/metric.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAErE,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,OAAO,GAAG,cAAc,CAAC;AAE9D,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,IAAI,EAAE,UAAU,CAAC;IAEjB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAED;;GAEG;AACH,MAAM,MAAM,8BAA8B,GAAG,mBAAmB,CAAC;AAEjE,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,IA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AAE,UAAU,CAAC;CACzB;AAED,MAAM,MAAM,yBAAyB,GAAG;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE;QAChB,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;QAC5B,gBAAgB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;KACrC,CAAC;IACF,KAAK,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC;CAChC,CAAC"}
@@ -10,6 +10,8 @@ export interface WebFetchRequest {
10
10
  readonly headers: WebFetchHeaders;
11
11
  readonly method: string;
12
12
  readonly url: string;
13
+ readonly body?: unknown;
13
14
  clone(): WebFetchRequest;
15
+ text(): Promise<string>;
14
16
  }
15
17
  //# sourceMappingURL=webfetchapi.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"webfetchapi.d.ts","sourceRoot":"","sources":["../../../src/types-hoist/webfetchapi.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,eAAe;IAC9B,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACjC,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAC3B,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,OAAO,CAAC,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,KAAK,IAAI,GAAG,IAAI,CAAC;CAC1F;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAClC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,KAAK,IAAI,eAAe,CAAC;CAC1B"}
1
+ {"version":3,"file":"webfetchapi.d.ts","sourceRoot":"","sources":["../../../src/types-hoist/webfetchapi.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,eAAe;IAC9B,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACjC,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAC3B,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,OAAO,CAAC,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,KAAK,IAAI,GAAG,IAAI,CAAC;CAC1F;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAClC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IACxB,KAAK,IAAI,eAAe,CAAC;IACzB,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CACzB"}
@@ -37,4 +37,17 @@ export declare function parseBaggageHeader(baggageHeader: string | string[] | nu
37
37
  * is not spec compliant.
38
38
  */
39
39
  export declare function objectToBaggageHeader(object: Record<string, string>): string | undefined;
40
+ /**
41
+ * Merge two baggage headers into one.
42
+ * - Sentry-specific entries (keys starting with "sentry-") from the new
43
+ * baggage take precedence
44
+ * - Non-Sentry entries from existing baggage take precedence
45
+ *
46
+ * The order of the existing baggage will be preserved, and new entries will
47
+ * be added to the end.
48
+ *
49
+ * This matches the behavior of OTEL's propagation.inject() which uses
50
+ * `baggage.setEntry()` to overwrite existing entries with the same key.
51
+ */
52
+ export declare function mergeBaggageHeaders<Existing extends string | string[] | number | undefined>(existing: Existing, incoming: string): string | undefined | Existing;
40
53
  //# sourceMappingURL=baggage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"baggage.d.ts","sourceRoot":"","sources":["../../../src/utils/baggage.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAItE,eAAO,MAAM,yBAAyB,YAAY,CAAC;AAEnD,eAAO,MAAM,+BAA+B,QAAa,CAAC;AAE1D;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,OAAO,CAAC;AAE9C;;;;;;GAMG;AACH,wBAAgB,qCAAqC,CAEnD,aAAa,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,GACrE,OAAO,CAAC,sBAAsB,CAAC,GAAG,SAAS,CAuB7C;AAED;;;;;;;;GAQG;AACH,wBAAgB,2CAA2C,CAEzD,sBAAsB,CAAC,EAAE,OAAO,CAAC,sBAAsB,CAAC,GACvD,MAAM,GAAG,SAAS,CAiBpB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,aAAa,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,GACrE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAiBpC;AAqCD;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,GAAG,SAAS,CAmBxF"}
1
+ {"version":3,"file":"baggage.d.ts","sourceRoot":"","sources":["../../../src/utils/baggage.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAItE,eAAO,MAAM,yBAAyB,YAAY,CAAC;AAEnD,eAAO,MAAM,+BAA+B,QAAa,CAAC;AAE1D;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,OAAO,CAAC;AAE9C;;;;;;GAMG;AACH,wBAAgB,qCAAqC,CAEnD,aAAa,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,GACrE,OAAO,CAAC,sBAAsB,CAAC,GAAG,SAAS,CAuB7C;AAED;;;;;;;;GAQG;AACH,wBAAgB,2CAA2C,CAEzD,sBAAsB,CAAC,EAAE,OAAO,CAAC,sBAAsB,CAAC,GACvD,MAAM,GAAG,SAAS,CAiBpB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,aAAa,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,GACrE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAiBpC;AAqCD;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,GAAG,SAAS,CAmBxF;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,EACzF,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,MAAM,GACf,MAAM,GAAG,SAAS,GAAG,QAAQ,CAuD/B"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Often we patch a module's default export, but we want to be able to do
3
+ * something like this:
4
+ *
5
+ * ```ts
6
+ * patchTheThing(await import('the-thing'));
7
+ * ```
8
+ *
9
+ * Or like this:
10
+ *
11
+ * ```ts
12
+ * import theThing from 'the-thing';
13
+ * patchTheThing(theThing);
14
+ * ```
15
+ *
16
+ * Note: this does not support modules with a falsey default export. However,
17
+ * presumably in those cases, there's no default export to patch anyway.
18
+ */
19
+ export declare function getDefaultExport<T>(moduleExport: T | {
20
+ default: T;
21
+ }): T;
22
+ //# sourceMappingURL=get-default-export.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-default-export.d.ts","sourceRoot":"","sources":["../../../src/utils/get-default-export.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,GAAG;IAAE,OAAO,EAAE,CAAC,CAAA;CAAE,GAAG,CAAC,CAQvE"}
@@ -1,5 +1,21 @@
1
+ import type { Scope } from '../scope';
1
2
  import type { RequestEventData } from '../types-hoist/request';
2
3
  import type { WebFetchHeaders, WebFetchRequest } from '../types-hoist/webfetchapi';
4
+ /**
5
+ * Maximum size of incoming HTTP request bodies attached to events.
6
+ *
7
+ * - `'none'`: No request bodies will be attached
8
+ * - `'small'`: Request bodies up to 1,000 bytes will be attached
9
+ * - `'medium'`: Request bodies up to 10,000 bytes will be attached
10
+ * - `'always'`: Request bodies will always be attached (up to 1MB hard cap)
11
+ */
12
+ export type MaxRequestBodySize = 'none' | 'small' | 'medium' | 'always';
13
+ /** Hard cap on captured body size, even when `maxRequestBodySize` is `'always'`. */
14
+ export declare const MAX_BODY_BYTE_LENGTH: number;
15
+ /**
16
+ * Convert a `maxRequestBodySize` setting to a maximum byte length.
17
+ */
18
+ export declare function getMaxBodyByteLength(maxRequestBodySize: Exclude<MaxRequestBodySize, 'none'>): number;
3
19
  /**
4
20
  * Transforms a `Headers` object that implements the `Web Fetch API` (https://developer.mozilla.org/en-US/docs/Web/API/Headers) into a simple key-value dict.
5
21
  * The header keys will be lower case: e.g. A "Content-Type" header will be stored as "content-type".
@@ -13,6 +29,20 @@ export declare function headersToDict(reqHeaders: Record<string, string | string
13
29
  * Converts a `Request` object that implements the `Web Fetch API` (https://developer.mozilla.org/en-US/docs/Web/API/Headers) into the format that the `RequestData` integration understands.
14
30
  */
15
31
  export declare function winterCGRequestToRequestData(req: WebFetchRequest): RequestEventData;
32
+ /**
33
+ * Captures the body from a Web Fetch API Request and adds it to the isolation scope.
34
+ *
35
+ * This function clones the request to read the body without affecting the original.
36
+ * Only textual content types are captured - binary data is skipped.
37
+ *
38
+ * This is used by WinterCG-compatible runtimes (Cloudflare Workers, Deno, Bun, Vercel Edge, etc.)
39
+ * that use the Web Fetch API Request object.
40
+ *
41
+ * @param request - The incoming Web Fetch API Request
42
+ * @param isolationScope - The isolation scope to add the body to
43
+ * @param maxRequestBodySize - The maximum size of the request body to capture ('small' = 1KB, 'medium' = 10KB, 'always' = 1MB)
44
+ */
45
+ export declare function captureBodyFromWinterCGRequest(request: WebFetchRequest, isolationScope: Scope, maxRequestBodySize: Exclude<MaxRequestBodySize, 'none'>): Promise<void>;
16
46
  /**
17
47
  * Convert a HTTP request object to RequestEventData to be passed as normalizedRequest.
18
48
  * Instead of allowing `PolymorphicRequest` to be passed,
@@ -1 +1 @@
1
- {"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../../src/utils/request.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAEnF;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,eAAe,EAAE,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAc9F;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAc/G;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CAAC,GAAG,EAAE,eAAe,GAAG,gBAAgB,CAUnF;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE;IAChD,MAAM,CAAC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AAM,GAAG,MAAM,GAAG,SAAS,CAczE"}
@@ -73,7 +73,7 @@ export declare function spanIsSampled(span: Span): boolean;
73
73
  /** Get the status message to use for a JSON representation of a span. */
74
74
  export declare function getStatusMessage(status: SpanStatus | undefined): string | undefined;
75
75
  /**
76
- * Convert the various statuses to the simple onces expected by Sentry for steamed spans ('ok' is default).
76
+ * Convert the various statuses to the simple ones expected by Sentry for streamed spans ('ok' is default).
77
77
  */
78
78
  export declare function getSimpleStatusMessage(status: SpanStatus | undefined): 'ok' | 'error';
79
79
  declare const CHILD_SPANS_FIELD = "_sentryChildSpans";
@@ -52,7 +52,8 @@ export { debounce } from './utils/debounce';
52
52
  export { makeWeakRef, derefWeakRef } from './utils/weakRef';
53
53
  export { MaybeWeakRef } from './utils/weakRef';
54
54
  export { shouldIgnoreSpan } from './utils/should-ignore-span';
55
- export { winterCGHeadersToDict, winterCGRequestToRequestData, httpRequestToRequestData, extractQueryParamsFromUrl, headersToDict, httpHeadersToSpanAttributes, } from './utils/request';
55
+ export { winterCGHeadersToDict, winterCGRequestToRequestData, captureBodyFromWinterCGRequest, httpRequestToRequestData, extractQueryParamsFromUrl, headersToDict, httpHeadersToSpanAttributes, getMaxBodyByteLength, MAX_BODY_BYTE_LENGTH, } from './utils/request';
56
+ export { MaxRequestBodySize } from './utils/request';
56
57
  export { DEFAULT_ENVIRONMENT, DEV_ENVIRONMENT } from './constants';
57
58
  export { addBreadcrumb } from './breadcrumbs';
58
59
  export { functionToStringIntegration } from './integrations/functiontostring';
@@ -72,9 +73,16 @@ export { instrumentPostgresJsSql } from './integrations/postgresjs';
72
73
  export { zodErrorsIntegration } from './integrations/zoderrors';
73
74
  export { thirdPartyErrorFilterIntegration } from './integrations/third-party-errors-filter';
74
75
  export { consoleIntegration } from './integrations/console';
75
- export { featureFlagsIntegration, FeatureFlagsIntegration } from './integrations/featureFlags';
76
+ export { FeatureFlagsIntegration } from './integrations/featureFlags';
77
+ export { featureFlagsIntegration } from './integrations/featureFlags';
76
78
  export { growthbookIntegration } from './integrations/featureFlags';
77
79
  export { conversationIdIntegration } from './integrations/conversationId';
80
+ export { patchHttpModuleClient } from './integrations/http/client-patch';
81
+ export { getHttpClientSubscriptions } from './integrations/http/client-subscriptions';
82
+ export { addOutgoingRequestBreadcrumb } from './integrations/http/add-outgoing-request-breadcrumb';
83
+ export { getRequestUrl, getRequestUrlObject, getRequestUrlFromClientRequest, getRequestOptions, } from './integrations/http/get-request-url';
84
+ export { HTTP_ON_CLIENT_REQUEST, HTTP_ON_SERVER_REQUEST } from './integrations/http/constants';
85
+ export { HttpInstrumentationOptions, HttpClientRequest, HttpIncomingMessage, HttpServerResponse, HttpModuleExport, } from './integrations/http/types';
78
86
  export { profiler } from './profiling';
79
87
  export { instrumentFetchRequest, _INTERNAL_getTracingHeadersForFetchRequest } from './fetch';
80
88
  export { trpcMiddleware } from './trpc';
@@ -154,7 +162,7 @@ export { addItemToEnvelope, createAttachmentEnvelopeItem, createEnvelope, create
154
162
  export { createClientReportEnvelope } from './utils/clientreport';
155
163
  export { DEFAULT_RETRY_AFTER, disabledUntil, isRateLimited, parseRetryAfterHeader, updateRateLimits, } from './utils/ratelimit';
156
164
  export { RateLimits } from './utils/ratelimit';
157
- export { MAX_BAGGAGE_STRING_LENGTH, SENTRY_BAGGAGE_KEY_PREFIX, SENTRY_BAGGAGE_KEY_PREFIX_REGEX, baggageHeaderToDynamicSamplingContext, dynamicSamplingContextToSentryBaggageHeader, parseBaggageHeader, objectToBaggageHeader, } from './utils/baggage';
165
+ export { MAX_BAGGAGE_STRING_LENGTH, SENTRY_BAGGAGE_KEY_PREFIX, SENTRY_BAGGAGE_KEY_PREFIX_REGEX, baggageHeaderToDynamicSamplingContext, dynamicSamplingContextToSentryBaggageHeader, parseBaggageHeader, objectToBaggageHeader, mergeBaggageHeaders, } from './utils/baggage';
158
166
  export { getSanitizedUrlString, parseUrl, stripUrlQueryAndFragment, parseStringToURLObject, getHttpSpanDetailsFromUrlObject, isURLObjectRelative, getSanitizedUrlStringFromUrlObject, stripDataUrlContent, } from './utils/url';
159
167
  export { eventFromMessage, eventFromUnknownInput, exceptionFromError, parseStackFrames, _enhanceErrorWithSentryInfo as _INTERNAL_enhanceErrorWithSentryInfo, } from './utils/eventbuilder';
160
168
  export { callFrameToStackFrame, watchdogTimer } from './utils/anr';
@@ -221,6 +229,7 @@ export { ViewHierarchyData, ViewHierarchyWindow } from './types-hoist/view-hiera
221
229
  export { LegacyCSPReport } from './types-hoist/csp';
222
230
  export { SerializedLog, SerializedLogContainer } from './types-hoist/log';
223
231
  export { BuildTimeOptionsBase, UnstableVitePluginOptions, UnstableRollupPluginOptions, UnstableWebpackPluginOptions, } from './build-time-plugins/buildTimeOptionsBase';
224
- export { withRandomSafeContext as _INTERNAL_withRandomSafeContext, RandomSafeContextRunner as _INTERNAL_RandomSafeContextRunner, safeMathRandom as _INTERNAL_safeMathRandom, safeDateNow as _INTERNAL_safeDateNow } from './utils/randomSafeContext';
232
+ export { RandomSafeContextRunner as _INTERNAL_RandomSafeContextRunner } from './utils/randomSafeContext';
233
+ export { withRandomSafeContext as _INTERNAL_withRandomSafeContext, safeMathRandom as _INTERNAL_safeMathRandom, safeDateNow as _INTERNAL_safeDateNow, } from './utils/randomSafeContext';
225
234
  export { safeUnref as _INTERNAL_safeUnref } from './utils/timer';
226
235
  //# sourceMappingURL=index.d.ts.map
@@ -27,7 +27,7 @@
27
27
  * limitations under the License.
28
28
  */
29
29
  import { SpanAttributes } from '../../types-hoist/span';
30
- import { ExpressExport, ExpressIntegrationOptions, ExpressLayer, ExpressLayerType, ExpressRequest, MiddlewareError, ExpressExportv5, ExpressExportv4 } from './types';
30
+ import { ExpressIntegrationOptions, ExpressLayer, ExpressLayerType, ExpressRequest, MiddlewareError, ExpressExportv5, ExpressExportv4 } from './types';
31
31
  import { ATTR_EXPRESS_NAME, ATTR_EXPRESS_TYPE } from './types';
32
32
  /**
33
33
  * Converts a user-provided error value into an error and error message pair
@@ -87,10 +87,6 @@ export declare function getConstructedRoute(req: ExpressRequest): string;
87
87
  export declare const getLayerPath: (args: unknown[]) => string | undefined;
88
88
  export declare const isExpressWithRouterPrototype: (express: unknown) => express is ExpressExportv5;
89
89
  export declare const isExpressWithoutRouterPrototype: (express: unknown) => express is ExpressExportv4;
90
- export declare const hasDefaultProp: (express: unknown) => express is {
91
- [k: string]: unknown;
92
- default: ExpressExport;
93
- };
94
90
  /** Returns true if response code is internal server error */
95
91
  export declare function defaultShouldHandleError(error: MiddlewareError): boolean;
96
92
  //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1,6 @@
1
+ import { HttpClientRequest, HttpIncomingMessage } from './types';
2
+ /**
3
+ * Create a breadcrumb for a finished outgoing HTTP request.
4
+ */
5
+ export declare function addOutgoingRequestBreadcrumb(request: HttpClientRequest, response: HttpIncomingMessage | undefined): void;
6
+ //# sourceMappingURL=add-outgoing-request-breadcrumb.d.ts.map
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Platform-portable HTTP(S) outgoing-request patching integration
3
+ *
4
+ * Patches the `http` and `https` Node.js built-in module exports to create
5
+ * Sentry spans for outgoing requests and optionally inject distributed trace
6
+ * propagation headers.
7
+ *
8
+ * @module
9
+ *
10
+ * This Sentry integration is a derivative work based on the OpenTelemetry
11
+ * HTTP instrumentation.
12
+ *
13
+ * <https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-instrumentation-http>
14
+ *
15
+ * Extended under the terms of the Apache 2.0 license linked below:
16
+ *
17
+ * ----
18
+ *
19
+ * Copyright The OpenTelemetry Authors
20
+ *
21
+ * Licensed under the Apache License, Version 2.0 (the "License");
22
+ * you may not use this file except in compliance with the License.
23
+ * You may obtain a copy of the License at
24
+ *
25
+ * https://www.apache.org/licenses/LICENSE-2.0
26
+ *
27
+ * Unless required by applicable law or agreed to in writing, software
28
+ * distributed under the License is distributed on an "AS IS" BASIS,
29
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
30
+ * See the License for the specific language governing permissions and
31
+ * limitations under the License.
32
+ */
33
+ import { HttpModuleExport, HttpInstrumentationOptions } from './types';
34
+ /**
35
+ * Patch an `node:http` or `node:https` module-shaped export so that every
36
+ * outgoing request is tracked by Sentry.
37
+ *
38
+ * @example
39
+ * ```javascript
40
+ * import http from 'http';
41
+ * import { patchHttpModule } from '@sentry/core';
42
+ * patchHttpModule(http, { propagateTrace: true });
43
+ * ```
44
+ */
45
+ export declare const patchHttpModuleClient: (httpModuleExport: HttpModuleExport, options?: HttpInstrumentationOptions) => HttpModuleExport;
46
+ //# sourceMappingURL=client-patch.d.ts.map
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Define the channels and subscription methods to subscribe to in order to
3
+ * instrument the `node:http` module. Note that this does *not* actually
4
+ * register the subscriptions, it simply returns a data object with the
5
+ * channel names and the subscription handlers. Attach these to diagnostic
6
+ * channels on Node versions where they are supported (ie, >=22.12.0).
7
+ *
8
+ * If any other platforms that do support diagnostic channels eventually add
9
+ * channel coverage for the `node:http` client, then these methods can be
10
+ * used on those platforms as well.
11
+ *
12
+ * This implementation is used in the client-patch strategy, by simply
13
+ * calling the handlers with the relevant data at the appropriate time.
14
+ */
15
+ import { HttpInstrumentationOptions } from './types';
16
+ import { ClientSubscriptionName } from './constants';
17
+ type ChannelListener = (message: unknown, name: string | symbol) => void;
18
+ export type HttpClientSubscriptions = Record<ClientSubscriptionName, ChannelListener>;
19
+ export declare function getHttpClientSubscriptions(options: HttpInstrumentationOptions): HttpClientSubscriptions;
20
+ export {};
21
+ //# sourceMappingURL=client-subscriptions.d.ts.map
@@ -0,0 +1,6 @@
1
+ export declare const LOG_PREFIX = "@sentry/instrumentation-http";
2
+ export declare const HTTP_ON_CLIENT_REQUEST = "http.client.request.created";
3
+ export declare const HTTP_ON_SERVER_REQUEST = "http.server.request.start";
4
+ export type ClientSubscriptionName = typeof HTTP_ON_CLIENT_REQUEST;
5
+ export type ServerSubscriptionName = typeof HTTP_ON_SERVER_REQUEST;
6
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1,4 @@
1
+ import { HttpModuleExport } from './types';
2
+ export declare const warning = "Double-wrapped http.client detected. Either disable spans in Sentry.httpIntegration, or disable the OpenTelemetry HTTP instrumentation.";
3
+ export declare const doubleWrapWarning: (http: HttpModuleExport) => void;
4
+ //# sourceMappingURL=double-wrap-warning.d.ts.map
@@ -0,0 +1,13 @@
1
+ import { Span } from '../../types-hoist/span';
2
+ import { HttpClientRequest, HttpIncomingMessage } from './types';
3
+ import { StartSpanOptions } from '../../types-hoist/startSpanOptions';
4
+ /**
5
+ * Build the initial span name and attributes for an outgoing HTTP request.
6
+ * This is called before the span is created, to get the initial details.
7
+ */
8
+ export declare function getOutgoingRequestSpanData(request: HttpClientRequest): StartSpanOptions;
9
+ /**
10
+ * Add span attributes once the response is received.
11
+ */
12
+ export declare function setIncomingResponseSpanData(response: HttpIncomingMessage, span: Span): void;
13
+ //# sourceMappingURL=get-outgoing-span-data.d.ts.map
@@ -0,0 +1,10 @@
1
+ import { HttpClientRequest, HttpRequestOptions } from './types';
2
+ /** Convert an outgoing request to request options. */
3
+ export declare function getRequestOptions(request: HttpClientRequest): HttpRequestOptions;
4
+ export declare function getRequestUrl(requestOptions: HttpRequestOptions): string;
5
+ export declare function getRequestUrlObject(requestOptions: HttpRequestOptions): URL;
6
+ /**
7
+ * Build the full URL string from a Node.js ClientRequest.
8
+ */
9
+ export declare function getRequestUrlFromClientRequest(request: HttpClientRequest): string;
10
+ //# sourceMappingURL=get-request-url.d.ts.map
@@ -0,0 +1,4 @@
1
+ export { HttpInstrumentationOptions } from './types';
2
+ export * from './client-patch';
3
+ export * from './client-subscriptions';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,12 @@
1
+ import { LRUMap } from '../../utils/lru';
2
+ import { HttpClientRequest } from './types';
3
+ /**
4
+ * Inject Sentry trace-propagation headers into an outgoing request if the
5
+ * target URL matches the configured `tracePropagationTargets`.
6
+ *
7
+ * Note: this must be called *before* calling `request.end()` (or firing the
8
+ * `http.client.request.start` diagnostics channel), because at that point,
9
+ * the headers have already been sent, and cannot be modified.
10
+ */
11
+ export declare function injectTracePropagationHeaders(request: HttpClientRequest, propagationDecisionMap: LRUMap<string, boolean>): void;
12
+ //# sourceMappingURL=inject-trace-propagation-headers.d.ts.map
@@ -0,0 +1,252 @@
1
+ /**
2
+ * Platform-portable HTTP(S) outgoing-request integration – type definitions.
3
+ *
4
+ * @module
5
+ *
6
+ * This Sentry integration is a derivative work based on the OpenTelemetry
7
+ * HTTP instrumentation.
8
+ *
9
+ * <https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-instrumentation-http>
10
+ *
11
+ * Extended under the terms of the Apache 2.0 license linked below:
12
+ *
13
+ * ----
14
+ *
15
+ * Copyright The OpenTelemetry Authors
16
+ *
17
+ * Licensed under the Apache License, Version 2.0 (the "License");
18
+ * you may not use this file except in compliance with the License.
19
+ * You may obtain a copy of the License at
20
+ *
21
+ * https://www.apache.org/licenses/LICENSE-2.0
22
+ *
23
+ * Unless required by applicable law or agreed to in writing, software
24
+ * distributed under the License is distributed on an "AS IS" BASIS,
25
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26
+ * See the License for the specific language governing permissions and
27
+ * limitations under the License.
28
+ */
29
+ import { RequestEventData } from '../../types-hoist/request';
30
+ import { Span } from '../../types-hoist/span';
31
+ /** Minimal interface for a Node.js http.ClientRequest */
32
+ export interface HttpClientRequest {
33
+ method?: string;
34
+ path?: string;
35
+ host?: string;
36
+ protocol?: string;
37
+ port?: number;
38
+ end(): void;
39
+ getHeader(name: string): string | string[] | number | undefined;
40
+ getHeaders(): Record<string, string | string[] | undefined | number>;
41
+ setHeader(name: string, value: string | string[] | number): void;
42
+ removeHeader(name: string): void;
43
+ prependListener(event: 'response', listener: (res: HttpIncomingMessage) => void): this;
44
+ prependListener(event: string | symbol, listener: (...args: unknown[]) => void): this;
45
+ on(event: string | symbol, listener: (...args: unknown[]) => void): this;
46
+ once(event: string | symbol, listener: (...args: unknown[]) => void): this;
47
+ listenerCount(event: string | symbol): number;
48
+ removeListener(event: string | symbol, listener: (...args: unknown[]) => void): this;
49
+ }
50
+ /** Minimal interface for http client RequestOptions */
51
+ export interface HttpRequestOptions {
52
+ method?: string;
53
+ protocol?: string | null;
54
+ hostname?: string | null;
55
+ host?: string | null;
56
+ port?: string | number | null;
57
+ path?: string | null;
58
+ headers?: Record<string, string | string[] | undefined | number>;
59
+ }
60
+ /** Minimal interface for a Node.js http.ServerResponse */
61
+ export interface HttpServerResponse {
62
+ statusCode: number;
63
+ statusMessage?: string;
64
+ headers: Record<string, string | undefined | string[] | number>;
65
+ once(ev: string, ...data: unknown[]): this;
66
+ once(ev: 'close'): this;
67
+ on(ev: string | symbol, handler: (...data: unknown[]) => void): this;
68
+ }
69
+ export interface HttpServer {
70
+ emit(ev: string, ...data: unknown[]): this;
71
+ emit(ev: 'request', request: HttpIncomingMessage, response: HttpServerResponse): this;
72
+ }
73
+ export interface HttpSocket {
74
+ remoteAddress?: string;
75
+ remotePort?: number;
76
+ localAddress?: string;
77
+ localPort?: number;
78
+ }
79
+ /** Minimal interface for a Node.js http.IncomingMessage */
80
+ export interface HttpIncomingMessage {
81
+ statusCode?: number;
82
+ statusMessage?: string;
83
+ httpVersion?: string;
84
+ url?: string;
85
+ method?: string;
86
+ headers: Record<string, string | string[] | undefined>;
87
+ socket?: HttpSocket;
88
+ aborted?: boolean;
89
+ complete?: boolean;
90
+ resume(): void;
91
+ on(event: 'end', listener: () => void): this;
92
+ on(event: string | symbol, listener: (...args: unknown[]) => void): this;
93
+ addListener(event: 'end', listener: () => void): this;
94
+ addListener(event: string | symbol, listener: (...args: unknown[]) => void): this;
95
+ off(event: string | symbol, listener: (...args: unknown[]) => void): this;
96
+ removeListener(event: string | symbol, listener: (...args: unknown[]) => void): this;
97
+ }
98
+ /** Minimal interface for a Node.js http / https module export */
99
+ export interface HttpExport {
100
+ request: (...args: any[]) => HttpClientRequest;
101
+ get: (...args: any[]) => HttpClientRequest;
102
+ [key: string]: unknown;
103
+ }
104
+ export type HttpModuleExport = HttpExport | (HttpExport & {
105
+ default: HttpExport;
106
+ });
107
+ export interface HttpInstrumentationOptions {
108
+ /**
109
+ * Whether to create spans for outgoing HTTP requests.
110
+ * @default true
111
+ */
112
+ spans?: boolean;
113
+ /**
114
+ * Whether to inject distributed trace propagation headers
115
+ * (`sentry-trace`, `baggage`, `traceparent`) into outgoing requests.
116
+ * @default false
117
+ */
118
+ propagateTrace?: boolean;
119
+ /**
120
+ * Skip span / breadcrumb creation for requests to matching URLs.
121
+ * Receives the full URL string and the outgoing request object.
122
+ */
123
+ ignoreOutgoingRequests?: (url: string, request: HttpClientRequest) => boolean;
124
+ /**
125
+ * Whether breadcrumbs should be recorded for outgoing requests.
126
+ * @default true
127
+ */
128
+ breadcrumbs?: boolean;
129
+ /**
130
+ * Called after the outgoing-request span is created by the client.
131
+ * Use this to add custom attributes to the span.
132
+ */
133
+ outgoingRequestHook?: (span: Span, request: HttpClientRequest) => void;
134
+ /**
135
+ * Called when the response is received by the client.
136
+ */
137
+ outgoingResponseHook?: (span: Span, response: HttpIncomingMessage) => void;
138
+ /**
139
+ * Called when both the request and response are available (after the
140
+ * response ends). Useful for adding attributes based on both objects.
141
+ */
142
+ applyCustomAttributesOnSpan?: (span: Span, request: HttpClientRequest, response: HttpIncomingMessage) => void;
143
+ /**
144
+ * Symbol to use for observing errors on EventEmitters without consuming
145
+ * them. Pass `EventEmitter.errorMonitor` from Node.js `events` module.
146
+ * Falls back to the plain `'error'` event string when not provided.
147
+ *
148
+ * Using the real `errorMonitor` symbol ensures that Sentry does not
149
+ * swallow errors before they reach user-supplied `'error'` handlers.
150
+ */
151
+ errorMonitor?: symbol | string;
152
+ /**
153
+ * Controls the maximum size of incoming HTTP request bodies attached to events.
154
+ *
155
+ * Available options:
156
+ * - 'none': No request bodies will be attached
157
+ * - 'small': Request bodies up to 1,000 bytes will be attached
158
+ * - 'medium': Request bodies up to 10,000 bytes will be attached (default)
159
+ * - 'always': Request bodies will always be attached
160
+ *
161
+ * Note that even with 'always' setting, bodies exceeding 1MB will never be attached
162
+ * for performance and security reasons.
163
+ *
164
+ * @default 'medium'
165
+ */
166
+ maxRequestBodySize?: 'none' | 'small' | 'medium' | 'always';
167
+ /**
168
+ * Do not capture the request body for incoming HTTP requests to URLs where the given callback returns `true`.
169
+ * This can be useful for long running requests where the body is not needed and we want to avoid capturing it.
170
+ *
171
+ * @param url Contains the entire URL, including query string (if any), protocol, host, etc. of the incoming request.
172
+ * @param request Contains the {@type RequestOptions} object used to make the incoming request.
173
+ */
174
+ ignoreRequestBody?: (url: string, request: HttpIncomingMessage) => boolean;
175
+ /**
176
+ * Whether the integration should create [Sessions](https://docs.sentry.io/product/releases/health/#sessions) for incoming requests to track the health and crash-free rate of your releases in Sentry.
177
+ * Read more about Release Health: https://docs.sentry.io/product/releases/health/
178
+ *
179
+ * Defaults to `true`.
180
+ */
181
+ sessions?: boolean;
182
+ /**
183
+ * Number of milliseconds until sessions tracked with `trackIncomingRequestsAsSessions` will be flushed as a session aggregate.
184
+ *
185
+ * Defaults to `60000` (60s).
186
+ */
187
+ sessionFlushingDelayMS?: number;
188
+ /**
189
+ * Optional callback that can be used by integrations to emit the 'request'
190
+ * event within a given Sentry or OTEL context, possibly after creating a
191
+ * span, as in the HttpServerSpansIntegration.
192
+ */
193
+ wrapServerEmitRequest?: (request: HttpIncomingMessage, response: HttpServerResponse, normalizedRequest: RequestEventData, next: () => void) => void;
194
+ /**
195
+ * Do not capture spans for incoming HTTP requests to URLs where the given callback returns `true`.
196
+ * Spans will be non recording if tracing is disabled.
197
+ *
198
+ * The `urlPath` param consists of the URL path and query string (if any) of the incoming request.
199
+ * For example: `'/users/details?id=123'`
200
+ *
201
+ * The `request` param contains the original {@type IncomingMessage} object of the incoming request.
202
+ * You can use it to filter on additional properties like method, headers, etc.
203
+ */
204
+ ignoreIncomingRequests?: (urlPath: string, request: HttpIncomingMessage) => boolean;
205
+ /**
206
+ * Whether to automatically ignore common static asset requests like favicon.ico, robots.txt, etc.
207
+ * This helps reduce noise in your transactions.
208
+ *
209
+ * @default `true`
210
+ */
211
+ ignoreStaticAssets?: boolean;
212
+ /**
213
+ * Do not capture spans for incoming HTTP requests with the given status codes.
214
+ * By default, spans with some 3xx and 4xx status codes are ignored (see @default).
215
+ * Expects an array of status codes or a range of status codes, e.g. [[300,399], 404] would ignore 3xx and 404 status codes.
216
+ *
217
+ * @default `[[401, 404], [301, 303], [305, 399]]`
218
+ */
219
+ ignoreStatusCodes?: (number | [
220
+ number,
221
+ number
222
+ ])[];
223
+ /**
224
+ * A hook that can be used to mutate the span for incoming requests.
225
+ * This is triggered after the span is created, but before it is recorded.
226
+ */
227
+ onSpanCreated?: (span: Span, request: HttpIncomingMessage, response: HttpServerResponse) => void;
228
+ /**
229
+ * A hook that can be used to mutate the span one last time when the
230
+ * response is finished, eg to update the transaction name based on
231
+ * the RPC metadata.
232
+ */
233
+ onSpanEnd?: (span: Span, request: HttpIncomingMessage, response: HttpServerResponse) => void;
234
+ /**
235
+ * Optional: pass in the `http` and `https` modules in order to detect
236
+ * whether a standalone OTel instrumentation is attempting to wrap them
237
+ * as well. This is fine, as long as `spans` option is disabled, but will
238
+ * result in double-emitting spans otherwise.
239
+ *
240
+ * Since this cannot be fully prevented due to module load timing, and isn't
241
+ * necessarily harmful per se (just noisy/annoying), and there are a number
242
+ * of reasonable approaches to fix it (disable the OTel instrumentation,
243
+ * disable this instrumentation, or keep both and disable spans in one or the
244
+ * other), we simply print a warning so the user can hopefully make an
245
+ * informed decision about how to address it (if at all).
246
+ */
247
+ http?: HttpModuleExport;
248
+ https?: HttpModuleExport;
249
+ /** suppress the warning about double-wrapping with OTel */
250
+ suppressOtelWarning?: boolean;
251
+ }
252
+ //# sourceMappingURL=types.d.ts.map