@opentelemetry/otlp-exporter-base 0.222.0-development.0 → 0.300.0-development.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 (515) hide show
  1. package/dist/ExporterMetrics.cjs +80 -0
  2. package/dist/ExporterMetrics.cjs.map +1 -0
  3. package/dist/ExporterMetrics.d.cts +27 -0
  4. package/dist/ExporterMetrics.d.cts.map +1 -0
  5. package/dist/ExporterMetrics.d.mts +27 -0
  6. package/dist/ExporterMetrics.d.mts.map +1 -0
  7. package/dist/ExporterMetrics.mjs +80 -0
  8. package/dist/ExporterMetrics.mjs.map +1 -0
  9. package/dist/OTLPExporterBase.cjs +28 -0
  10. package/dist/OTLPExporterBase.cjs.map +1 -0
  11. package/dist/OTLPExporterBase.d.cts +20 -0
  12. package/dist/OTLPExporterBase.d.cts.map +1 -0
  13. package/dist/OTLPExporterBase.d.mts +20 -0
  14. package/dist/OTLPExporterBase.d.mts.map +1 -0
  15. package/dist/OTLPExporterBase.mjs +28 -0
  16. package/dist/OTLPExporterBase.mjs.map +1 -0
  17. package/dist/_virtual/_rolldown/runtime.cjs +23 -0
  18. package/dist/bounded-queue-export-promise-handler.cjs +37 -0
  19. package/dist/bounded-queue-export-promise-handler.cjs.map +1 -0
  20. package/dist/bounded-queue-export-promise-handler.mjs +37 -0
  21. package/dist/bounded-queue-export-promise-handler.mjs.map +1 -0
  22. package/dist/configuration/convert-legacy-browser-http-options.cjs +22 -0
  23. package/dist/configuration/convert-legacy-browser-http-options.cjs.map +1 -0
  24. package/dist/configuration/convert-legacy-browser-http-options.d.cts +14 -0
  25. package/dist/configuration/convert-legacy-browser-http-options.d.cts.map +1 -0
  26. package/dist/configuration/convert-legacy-browser-http-options.d.mts +14 -0
  27. package/dist/configuration/convert-legacy-browser-http-options.d.mts.map +1 -0
  28. package/dist/configuration/convert-legacy-browser-http-options.mjs +22 -0
  29. package/dist/configuration/convert-legacy-browser-http-options.mjs.map +1 -0
  30. package/dist/configuration/convert-legacy-http-options.cjs +10 -0
  31. package/dist/configuration/convert-legacy-http-options.cjs.map +1 -0
  32. package/dist/configuration/convert-legacy-http-options.mjs +10 -0
  33. package/dist/configuration/convert-legacy-http-options.mjs.map +1 -0
  34. package/dist/configuration/convert-legacy-node-http-options.cjs +38 -0
  35. package/{build/src/configuration/convert-legacy-node-http-options.js.map → dist/configuration/convert-legacy-node-http-options.cjs.map} +1 -1
  36. package/dist/configuration/convert-legacy-node-http-options.d.cts +14 -0
  37. package/dist/configuration/convert-legacy-node-http-options.d.cts.map +1 -0
  38. package/dist/configuration/convert-legacy-node-http-options.d.mts +14 -0
  39. package/dist/configuration/convert-legacy-node-http-options.d.mts.map +1 -0
  40. package/dist/configuration/convert-legacy-node-http-options.mjs +38 -0
  41. package/dist/configuration/convert-legacy-node-http-options.mjs.map +1 -0
  42. package/dist/configuration/create-legacy-browser-delegate.cjs +41 -0
  43. package/{build/esm/configuration/create-legacy-browser-delegate.js.map → dist/configuration/create-legacy-browser-delegate.cjs.map} +1 -1
  44. package/dist/configuration/create-legacy-browser-delegate.d.cts +21 -0
  45. package/dist/configuration/create-legacy-browser-delegate.d.cts.map +1 -0
  46. package/dist/configuration/create-legacy-browser-delegate.d.mts +21 -0
  47. package/dist/configuration/create-legacy-browser-delegate.d.mts.map +1 -0
  48. package/dist/configuration/create-legacy-browser-delegate.mjs +40 -0
  49. package/dist/configuration/create-legacy-browser-delegate.mjs.map +1 -0
  50. package/dist/configuration/legacy-base-configuration.d.cts +55 -0
  51. package/dist/configuration/legacy-base-configuration.d.cts.map +1 -0
  52. package/dist/configuration/legacy-base-configuration.d.mts +55 -0
  53. package/dist/configuration/legacy-base-configuration.d.mts.map +1 -0
  54. package/dist/configuration/legacy-node-configuration.cjs +10 -0
  55. package/dist/configuration/legacy-node-configuration.cjs.map +1 -0
  56. package/dist/configuration/legacy-node-configuration.d.cts +63 -0
  57. package/dist/configuration/legacy-node-configuration.d.cts.map +1 -0
  58. package/dist/configuration/legacy-node-configuration.d.mts +63 -0
  59. package/dist/configuration/legacy-node-configuration.d.mts.map +1 -0
  60. package/dist/configuration/legacy-node-configuration.mjs +10 -0
  61. package/dist/configuration/legacy-node-configuration.mjs.map +1 -0
  62. package/dist/configuration/otlp-http-configuration.cjs +45 -0
  63. package/dist/configuration/otlp-http-configuration.cjs.map +1 -0
  64. package/dist/configuration/otlp-http-configuration.d.cts +10 -0
  65. package/dist/configuration/otlp-http-configuration.d.cts.map +1 -0
  66. package/dist/configuration/otlp-http-configuration.d.mts +10 -0
  67. package/dist/configuration/otlp-http-configuration.d.mts.map +1 -0
  68. package/dist/configuration/otlp-http-configuration.mjs +44 -0
  69. package/dist/configuration/otlp-http-configuration.mjs.map +1 -0
  70. package/dist/configuration/otlp-node-http-configuration.cjs +37 -0
  71. package/dist/configuration/otlp-node-http-configuration.cjs.map +1 -0
  72. package/dist/configuration/otlp-node-http-configuration.d.cts +29 -0
  73. package/dist/configuration/otlp-node-http-configuration.d.cts.map +1 -0
  74. package/dist/configuration/otlp-node-http-configuration.d.mts +29 -0
  75. package/dist/configuration/otlp-node-http-configuration.d.mts.map +1 -0
  76. package/dist/configuration/otlp-node-http-configuration.mjs +35 -0
  77. package/dist/configuration/otlp-node-http-configuration.mjs.map +1 -0
  78. package/dist/configuration/otlp-node-http-env-configuration.cjs +98 -0
  79. package/dist/configuration/otlp-node-http-env-configuration.cjs.map +1 -0
  80. package/dist/configuration/otlp-node-http-env-configuration.mjs +95 -0
  81. package/dist/configuration/otlp-node-http-env-configuration.mjs.map +1 -0
  82. package/dist/configuration/shared-configuration.cjs +35 -0
  83. package/dist/configuration/shared-configuration.cjs.map +1 -0
  84. package/dist/configuration/shared-configuration.d.cts +24 -0
  85. package/dist/configuration/shared-configuration.d.cts.map +1 -0
  86. package/dist/configuration/shared-configuration.d.mts +24 -0
  87. package/dist/configuration/shared-configuration.d.mts.map +1 -0
  88. package/dist/configuration/shared-configuration.mjs +32 -0
  89. package/dist/configuration/shared-configuration.mjs.map +1 -0
  90. package/dist/configuration/shared-env-configuration.cjs +35 -0
  91. package/dist/configuration/shared-env-configuration.cjs.map +1 -0
  92. package/dist/configuration/shared-env-configuration.d.cts +6 -0
  93. package/dist/configuration/shared-env-configuration.d.cts.map +1 -0
  94. package/dist/configuration/shared-env-configuration.d.mts +6 -0
  95. package/dist/configuration/shared-env-configuration.d.mts.map +1 -0
  96. package/dist/configuration/shared-env-configuration.mjs +35 -0
  97. package/dist/configuration/shared-env-configuration.mjs.map +1 -0
  98. package/dist/export-response.d.cts +18 -0
  99. package/dist/export-response.d.cts.map +1 -0
  100. package/dist/export-response.d.mts +18 -0
  101. package/dist/export-response.d.mts.map +1 -0
  102. package/dist/exporter-transport.d.cts +9 -0
  103. package/dist/exporter-transport.d.cts.map +1 -0
  104. package/dist/exporter-transport.d.mts +9 -0
  105. package/dist/exporter-transport.d.mts.map +1 -0
  106. package/dist/index-browser-http.cjs +8 -0
  107. package/dist/index-browser-http.d.cts +4 -0
  108. package/dist/index-browser-http.d.mts +4 -0
  109. package/dist/index-browser-http.mjs +4 -0
  110. package/dist/index-node-http.cjs +10 -0
  111. package/dist/index-node-http.d.cts +5 -0
  112. package/dist/index-node-http.d.mts +5 -0
  113. package/dist/index-node-http.mjs +5 -0
  114. package/dist/index.cjs +14 -0
  115. package/dist/index.d.cts +11 -0
  116. package/dist/index.d.mts +11 -0
  117. package/dist/index.mjs +7 -0
  118. package/dist/is-export-retryable.cjs +17 -0
  119. package/dist/is-export-retryable.cjs.map +1 -0
  120. package/dist/is-export-retryable.mjs +16 -0
  121. package/dist/is-export-retryable.mjs.map +1 -0
  122. package/dist/logging-response-handler.cjs +18 -0
  123. package/{build/src/logging-response-handler.js.map → dist/logging-response-handler.cjs.map} +1 -1
  124. package/dist/logging-response-handler.mjs +18 -0
  125. package/dist/logging-response-handler.mjs.map +1 -0
  126. package/dist/otlp-browser-http-export-delegate.cjs +18 -0
  127. package/dist/otlp-browser-http-export-delegate.cjs.map +1 -0
  128. package/dist/otlp-browser-http-export-delegate.d.cts +12 -0
  129. package/dist/otlp-browser-http-export-delegate.d.cts.map +1 -0
  130. package/dist/otlp-browser-http-export-delegate.d.mts +12 -0
  131. package/dist/otlp-browser-http-export-delegate.d.mts.map +1 -0
  132. package/dist/otlp-browser-http-export-delegate.mjs +17 -0
  133. package/dist/otlp-browser-http-export-delegate.mjs.map +1 -0
  134. package/dist/otlp-export-delegate.cjs +101 -0
  135. package/dist/otlp-export-delegate.cjs.map +1 -0
  136. package/dist/otlp-export-delegate.d.cts +16 -0
  137. package/dist/otlp-export-delegate.d.cts.map +1 -0
  138. package/dist/otlp-export-delegate.d.mts +16 -0
  139. package/dist/otlp-export-delegate.d.mts.map +1 -0
  140. package/dist/otlp-export-delegate.mjs +101 -0
  141. package/dist/otlp-export-delegate.mjs.map +1 -0
  142. package/dist/otlp-http-export-delegate.cjs +34 -0
  143. package/dist/otlp-http-export-delegate.cjs.map +1 -0
  144. package/dist/otlp-http-export-delegate.d.cts +11 -0
  145. package/dist/otlp-http-export-delegate.d.cts.map +1 -0
  146. package/dist/otlp-http-export-delegate.d.mts +11 -0
  147. package/dist/otlp-http-export-delegate.d.mts.map +1 -0
  148. package/dist/otlp-http-export-delegate.mjs +33 -0
  149. package/dist/otlp-http-export-delegate.mjs.map +1 -0
  150. package/dist/otlp-network-export-delegate.cjs +15 -0
  151. package/dist/otlp-network-export-delegate.cjs.map +1 -0
  152. package/dist/otlp-network-export-delegate.d.cts +10 -0
  153. package/dist/otlp-network-export-delegate.d.cts.map +1 -0
  154. package/dist/otlp-network-export-delegate.d.mts +10 -0
  155. package/dist/otlp-network-export-delegate.d.mts.map +1 -0
  156. package/dist/otlp-network-export-delegate.mjs +15 -0
  157. package/dist/otlp-network-export-delegate.mjs.map +1 -0
  158. package/dist/retrying-transport.cjs +62 -0
  159. package/dist/retrying-transport.cjs.map +1 -0
  160. package/dist/retrying-transport.mjs +62 -0
  161. package/dist/retrying-transport.mjs.map +1 -0
  162. package/dist/semconv.cjs +100 -0
  163. package/dist/semconv.cjs.map +1 -0
  164. package/dist/semconv.mjs +95 -0
  165. package/dist/semconv.mjs.map +1 -0
  166. package/dist/transport/fetch-transport.cjs +143 -0
  167. package/dist/transport/fetch-transport.cjs.map +1 -0
  168. package/dist/transport/fetch-transport.mjs +143 -0
  169. package/dist/transport/fetch-transport.mjs.map +1 -0
  170. package/dist/transport/http-exporter-transport.cjs +38 -0
  171. package/dist/transport/http-exporter-transport.cjs.map +1 -0
  172. package/dist/transport/http-exporter-transport.mjs +38 -0
  173. package/dist/transport/http-exporter-transport.mjs.map +1 -0
  174. package/dist/transport/http-transport-utils.cjs +136 -0
  175. package/dist/transport/http-transport-utils.cjs.map +1 -0
  176. package/dist/transport/http-transport-utils.mjs +132 -0
  177. package/dist/transport/http-transport-utils.mjs.map +1 -0
  178. package/dist/types.cjs +18 -0
  179. package/dist/types.cjs.map +1 -0
  180. package/dist/types.d.cts +13 -0
  181. package/dist/types.d.cts.map +1 -0
  182. package/dist/types.d.mts +13 -0
  183. package/dist/types.d.mts.map +1 -0
  184. package/dist/types.mjs +18 -0
  185. package/dist/types.mjs.map +1 -0
  186. package/dist/util.cjs +18 -0
  187. package/dist/util.cjs.map +1 -0
  188. package/dist/util.mjs +18 -0
  189. package/dist/util.mjs.map +1 -0
  190. package/dist/version.cjs +6 -0
  191. package/dist/version.cjs.map +1 -0
  192. package/dist/version.mjs +6 -0
  193. package/dist/version.mjs.map +1 -0
  194. package/package.json +41 -38
  195. package/build/esm/ExporterMetrics.d.ts +0 -24
  196. package/build/esm/ExporterMetrics.js +0 -104
  197. package/build/esm/ExporterMetrics.js.map +0 -1
  198. package/build/esm/OTLPExporterBase.d.ts +0 -17
  199. package/build/esm/OTLPExporterBase.js +0 -28
  200. package/build/esm/OTLPExporterBase.js.map +0 -1
  201. package/build/esm/bounded-queue-export-promise-handler.d.ts +0 -13
  202. package/build/esm/bounded-queue-export-promise-handler.js +0 -39
  203. package/build/esm/bounded-queue-export-promise-handler.js.map +0 -1
  204. package/build/esm/configuration/convert-legacy-browser-http-options.d.ts +0 -11
  205. package/build/esm/configuration/convert-legacy-browser-http-options.js +0 -19
  206. package/build/esm/configuration/convert-legacy-browser-http-options.js.map +0 -1
  207. package/build/esm/configuration/convert-legacy-http-options.d.ts +0 -4
  208. package/build/esm/configuration/convert-legacy-http-options.js +0 -12
  209. package/build/esm/configuration/convert-legacy-http-options.js.map +0 -1
  210. package/build/esm/configuration/convert-legacy-node-http-options.d.ts +0 -11
  211. package/build/esm/configuration/convert-legacy-node-http-options.js +0 -43
  212. package/build/esm/configuration/convert-legacy-node-http-options.js.map +0 -1
  213. package/build/esm/configuration/create-legacy-browser-delegate.d.ts +0 -18
  214. package/build/esm/configuration/create-legacy-browser-delegate.js +0 -48
  215. package/build/esm/configuration/legacy-base-configuration.d.ts +0 -52
  216. package/build/esm/configuration/legacy-base-configuration.js +0 -2
  217. package/build/esm/configuration/legacy-base-configuration.js.map +0 -1
  218. package/build/esm/configuration/legacy-node-configuration.d.ts +0 -61
  219. package/build/esm/configuration/legacy-node-configuration.js +0 -10
  220. package/build/esm/configuration/legacy-node-configuration.js.map +0 -1
  221. package/build/esm/configuration/otlp-http-configuration.d.ts +0 -14
  222. package/build/esm/configuration/otlp-http-configuration.js +0 -59
  223. package/build/esm/configuration/otlp-http-configuration.js.map +0 -1
  224. package/build/esm/configuration/otlp-node-http-configuration.d.ts +0 -34
  225. package/build/esm/configuration/otlp-node-http-configuration.js +0 -35
  226. package/build/esm/configuration/otlp-node-http-configuration.js.map +0 -1
  227. package/build/esm/configuration/otlp-node-http-env-configuration.d.ts +0 -9
  228. package/build/esm/configuration/otlp-node-http-env-configuration.js +0 -119
  229. package/build/esm/configuration/otlp-node-http-env-configuration.js.map +0 -1
  230. package/build/esm/configuration/shared-configuration.d.ts +0 -24
  231. package/build/esm/configuration/shared-configuration.js +0 -42
  232. package/build/esm/configuration/shared-configuration.js.map +0 -1
  233. package/build/esm/configuration/shared-env-configuration.d.ts +0 -3
  234. package/build/esm/configuration/shared-env-configuration.js +0 -41
  235. package/build/esm/configuration/shared-env-configuration.js.map +0 -1
  236. package/build/esm/export-response.d.ts +0 -15
  237. package/build/esm/export-response.js +0 -6
  238. package/build/esm/export-response.js.map +0 -1
  239. package/build/esm/exporter-transport.d.ts +0 -6
  240. package/build/esm/exporter-transport.js +0 -6
  241. package/build/esm/exporter-transport.js.map +0 -1
  242. package/build/esm/index-browser-http.d.ts +0 -7
  243. package/build/esm/index-browser-http.js +0 -11
  244. package/build/esm/index-browser-http.js.map +0 -1
  245. package/build/esm/index-node-http.d.ts +0 -5
  246. package/build/esm/index-node-http.js +0 -9
  247. package/build/esm/index-node-http.js.map +0 -1
  248. package/build/esm/index.d.ts +0 -13
  249. package/build/esm/index.js +0 -11
  250. package/build/esm/index.js.map +0 -1
  251. package/build/esm/is-export-retryable.d.ts +0 -3
  252. package/build/esm/is-export-retryable.js +0 -26
  253. package/build/esm/is-export-retryable.js.map +0 -1
  254. package/build/esm/logging-response-handler.d.ts +0 -6
  255. package/build/esm/logging-response-handler.js +0 -27
  256. package/build/esm/logging-response-handler.js.map +0 -1
  257. package/build/esm/otlp-browser-http-export-delegate.d.ts +0 -10
  258. package/build/esm/otlp-browser-http-export-delegate.js +0 -19
  259. package/build/esm/otlp-browser-http-export-delegate.js.map +0 -1
  260. package/build/esm/otlp-export-delegate.d.ts +0 -27
  261. package/build/esm/otlp-export-delegate.js +0 -114
  262. package/build/esm/otlp-export-delegate.js.map +0 -1
  263. package/build/esm/otlp-http-export-delegate.d.ts +0 -8
  264. package/build/esm/otlp-http-export-delegate.js +0 -43
  265. package/build/esm/otlp-http-export-delegate.js.map +0 -1
  266. package/build/esm/otlp-network-export-delegate.d.ts +0 -7
  267. package/build/esm/otlp-network-export-delegate.js +0 -15
  268. package/build/esm/otlp-network-export-delegate.js.map +0 -1
  269. package/build/esm/response-handler.d.ts +0 -12
  270. package/build/esm/response-handler.js +0 -6
  271. package/build/esm/response-handler.js.map +0 -1
  272. package/build/esm/retrying-transport.d.ts +0 -8
  273. package/build/esm/retrying-transport.js +0 -70
  274. package/build/esm/retrying-transport.js.map +0 -1
  275. package/build/esm/semconv.d.ts +0 -91
  276. package/build/esm/semconv.js +0 -100
  277. package/build/esm/semconv.js.map +0 -1
  278. package/build/esm/transport/fetch-transport.d.ts +0 -12
  279. package/build/esm/transport/fetch-transport.js +0 -133
  280. package/build/esm/transport/fetch-transport.js.map +0 -1
  281. package/build/esm/transport/http-exporter-transport.d.ts +0 -4
  282. package/build/esm/transport/http-exporter-transport.js +0 -41
  283. package/build/esm/transport/http-exporter-transport.js.map +0 -1
  284. package/build/esm/transport/http-transport-types.d.ts +0 -8
  285. package/build/esm/transport/http-transport-types.js +0 -6
  286. package/build/esm/transport/http-transport-types.js.map +0 -1
  287. package/build/esm/transport/http-transport-utils.d.ts +0 -25
  288. package/build/esm/transport/http-transport-utils.js +0 -167
  289. package/build/esm/transport/http-transport-utils.js.map +0 -1
  290. package/build/esm/transport/node-http-transport-types.d.ts +0 -6
  291. package/build/esm/transport/node-http-transport-types.js +0 -6
  292. package/build/esm/transport/node-http-transport-types.js.map +0 -1
  293. package/build/esm/types.d.ts +0 -23
  294. package/build/esm/types.js +0 -18
  295. package/build/esm/types.js.map +0 -1
  296. package/build/esm/util.d.ts +0 -6
  297. package/build/esm/util.js +0 -22
  298. package/build/esm/util.js.map +0 -1
  299. package/build/esm/version.d.ts +0 -2
  300. package/build/esm/version.js +0 -7
  301. package/build/esm/version.js.map +0 -1
  302. package/build/esnext/ExporterMetrics.d.ts +0 -24
  303. package/build/esnext/ExporterMetrics.js +0 -104
  304. package/build/esnext/ExporterMetrics.js.map +0 -1
  305. package/build/esnext/OTLPExporterBase.d.ts +0 -17
  306. package/build/esnext/OTLPExporterBase.js +0 -28
  307. package/build/esnext/OTLPExporterBase.js.map +0 -1
  308. package/build/esnext/bounded-queue-export-promise-handler.d.ts +0 -13
  309. package/build/esnext/bounded-queue-export-promise-handler.js +0 -39
  310. package/build/esnext/bounded-queue-export-promise-handler.js.map +0 -1
  311. package/build/esnext/configuration/convert-legacy-browser-http-options.d.ts +0 -11
  312. package/build/esnext/configuration/convert-legacy-browser-http-options.js +0 -19
  313. package/build/esnext/configuration/convert-legacy-browser-http-options.js.map +0 -1
  314. package/build/esnext/configuration/convert-legacy-http-options.d.ts +0 -4
  315. package/build/esnext/configuration/convert-legacy-http-options.js +0 -12
  316. package/build/esnext/configuration/convert-legacy-http-options.js.map +0 -1
  317. package/build/esnext/configuration/convert-legacy-node-http-options.d.ts +0 -11
  318. package/build/esnext/configuration/convert-legacy-node-http-options.js +0 -43
  319. package/build/esnext/configuration/convert-legacy-node-http-options.js.map +0 -1
  320. package/build/esnext/configuration/create-legacy-browser-delegate.d.ts +0 -18
  321. package/build/esnext/configuration/create-legacy-browser-delegate.js +0 -48
  322. package/build/esnext/configuration/create-legacy-browser-delegate.js.map +0 -1
  323. package/build/esnext/configuration/legacy-base-configuration.d.ts +0 -52
  324. package/build/esnext/configuration/legacy-base-configuration.js +0 -2
  325. package/build/esnext/configuration/legacy-base-configuration.js.map +0 -1
  326. package/build/esnext/configuration/legacy-node-configuration.d.ts +0 -61
  327. package/build/esnext/configuration/legacy-node-configuration.js +0 -10
  328. package/build/esnext/configuration/legacy-node-configuration.js.map +0 -1
  329. package/build/esnext/configuration/otlp-http-configuration.d.ts +0 -14
  330. package/build/esnext/configuration/otlp-http-configuration.js +0 -59
  331. package/build/esnext/configuration/otlp-http-configuration.js.map +0 -1
  332. package/build/esnext/configuration/otlp-node-http-configuration.d.ts +0 -34
  333. package/build/esnext/configuration/otlp-node-http-configuration.js +0 -35
  334. package/build/esnext/configuration/otlp-node-http-configuration.js.map +0 -1
  335. package/build/esnext/configuration/otlp-node-http-env-configuration.d.ts +0 -9
  336. package/build/esnext/configuration/otlp-node-http-env-configuration.js +0 -119
  337. package/build/esnext/configuration/otlp-node-http-env-configuration.js.map +0 -1
  338. package/build/esnext/configuration/shared-configuration.d.ts +0 -24
  339. package/build/esnext/configuration/shared-configuration.js +0 -42
  340. package/build/esnext/configuration/shared-configuration.js.map +0 -1
  341. package/build/esnext/configuration/shared-env-configuration.d.ts +0 -3
  342. package/build/esnext/configuration/shared-env-configuration.js +0 -41
  343. package/build/esnext/configuration/shared-env-configuration.js.map +0 -1
  344. package/build/esnext/export-response.d.ts +0 -15
  345. package/build/esnext/export-response.js +0 -6
  346. package/build/esnext/export-response.js.map +0 -1
  347. package/build/esnext/exporter-transport.d.ts +0 -6
  348. package/build/esnext/exporter-transport.js +0 -6
  349. package/build/esnext/exporter-transport.js.map +0 -1
  350. package/build/esnext/index-browser-http.d.ts +0 -7
  351. package/build/esnext/index-browser-http.js +0 -11
  352. package/build/esnext/index-browser-http.js.map +0 -1
  353. package/build/esnext/index-node-http.d.ts +0 -5
  354. package/build/esnext/index-node-http.js +0 -9
  355. package/build/esnext/index-node-http.js.map +0 -1
  356. package/build/esnext/index.d.ts +0 -13
  357. package/build/esnext/index.js +0 -11
  358. package/build/esnext/index.js.map +0 -1
  359. package/build/esnext/is-export-retryable.d.ts +0 -3
  360. package/build/esnext/is-export-retryable.js +0 -26
  361. package/build/esnext/is-export-retryable.js.map +0 -1
  362. package/build/esnext/logging-response-handler.d.ts +0 -6
  363. package/build/esnext/logging-response-handler.js +0 -27
  364. package/build/esnext/logging-response-handler.js.map +0 -1
  365. package/build/esnext/otlp-browser-http-export-delegate.d.ts +0 -10
  366. package/build/esnext/otlp-browser-http-export-delegate.js +0 -19
  367. package/build/esnext/otlp-browser-http-export-delegate.js.map +0 -1
  368. package/build/esnext/otlp-export-delegate.d.ts +0 -27
  369. package/build/esnext/otlp-export-delegate.js +0 -114
  370. package/build/esnext/otlp-export-delegate.js.map +0 -1
  371. package/build/esnext/otlp-http-export-delegate.d.ts +0 -8
  372. package/build/esnext/otlp-http-export-delegate.js +0 -43
  373. package/build/esnext/otlp-http-export-delegate.js.map +0 -1
  374. package/build/esnext/otlp-network-export-delegate.d.ts +0 -7
  375. package/build/esnext/otlp-network-export-delegate.js +0 -15
  376. package/build/esnext/otlp-network-export-delegate.js.map +0 -1
  377. package/build/esnext/response-handler.d.ts +0 -12
  378. package/build/esnext/response-handler.js +0 -6
  379. package/build/esnext/response-handler.js.map +0 -1
  380. package/build/esnext/retrying-transport.d.ts +0 -8
  381. package/build/esnext/retrying-transport.js +0 -70
  382. package/build/esnext/retrying-transport.js.map +0 -1
  383. package/build/esnext/semconv.d.ts +0 -91
  384. package/build/esnext/semconv.js +0 -100
  385. package/build/esnext/semconv.js.map +0 -1
  386. package/build/esnext/transport/fetch-transport.d.ts +0 -12
  387. package/build/esnext/transport/fetch-transport.js +0 -133
  388. package/build/esnext/transport/fetch-transport.js.map +0 -1
  389. package/build/esnext/transport/http-exporter-transport.d.ts +0 -4
  390. package/build/esnext/transport/http-exporter-transport.js +0 -41
  391. package/build/esnext/transport/http-exporter-transport.js.map +0 -1
  392. package/build/esnext/transport/http-transport-types.d.ts +0 -8
  393. package/build/esnext/transport/http-transport-types.js +0 -6
  394. package/build/esnext/transport/http-transport-types.js.map +0 -1
  395. package/build/esnext/transport/http-transport-utils.d.ts +0 -25
  396. package/build/esnext/transport/http-transport-utils.js +0 -167
  397. package/build/esnext/transport/http-transport-utils.js.map +0 -1
  398. package/build/esnext/transport/node-http-transport-types.d.ts +0 -6
  399. package/build/esnext/transport/node-http-transport-types.js +0 -6
  400. package/build/esnext/transport/node-http-transport-types.js.map +0 -1
  401. package/build/esnext/types.d.ts +0 -23
  402. package/build/esnext/types.js +0 -18
  403. package/build/esnext/types.js.map +0 -1
  404. package/build/esnext/util.d.ts +0 -6
  405. package/build/esnext/util.js +0 -22
  406. package/build/esnext/util.js.map +0 -1
  407. package/build/esnext/version.d.ts +0 -2
  408. package/build/esnext/version.js +0 -7
  409. package/build/esnext/version.js.map +0 -1
  410. package/build/src/ExporterMetrics.d.ts +0 -24
  411. package/build/src/ExporterMetrics.js +0 -108
  412. package/build/src/ExporterMetrics.js.map +0 -1
  413. package/build/src/OTLPExporterBase.d.ts +0 -17
  414. package/build/src/OTLPExporterBase.js +0 -32
  415. package/build/src/OTLPExporterBase.js.map +0 -1
  416. package/build/src/bounded-queue-export-promise-handler.d.ts +0 -13
  417. package/build/src/bounded-queue-export-promise-handler.js +0 -43
  418. package/build/src/bounded-queue-export-promise-handler.js.map +0 -1
  419. package/build/src/configuration/convert-legacy-browser-http-options.d.ts +0 -11
  420. package/build/src/configuration/convert-legacy-browser-http-options.js +0 -23
  421. package/build/src/configuration/convert-legacy-browser-http-options.js.map +0 -1
  422. package/build/src/configuration/convert-legacy-http-options.d.ts +0 -4
  423. package/build/src/configuration/convert-legacy-http-options.js +0 -16
  424. package/build/src/configuration/convert-legacy-http-options.js.map +0 -1
  425. package/build/src/configuration/convert-legacy-node-http-options.d.ts +0 -11
  426. package/build/src/configuration/convert-legacy-node-http-options.js +0 -47
  427. package/build/src/configuration/create-legacy-browser-delegate.d.ts +0 -18
  428. package/build/src/configuration/create-legacy-browser-delegate.js +0 -53
  429. package/build/src/configuration/create-legacy-browser-delegate.js.map +0 -1
  430. package/build/src/configuration/legacy-base-configuration.d.ts +0 -52
  431. package/build/src/configuration/legacy-base-configuration.js +0 -3
  432. package/build/src/configuration/legacy-base-configuration.js.map +0 -1
  433. package/build/src/configuration/legacy-node-configuration.d.ts +0 -61
  434. package/build/src/configuration/legacy-node-configuration.js +0 -13
  435. package/build/src/configuration/legacy-node-configuration.js.map +0 -1
  436. package/build/src/configuration/otlp-http-configuration.d.ts +0 -14
  437. package/build/src/configuration/otlp-http-configuration.js +0 -64
  438. package/build/src/configuration/otlp-http-configuration.js.map +0 -1
  439. package/build/src/configuration/otlp-node-http-configuration.d.ts +0 -34
  440. package/build/src/configuration/otlp-node-http-configuration.js +0 -41
  441. package/build/src/configuration/otlp-node-http-configuration.js.map +0 -1
  442. package/build/src/configuration/otlp-node-http-env-configuration.d.ts +0 -9
  443. package/build/src/configuration/otlp-node-http-env-configuration.js +0 -123
  444. package/build/src/configuration/otlp-node-http-env-configuration.js.map +0 -1
  445. package/build/src/configuration/shared-configuration.d.ts +0 -24
  446. package/build/src/configuration/shared-configuration.js +0 -49
  447. package/build/src/configuration/shared-configuration.js.map +0 -1
  448. package/build/src/configuration/shared-env-configuration.d.ts +0 -3
  449. package/build/src/configuration/shared-env-configuration.js +0 -45
  450. package/build/src/configuration/shared-env-configuration.js.map +0 -1
  451. package/build/src/export-response.d.ts +0 -15
  452. package/build/src/export-response.js +0 -7
  453. package/build/src/export-response.js.map +0 -1
  454. package/build/src/exporter-transport.d.ts +0 -6
  455. package/build/src/exporter-transport.js +0 -7
  456. package/build/src/exporter-transport.js.map +0 -1
  457. package/build/src/index-browser-http.d.ts +0 -7
  458. package/build/src/index-browser-http.js +0 -18
  459. package/build/src/index-browser-http.js.map +0 -1
  460. package/build/src/index-node-http.d.ts +0 -5
  461. package/build/src/index-node-http.js +0 -17
  462. package/build/src/index-node-http.js.map +0 -1
  463. package/build/src/index.d.ts +0 -13
  464. package/build/src/index.js +0 -21
  465. package/build/src/index.js.map +0 -1
  466. package/build/src/is-export-retryable.d.ts +0 -3
  467. package/build/src/is-export-retryable.js +0 -31
  468. package/build/src/is-export-retryable.js.map +0 -1
  469. package/build/src/logging-response-handler.d.ts +0 -6
  470. package/build/src/logging-response-handler.js +0 -31
  471. package/build/src/otlp-browser-http-export-delegate.d.ts +0 -10
  472. package/build/src/otlp-browser-http-export-delegate.js +0 -24
  473. package/build/src/otlp-browser-http-export-delegate.js.map +0 -1
  474. package/build/src/otlp-export-delegate.d.ts +0 -27
  475. package/build/src/otlp-export-delegate.js +0 -118
  476. package/build/src/otlp-export-delegate.js.map +0 -1
  477. package/build/src/otlp-http-export-delegate.d.ts +0 -8
  478. package/build/src/otlp-http-export-delegate.js +0 -48
  479. package/build/src/otlp-http-export-delegate.js.map +0 -1
  480. package/build/src/otlp-network-export-delegate.d.ts +0 -7
  481. package/build/src/otlp-network-export-delegate.js +0 -19
  482. package/build/src/otlp-network-export-delegate.js.map +0 -1
  483. package/build/src/response-handler.d.ts +0 -12
  484. package/build/src/response-handler.js +0 -7
  485. package/build/src/response-handler.js.map +0 -1
  486. package/build/src/retrying-transport.d.ts +0 -8
  487. package/build/src/retrying-transport.js +0 -74
  488. package/build/src/retrying-transport.js.map +0 -1
  489. package/build/src/semconv.d.ts +0 -91
  490. package/build/src/semconv.js +0 -103
  491. package/build/src/semconv.js.map +0 -1
  492. package/build/src/transport/fetch-transport.d.ts +0 -12
  493. package/build/src/transport/fetch-transport.js +0 -137
  494. package/build/src/transport/fetch-transport.js.map +0 -1
  495. package/build/src/transport/http-exporter-transport.d.ts +0 -4
  496. package/build/src/transport/http-exporter-transport.js +0 -45
  497. package/build/src/transport/http-exporter-transport.js.map +0 -1
  498. package/build/src/transport/http-transport-types.d.ts +0 -8
  499. package/build/src/transport/http-transport-types.js +0 -7
  500. package/build/src/transport/http-transport-types.js.map +0 -1
  501. package/build/src/transport/http-transport-utils.d.ts +0 -25
  502. package/build/src/transport/http-transport-utils.js +0 -172
  503. package/build/src/transport/http-transport-utils.js.map +0 -1
  504. package/build/src/transport/node-http-transport-types.d.ts +0 -6
  505. package/build/src/transport/node-http-transport-types.js +0 -7
  506. package/build/src/transport/node-http-transport-types.js.map +0 -1
  507. package/build/src/types.d.ts +0 -23
  508. package/build/src/types.js +0 -22
  509. package/build/src/types.js.map +0 -1
  510. package/build/src/util.d.ts +0 -6
  511. package/build/src/util.js +0 -26
  512. package/build/src/util.js.map +0 -1
  513. package/build/src/version.d.ts +0 -2
  514. package/build/src/version.js +0 -10
  515. package/build/src/version.js.map +0 -1
@@ -1,74 +0,0 @@
1
- "use strict";
2
- /*
3
- * Copyright The OpenTelemetry Authors
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.createRetryingTransport = void 0;
8
- const api_1 = require("@opentelemetry/api");
9
- const MAX_ATTEMPTS = 5;
10
- const INITIAL_BACKOFF = 1000;
11
- const MAX_BACKOFF = 5000;
12
- const BACKOFF_MULTIPLIER = 1.5;
13
- const JITTER = 0.2;
14
- /**
15
- * Get a pseudo-random jitter that falls in the range of [-JITTER, +JITTER]
16
- */
17
- function getJitter() {
18
- return Math.random() * (2 * JITTER) - JITTER;
19
- }
20
- class RetryingTransport {
21
- _transport;
22
- constructor(transport) {
23
- this._transport = transport;
24
- }
25
- retry(data, timeoutMillis, inMillis) {
26
- return new Promise((resolve, reject) => {
27
- setTimeout(() => {
28
- this._transport.send(data, timeoutMillis).then(resolve, reject);
29
- }, inMillis);
30
- });
31
- }
32
- async send(data, timeoutMillis) {
33
- let attempts = MAX_ATTEMPTS;
34
- let nextBackoff = INITIAL_BACKOFF;
35
- const deadline = Date.now() + timeoutMillis;
36
- let result = await this._transport.send(data, timeoutMillis);
37
- while (result.status === 'retryable' && attempts > 0) {
38
- attempts--;
39
- // use maximum of computed backoff and 0 to avoid negative timeouts
40
- const backoff = Math.max(Math.min(nextBackoff * (1 + getJitter()), MAX_BACKOFF), 0);
41
- nextBackoff = nextBackoff * BACKOFF_MULTIPLIER;
42
- const retryInMillis = result.retryInMillis ?? backoff;
43
- // return when expected retry time is after the export deadline.
44
- const remainingTimeoutMillis = deadline - Date.now();
45
- if (retryInMillis > remainingTimeoutMillis) {
46
- api_1.diag.info(`Export retry time ${Math.round(retryInMillis)}ms exceeds remaining timeout ${Math.round(remainingTimeoutMillis)}ms, not retrying further.`);
47
- return result;
48
- }
49
- api_1.diag.verbose(`Scheduling export retry in ${Math.round(retryInMillis)}ms`);
50
- result = await this.retry(data, remainingTimeoutMillis, retryInMillis);
51
- }
52
- if (result.status === 'success') {
53
- api_1.diag.verbose(`Export succeeded after ${MAX_ATTEMPTS - attempts} retry attempts.`);
54
- }
55
- else if (result.status === 'retryable') {
56
- api_1.diag.info(`Export failed after maximum retry attempts (${MAX_ATTEMPTS}).`);
57
- }
58
- else {
59
- api_1.diag.info(`Export failed with non-retryable error: ${result.error}`);
60
- }
61
- return result;
62
- }
63
- shutdown() {
64
- return this._transport.shutdown();
65
- }
66
- }
67
- /**
68
- * Creates an Exporter Transport that retries on 'retryable' response.
69
- */
70
- function createRetryingTransport(options) {
71
- return new RetryingTransport(options.transport);
72
- }
73
- exports.createRetryingTransport = createRetryingTransport;
74
- //# sourceMappingURL=retrying-transport.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"retrying-transport.js","sourceRoot":"","sources":["../../src/retrying-transport.ts"],"names":[],"mappings":"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","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { IExporterTransport } from './exporter-transport';\nimport type { ExportResponse } from './export-response';\nimport { diag } from '@opentelemetry/api';\n\nconst MAX_ATTEMPTS = 5;\nconst INITIAL_BACKOFF = 1000;\nconst MAX_BACKOFF = 5000;\nconst BACKOFF_MULTIPLIER = 1.5;\nconst JITTER = 0.2;\n\n/**\n * Get a pseudo-random jitter that falls in the range of [-JITTER, +JITTER]\n */\nfunction getJitter() {\n return Math.random() * (2 * JITTER) - JITTER;\n}\n\nclass RetryingTransport implements IExporterTransport {\n private _transport: IExporterTransport;\n\n constructor(transport: IExporterTransport) {\n this._transport = transport;\n }\n\n private retry(\n data: Uint8Array,\n timeoutMillis: number,\n inMillis: number\n ): Promise<ExportResponse> {\n return new Promise((resolve, reject) => {\n setTimeout(() => {\n this._transport.send(data, timeoutMillis).then(resolve, reject);\n }, inMillis);\n });\n }\n\n async send(data: Uint8Array, timeoutMillis: number): Promise<ExportResponse> {\n let attempts = MAX_ATTEMPTS;\n let nextBackoff = INITIAL_BACKOFF;\n\n const deadline = Date.now() + timeoutMillis;\n let result = await this._transport.send(data, timeoutMillis);\n\n while (result.status === 'retryable' && attempts > 0) {\n attempts--;\n\n // use maximum of computed backoff and 0 to avoid negative timeouts\n const backoff = Math.max(\n Math.min(nextBackoff * (1 + getJitter()), MAX_BACKOFF),\n 0\n );\n nextBackoff = nextBackoff * BACKOFF_MULTIPLIER;\n const retryInMillis = result.retryInMillis ?? backoff;\n\n // return when expected retry time is after the export deadline.\n const remainingTimeoutMillis = deadline - Date.now();\n if (retryInMillis > remainingTimeoutMillis) {\n diag.info(\n `Export retry time ${Math.round(retryInMillis)}ms exceeds remaining timeout ${Math.round(\n remainingTimeoutMillis\n )}ms, not retrying further.`\n );\n return result;\n }\n\n diag.verbose(`Scheduling export retry in ${Math.round(retryInMillis)}ms`);\n result = await this.retry(data, remainingTimeoutMillis, retryInMillis);\n }\n\n if (result.status === 'success') {\n diag.verbose(\n `Export succeeded after ${MAX_ATTEMPTS - attempts} retry attempts.`\n );\n } else if (result.status === 'retryable') {\n diag.info(\n `Export failed after maximum retry attempts (${MAX_ATTEMPTS}).`\n );\n } else {\n diag.info(`Export failed with non-retryable error: ${result.error}`);\n }\n\n return result;\n }\n\n shutdown() {\n return this._transport.shutdown();\n }\n}\n\n/**\n * Creates an Exporter Transport that retries on 'retryable' response.\n */\nexport function createRetryingTransport(options: {\n // Underlying transport to wrap.\n transport: IExporterTransport;\n}): IExporterTransport {\n return new RetryingTransport(options.transport);\n}\n"]}
@@ -1,91 +0,0 @@
1
- /**
2
- * [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6).
3
- *
4
- * @example 200
5
- */
6
- export declare const ATTR_HTTP_RESPONSE_STATUS_CODE: "http.response.status_code";
7
- /**
8
- * A name uniquely identifying the instance of the OpenTelemetry component within its containing SDK instance.
9
- *
10
- * @example otlp_grpc_span_exporter/0
11
- * @example custom-name
12
- *
13
- * @note Implementations **SHOULD** ensure a low cardinality for this attribute, even across application or SDK restarts.
14
- * E.g. implementations **MUST NOT** use UUIDs as values for this attribute.
15
- *
16
- * Implementations **MAY** achieve these goals by following a `<otel.component.type>/<instance-counter>` pattern, e.g. `batching_span_processor/0`.
17
- * Hereby `otel.component.type` refers to the corresponding attribute value of the component.
18
- *
19
- * The value of `instance-counter` **MAY** be automatically assigned by the component and uniqueness within the enclosing SDK instance **MUST** be guaranteed.
20
- * For example, `<instance-counter>` **MAY** be implemented by using a monotonically increasing counter (starting with `0`), which is incremented every time an
21
- * instance of the given component type is started.
22
- *
23
- * With this implementation, for example the first Batching Span Processor would have `batching_span_processor/0`
24
- * as `otel.component.name`, the second one `batching_span_processor/1` and so on.
25
- * These values will therefore be reused in the case of an application restart.
26
- *
27
- * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
28
- */
29
- export declare const ATTR_OTEL_COMPONENT_NAME: "otel.component.name";
30
- /**
31
- * A name identifying the type of the OpenTelemetry component.
32
- *
33
- * @example batching_span_processor
34
- * @example com.example.MySpanExporter
35
- *
36
- * @note If none of the standardized values apply, implementations **SHOULD** use the language-defined name of the type.
37
- * E.g. for Java the fully qualified classname **SHOULD** be used in this case.
38
- *
39
- * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
40
- */
41
- export declare const ATTR_OTEL_COMPONENT_TYPE: "otel.component.type";
42
- /**
43
- * Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.
44
- *
45
- * @example example.com
46
- * @example 10.1.2.80
47
- * @example /tmp/my.sock
48
- *
49
- * @note When observed from the client side, and when communicating through an intermediary, `server.address` **SHOULD** represent the server address behind any intermediaries, for example proxies, if it's available.
50
- */
51
- export declare const ATTR_SERVER_ADDRESS: "server.address";
52
- /**
53
- * Server port number.
54
- *
55
- * @example 80
56
- * @example 8080
57
- * @example 443
58
- *
59
- * @note When observed from the client side, and when communicating through an intermediary, `server.port` **SHOULD** represent the server port behind any intermediaries, for example proxies, if it's available.
60
- */
61
- export declare const ATTR_SERVER_PORT: "server.port";
62
- /**
63
- * Describes a class of error the operation ended with.
64
- *
65
- * @example timeout
66
- * @example java.net.UnknownHostException
67
- * @example server_certificate_invalid
68
- * @example 500
69
- *
70
- * @note The `error.type` **SHOULD** be predictable, and **SHOULD** have low cardinality.
71
- *
72
- * When `error.type` is set to a type (e.g., an exception type), its
73
- * canonical class name identifying the type within the artifact **SHOULD** be used.
74
- *
75
- * Instrumentations **SHOULD** document the list of errors they report.
76
- *
77
- * The cardinality of `error.type` within one instrumentation library **SHOULD** be low.
78
- * Telemetry consumers that aggregate data from multiple instrumentation libraries and applications
79
- * should be prepared for `error.type` to have high cardinality at query time when no
80
- * additional filters are applied.
81
- *
82
- * If the operation has completed successfully, instrumentations **SHOULD NOT** set `error.type`.
83
- *
84
- * If a specific domain defines its own set of error identifiers (such as HTTP or RPC status codes),
85
- * it's **RECOMMENDED** to:
86
- *
87
- * - Use a domain-specific attribute
88
- * - Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not.
89
- */
90
- export declare const ATTR_ERROR_TYPE: "error.type";
91
- //# sourceMappingURL=semconv.d.ts.map
@@ -1,103 +0,0 @@
1
- "use strict";
2
- /*
3
- * Copyright The OpenTelemetry Authors
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.ATTR_ERROR_TYPE = exports.ATTR_SERVER_PORT = exports.ATTR_SERVER_ADDRESS = exports.ATTR_OTEL_COMPONENT_TYPE = exports.ATTR_OTEL_COMPONENT_NAME = exports.ATTR_HTTP_RESPONSE_STATUS_CODE = void 0;
8
- /*
9
- * This file contains a copy of unstable semantic convention definitions
10
- * used by this package.
11
- * @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv
12
- */
13
- /**
14
- * [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6).
15
- *
16
- * @example 200
17
- */
18
- exports.ATTR_HTTP_RESPONSE_STATUS_CODE = 'http.response.status_code';
19
- /**
20
- * A name uniquely identifying the instance of the OpenTelemetry component within its containing SDK instance.
21
- *
22
- * @example otlp_grpc_span_exporter/0
23
- * @example custom-name
24
- *
25
- * @note Implementations **SHOULD** ensure a low cardinality for this attribute, even across application or SDK restarts.
26
- * E.g. implementations **MUST NOT** use UUIDs as values for this attribute.
27
- *
28
- * Implementations **MAY** achieve these goals by following a `<otel.component.type>/<instance-counter>` pattern, e.g. `batching_span_processor/0`.
29
- * Hereby `otel.component.type` refers to the corresponding attribute value of the component.
30
- *
31
- * The value of `instance-counter` **MAY** be automatically assigned by the component and uniqueness within the enclosing SDK instance **MUST** be guaranteed.
32
- * For example, `<instance-counter>` **MAY** be implemented by using a monotonically increasing counter (starting with `0`), which is incremented every time an
33
- * instance of the given component type is started.
34
- *
35
- * With this implementation, for example the first Batching Span Processor would have `batching_span_processor/0`
36
- * as `otel.component.name`, the second one `batching_span_processor/1` and so on.
37
- * These values will therefore be reused in the case of an application restart.
38
- *
39
- * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
40
- */
41
- exports.ATTR_OTEL_COMPONENT_NAME = 'otel.component.name';
42
- /**
43
- * A name identifying the type of the OpenTelemetry component.
44
- *
45
- * @example batching_span_processor
46
- * @example com.example.MySpanExporter
47
- *
48
- * @note If none of the standardized values apply, implementations **SHOULD** use the language-defined name of the type.
49
- * E.g. for Java the fully qualified classname **SHOULD** be used in this case.
50
- *
51
- * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
52
- */
53
- exports.ATTR_OTEL_COMPONENT_TYPE = 'otel.component.type';
54
- /**
55
- * Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.
56
- *
57
- * @example example.com
58
- * @example 10.1.2.80
59
- * @example /tmp/my.sock
60
- *
61
- * @note When observed from the client side, and when communicating through an intermediary, `server.address` **SHOULD** represent the server address behind any intermediaries, for example proxies, if it's available.
62
- */
63
- exports.ATTR_SERVER_ADDRESS = 'server.address';
64
- /**
65
- * Server port number.
66
- *
67
- * @example 80
68
- * @example 8080
69
- * @example 443
70
- *
71
- * @note When observed from the client side, and when communicating through an intermediary, `server.port` **SHOULD** represent the server port behind any intermediaries, for example proxies, if it's available.
72
- */
73
- exports.ATTR_SERVER_PORT = 'server.port';
74
- /**
75
- * Describes a class of error the operation ended with.
76
- *
77
- * @example timeout
78
- * @example java.net.UnknownHostException
79
- * @example server_certificate_invalid
80
- * @example 500
81
- *
82
- * @note The `error.type` **SHOULD** be predictable, and **SHOULD** have low cardinality.
83
- *
84
- * When `error.type` is set to a type (e.g., an exception type), its
85
- * canonical class name identifying the type within the artifact **SHOULD** be used.
86
- *
87
- * Instrumentations **SHOULD** document the list of errors they report.
88
- *
89
- * The cardinality of `error.type` within one instrumentation library **SHOULD** be low.
90
- * Telemetry consumers that aggregate data from multiple instrumentation libraries and applications
91
- * should be prepared for `error.type` to have high cardinality at query time when no
92
- * additional filters are applied.
93
- *
94
- * If the operation has completed successfully, instrumentations **SHOULD NOT** set `error.type`.
95
- *
96
- * If a specific domain defines its own set of error identifiers (such as HTTP or RPC status codes),
97
- * it's **RECOMMENDED** to:
98
- *
99
- * - Use a domain-specific attribute
100
- * - Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not.
101
- */
102
- exports.ATTR_ERROR_TYPE = 'error.type';
103
- //# sourceMappingURL=semconv.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"semconv.js","sourceRoot":"","sources":["../../src/semconv.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;;;GAIG;AAEH;;;;GAIG;AACU,QAAA,8BAA8B,GACzC,2BAAoC,CAAC;AAEvC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACU,QAAA,wBAAwB,GAAG,qBAA8B,CAAC;AAEvE;;;;;;;;;;GAUG;AACU,QAAA,wBAAwB,GAAG,qBAA8B,CAAC;AAEvE;;;;;;;;GAQG;AACU,QAAA,mBAAmB,GAAG,gBAAyB,CAAC;AAE7D;;;;;;;;GAQG;AACU,QAAA,gBAAgB,GAAG,aAAsB,CAAC;AAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACU,QAAA,eAAe,GAAG,YAAqB,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\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 * [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6).\n *\n * @example 200\n */\nexport const ATTR_HTTP_RESPONSE_STATUS_CODE =\n 'http.response.status_code' as const;\n\n/**\n * A name uniquely identifying the instance of the OpenTelemetry component within its containing SDK instance.\n *\n * @example otlp_grpc_span_exporter/0\n * @example custom-name\n *\n * @note Implementations **SHOULD** ensure a low cardinality for this attribute, even across application or SDK restarts.\n * E.g. implementations **MUST NOT** use UUIDs as values for this attribute.\n *\n * Implementations **MAY** achieve these goals by following a `<otel.component.type>/<instance-counter>` pattern, e.g. `batching_span_processor/0`.\n * Hereby `otel.component.type` refers to the corresponding attribute value of the component.\n *\n * The value of `instance-counter` **MAY** be automatically assigned by the component and uniqueness within the enclosing SDK instance **MUST** be guaranteed.\n * For example, `<instance-counter>` **MAY** be implemented by using a monotonically increasing counter (starting with `0`), which is incremented every time an\n * instance of the given component type is started.\n *\n * With this implementation, for example the first Batching Span Processor would have `batching_span_processor/0`\n * as `otel.component.name`, the second one `batching_span_processor/1` and so on.\n * These values will therefore be reused in the case of an application restart.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_OTEL_COMPONENT_NAME = 'otel.component.name' as const;\n\n/**\n * A name identifying the type of the OpenTelemetry component.\n *\n * @example batching_span_processor\n * @example com.example.MySpanExporter\n *\n * @note If none of the standardized values apply, implementations **SHOULD** use the language-defined name of the type.\n * E.g. for Java the fully qualified classname **SHOULD** be used in this case.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_OTEL_COMPONENT_TYPE = 'otel.component.type' as const;\n\n/**\n * Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.\n *\n * @example example.com\n * @example 10.1.2.80\n * @example /tmp/my.sock\n *\n * @note When observed from the client side, and when communicating through an intermediary, `server.address` **SHOULD** represent the server address behind any intermediaries, for example proxies, if it's available.\n */\nexport const ATTR_SERVER_ADDRESS = 'server.address' as const;\n\n/**\n * Server port number.\n *\n * @example 80\n * @example 8080\n * @example 443\n *\n * @note When observed from the client side, and when communicating through an intermediary, `server.port` **SHOULD** represent the server port behind any intermediaries, for example proxies, if it's available.\n */\nexport const ATTR_SERVER_PORT = 'server.port' as const;\n\n/**\n * Describes a class of error the operation ended with.\n *\n * @example timeout\n * @example java.net.UnknownHostException\n * @example server_certificate_invalid\n * @example 500\n *\n * @note The `error.type` **SHOULD** be predictable, and **SHOULD** have low cardinality.\n *\n * When `error.type` is set to a type (e.g., an exception type), its\n * canonical class name identifying the type within the artifact **SHOULD** be used.\n *\n * Instrumentations **SHOULD** document the list of errors they report.\n *\n * The cardinality of `error.type` within one instrumentation library **SHOULD** be low.\n * Telemetry consumers that aggregate data from multiple instrumentation libraries and applications\n * should be prepared for `error.type` to have high cardinality at query time when no\n * additional filters are applied.\n *\n * If the operation has completed successfully, instrumentations **SHOULD NOT** set `error.type`.\n *\n * If a specific domain defines its own set of error identifiers (such as HTTP or RPC status codes),\n * it's **RECOMMENDED** to:\n *\n * - Use a domain-specific attribute\n * - Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not.\n */\nexport const ATTR_ERROR_TYPE = 'error.type' as const;\n"]}
@@ -1,12 +0,0 @@
1
- import type { IExporterTransport } from '../exporter-transport';
2
- import type { HeadersFactory } from '../configuration/otlp-http-configuration';
3
- export interface FetchTransportParameters {
4
- url: string;
5
- headers: HeadersFactory;
6
- }
7
- /**
8
- * Creates an exporter transport that uses `fetch` to send the data
9
- * @param parameters applied to each request made by transport
10
- */
11
- export declare function createFetchTransport(parameters: FetchTransportParameters): IExporterTransport;
12
- //# sourceMappingURL=fetch-transport.d.ts.map
@@ -1,137 +0,0 @@
1
- "use strict";
2
- /*
3
- * Copyright The OpenTelemetry Authors
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.createFetchTransport = void 0;
8
- const api_1 = require("@opentelemetry/api");
9
- const is_export_retryable_1 = require("../is-export-retryable");
10
- /**
11
- * Maximum total body size for concurrent keepalive requests.
12
- * Browsers enforce a 64KiB cumulative limit across all pending keepalive requests.
13
- * We use 60KB to leave headroom for headers.
14
- * @see https://github.com/whatwg/fetch/issues/679
15
- * @see https://blog.huli.tw/2025/01/06/en/navigator-sendbeacon-64kib-and-source-code/
16
- */
17
- const MAX_KEEPALIVE_BODY_SIZE = 60 * 1024;
18
- /**
19
- * Maximum concurrent keepalive requests.
20
- * Chrome enforces 9 concurrent keepalive fetch requests per renderer process.
21
- * @see https://github.com/whatwg/fetch/issues/679
22
- * Quote: "If the renderer process is processing more than 9 requests with keepalive set, we reject a new request"
23
- */
24
- const MAX_KEEPALIVE_REQUESTS = 9;
25
- /**
26
- * Track cumulative pending body size across all in-flight keepalive requests.
27
- * This is necessary because the 64KiB limit is cumulative, not per-request.
28
- */
29
- let pendingBodySize = 0;
30
- /**
31
- * Track number of pending keepalive requests.
32
- */
33
- let pendingKeepaliveCount = 0;
34
- class FetchTransport {
35
- _parameters;
36
- constructor(parameters) {
37
- this._parameters = parameters;
38
- }
39
- async send(data, timeoutMillis) {
40
- const abortController = new AbortController();
41
- const timeout = setTimeout(() => abortController.abort(), timeoutMillis);
42
- // Fetch API may be wrapped by an instrumentation like `@opentelemetry/instrumentation-fetch`.
43
- // In that case the instrumentation would create a new Span for this request
44
- // because the context manager cannot keep the context after `await` calls.
45
- // This creates an indirect endless loop Export -> Span -> Export
46
- // By using the `__original` function the instrumentation can't intercept the call
47
- // and no Span will be created breaking the vicious cycle
48
- let fetchApi = globalThis.fetch;
49
- // @ts-expect-error -- fetch could be wrapped
50
- if (typeof fetchApi.__original === 'function') {
51
- // @ts-expect-error -- fetch could be wrapped
52
- fetchApi = fetchApi.__original;
53
- }
54
- const requestSize = data.byteLength;
55
- // Determine if we can use keepalive based on cumulative browser limits.
56
- // We must check BEFORE adding to pending totals to avoid exceeding limits.
57
- const wouldExceedSize = pendingBodySize + requestSize > MAX_KEEPALIVE_BODY_SIZE;
58
- const wouldExceedCount = pendingKeepaliveCount >= MAX_KEEPALIVE_REQUESTS;
59
- const useKeepalive = !wouldExceedSize && !wouldExceedCount;
60
- if (useKeepalive) {
61
- pendingBodySize += requestSize;
62
- pendingKeepaliveCount++;
63
- }
64
- else {
65
- const reason = wouldExceedSize ? 'size limit' : 'count limit';
66
- api_1.diag.debug(`keepalive disabled: ${(requestSize / 1024).toFixed(1)}KB payload, ${pendingKeepaliveCount} pending (${reason})`);
67
- }
68
- try {
69
- const url = new URL(this._parameters.url);
70
- const response = await fetchApi(url.href, {
71
- method: 'POST',
72
- headers: await this._parameters.headers(),
73
- body: data,
74
- signal: abortController.signal,
75
- keepalive: useKeepalive,
76
- mode: globalThis.location
77
- ? globalThis.location.origin === url.origin
78
- ? 'same-origin'
79
- : 'cors'
80
- : 'no-cors',
81
- });
82
- if (response.status >= 200 && response.status <= 299) {
83
- api_1.diag.debug(`export response success (status: ${response.status})`);
84
- return { status: 'success' };
85
- }
86
- else if ((0, is_export_retryable_1.isExportHTTPErrorRetryable)(response.status)) {
87
- api_1.diag.warn(`export response retryable (status: ${response.status})`);
88
- const retryAfter = response.headers.get('Retry-After');
89
- const retryInMillis = (0, is_export_retryable_1.parseRetryAfterToMills)(retryAfter);
90
- return { status: 'retryable', retryInMillis };
91
- }
92
- api_1.diag.error(`export response failure (status: ${response.status})`);
93
- return {
94
- status: 'failure',
95
- error: new Error(`Fetch request failed with non-retryable status ${response.status}`),
96
- };
97
- }
98
- catch (error) {
99
- if (isFetchNetworkErrorRetryable(error)) {
100
- api_1.diag.warn(`export request retryable (network error: ${error})`);
101
- return {
102
- status: 'retryable',
103
- error: new Error('Fetch request encountered a network error', {
104
- cause: error,
105
- }),
106
- };
107
- }
108
- api_1.diag.error(`export request failure (error: ${error})`);
109
- return {
110
- status: 'failure',
111
- error: new Error('Fetch request errored', { cause: error }),
112
- };
113
- }
114
- finally {
115
- clearTimeout(timeout);
116
- if (useKeepalive) {
117
- pendingBodySize -= requestSize;
118
- pendingKeepaliveCount--;
119
- }
120
- }
121
- }
122
- shutdown() {
123
- // Intentionally left empty, nothing to do.
124
- }
125
- }
126
- /**
127
- * Creates an exporter transport that uses `fetch` to send the data
128
- * @param parameters applied to each request made by transport
129
- */
130
- function createFetchTransport(parameters) {
131
- return new FetchTransport(parameters);
132
- }
133
- exports.createFetchTransport = createFetchTransport;
134
- function isFetchNetworkErrorRetryable(error) {
135
- return error instanceof TypeError && !error.cause;
136
- }
137
- //# sourceMappingURL=fetch-transport.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fetch-transport.js","sourceRoot":"","sources":["../../../src/transport/fetch-transport.ts"],"names":[],"mappings":"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","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { IExporterTransport } from '../exporter-transport';\nimport type { ExportResponse } from '../export-response';\nimport { diag } from '@opentelemetry/api';\nimport {\n isExportHTTPErrorRetryable,\n parseRetryAfterToMills,\n} from '../is-export-retryable';\nimport type { HeadersFactory } from '../configuration/otlp-http-configuration';\n\n/**\n * Maximum total body size for concurrent keepalive requests.\n * Browsers enforce a 64KiB cumulative limit across all pending keepalive requests.\n * We use 60KB to leave headroom for headers.\n * @see https://github.com/whatwg/fetch/issues/679\n * @see https://blog.huli.tw/2025/01/06/en/navigator-sendbeacon-64kib-and-source-code/\n */\nconst MAX_KEEPALIVE_BODY_SIZE = 60 * 1024;\n\n/**\n * Maximum concurrent keepalive requests.\n * Chrome enforces 9 concurrent keepalive fetch requests per renderer process.\n * @see https://github.com/whatwg/fetch/issues/679\n * Quote: \"If the renderer process is processing more than 9 requests with keepalive set, we reject a new request\"\n */\nconst MAX_KEEPALIVE_REQUESTS = 9;\n\n/**\n * Track cumulative pending body size across all in-flight keepalive requests.\n * This is necessary because the 64KiB limit is cumulative, not per-request.\n */\nlet pendingBodySize = 0;\n\n/**\n * Track number of pending keepalive requests.\n */\nlet pendingKeepaliveCount = 0;\n\nexport interface FetchTransportParameters {\n url: string;\n headers: HeadersFactory;\n}\n\nclass FetchTransport implements IExporterTransport {\n private _parameters: FetchTransportParameters;\n\n constructor(parameters: FetchTransportParameters) {\n this._parameters = parameters;\n }\n\n async send(data: Uint8Array, timeoutMillis: number): Promise<ExportResponse> {\n const abortController = new AbortController();\n const timeout = setTimeout(() => abortController.abort(), timeoutMillis);\n // Fetch API may be wrapped by an instrumentation like `@opentelemetry/instrumentation-fetch`.\n // In that case the instrumentation would create a new Span for this request\n // because the context manager cannot keep the context after `await` calls.\n // This creates an indirect endless loop Export -> Span -> Export\n // By using the `__original` function the instrumentation can't intercept the call\n // and no Span will be created breaking the vicious cycle\n let fetchApi = globalThis.fetch;\n // @ts-expect-error -- fetch could be wrapped\n if (typeof fetchApi.__original === 'function') {\n // @ts-expect-error -- fetch could be wrapped\n fetchApi = fetchApi.__original;\n }\n\n const requestSize = data.byteLength;\n\n // Determine if we can use keepalive based on cumulative browser limits.\n // We must check BEFORE adding to pending totals to avoid exceeding limits.\n const wouldExceedSize =\n pendingBodySize + requestSize > MAX_KEEPALIVE_BODY_SIZE;\n const wouldExceedCount = pendingKeepaliveCount >= MAX_KEEPALIVE_REQUESTS;\n const useKeepalive = !wouldExceedSize && !wouldExceedCount;\n\n if (useKeepalive) {\n pendingBodySize += requestSize;\n pendingKeepaliveCount++;\n } else {\n const reason = wouldExceedSize ? 'size limit' : 'count limit';\n diag.debug(\n `keepalive disabled: ${(requestSize / 1024).toFixed(1)}KB payload, ${pendingKeepaliveCount} pending (${reason})`\n );\n }\n\n try {\n const url = new URL(this._parameters.url);\n const response = await fetchApi(url.href, {\n method: 'POST',\n headers: await this._parameters.headers(),\n body: data,\n signal: abortController.signal,\n keepalive: useKeepalive,\n mode: globalThis.location\n ? globalThis.location.origin === url.origin\n ? 'same-origin'\n : 'cors'\n : 'no-cors',\n });\n\n if (response.status >= 200 && response.status <= 299) {\n diag.debug(`export response success (status: ${response.status})`);\n return { status: 'success' };\n } else if (isExportHTTPErrorRetryable(response.status)) {\n diag.warn(`export response retryable (status: ${response.status})`);\n const retryAfter = response.headers.get('Retry-After');\n const retryInMillis = parseRetryAfterToMills(retryAfter);\n return { status: 'retryable', retryInMillis };\n }\n diag.error(`export response failure (status: ${response.status})`);\n return {\n status: 'failure',\n error: new Error(\n `Fetch request failed with non-retryable status ${response.status}`\n ),\n };\n } catch (error) {\n if (isFetchNetworkErrorRetryable(error)) {\n diag.warn(`export request retryable (network error: ${error})`);\n return {\n status: 'retryable',\n error: new Error('Fetch request encountered a network error', {\n cause: error,\n }),\n };\n }\n diag.error(`export request failure (error: ${error})`);\n return {\n status: 'failure',\n error: new Error('Fetch request errored', { cause: error }),\n };\n } finally {\n clearTimeout(timeout);\n if (useKeepalive) {\n pendingBodySize -= requestSize;\n pendingKeepaliveCount--;\n }\n }\n }\n\n shutdown() {\n // Intentionally left empty, nothing to do.\n }\n}\n\n/**\n * Creates an exporter transport that uses `fetch` to send the data\n * @param parameters applied to each request made by transport\n */\nexport function createFetchTransport(\n parameters: FetchTransportParameters\n): IExporterTransport {\n return new FetchTransport(parameters);\n}\n\nfunction isFetchNetworkErrorRetryable(error: unknown): boolean {\n return error instanceof TypeError && !error.cause;\n}\n"]}
@@ -1,4 +0,0 @@
1
- import type { IExporterTransport } from '../exporter-transport';
2
- import type { NodeHttpRequestParameters } from './node-http-transport-types';
3
- export declare function createHttpExporterTransport(parameters: NodeHttpRequestParameters): IExporterTransport;
4
- //# sourceMappingURL=http-exporter-transport.d.ts.map
@@ -1,45 +0,0 @@
1
- "use strict";
2
- /*
3
- * Copyright The OpenTelemetry Authors
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.createHttpExporterTransport = void 0;
8
- const http_transport_utils_1 = require("./http-transport-utils");
9
- class HttpExporterTransport {
10
- _utils = null;
11
- _parameters;
12
- constructor(parameters) {
13
- this._parameters = parameters;
14
- }
15
- async send(data, timeoutMillis) {
16
- const { agent, request } = await this._loadUtils();
17
- const headers = await this._parameters.headers();
18
- return (0, http_transport_utils_1.sendWithHttp)(request, this._parameters.url, headers, this._parameters.compression, this._parameters.userAgent, agent, data, timeoutMillis);
19
- }
20
- shutdown() {
21
- // intentionally left empty, nothing to do.
22
- }
23
- async _loadUtils() {
24
- let utils = this._utils;
25
- if (utils === null) {
26
- const protocol = new URL(this._parameters.url).protocol;
27
- const [agent, request] = await Promise.all([
28
- this._parameters.agentFactory(protocol),
29
- requestFunctionFactory(protocol),
30
- ]);
31
- utils = this._utils = { agent, request };
32
- }
33
- return utils;
34
- }
35
- }
36
- async function requestFunctionFactory(protocol) {
37
- const module = protocol === 'http:' ? import('http') : import('https');
38
- const { request } = await module;
39
- return request;
40
- }
41
- function createHttpExporterTransport(parameters) {
42
- return new HttpExporterTransport(parameters);
43
- }
44
- exports.createHttpExporterTransport = createHttpExporterTransport;
45
- //# sourceMappingURL=http-exporter-transport.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"http-exporter-transport.js","sourceRoot":"","sources":["../../../src/transport/http-exporter-transport.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAQH,iEAAsD;AAQtD,MAAM,qBAAqB;IACjB,MAAM,GAAiB,IAAI,CAAC;IAC5B,WAAW,CAA4B;IAE/C,YAAY,UAAqC;QAC/C,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAChC,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,IAAgB,EAAE,aAAqB;QAChD,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;QACnD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;QAEjD,OAAO,IAAA,mCAAY,EACjB,OAAO,EACP,IAAI,CAAC,WAAW,CAAC,GAAG,EACpB,OAAO,EACP,IAAI,CAAC,WAAW,CAAC,WAAW,EAC5B,IAAI,CAAC,WAAW,CAAC,SAAS,EAC1B,KAAK,EACL,IAAI,EACJ,aAAa,CACd,CAAC;IACJ,CAAC;IAED,QAAQ;QACN,2CAA2C;IAC7C,CAAC;IAEO,KAAK,CAAC,UAAU;QACtB,IAAI,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC;QAExB,IAAI,KAAK,KAAK,IAAI,EAAE;YAClB,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC;YACxD,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;gBACzC,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,QAAQ,CAAC;gBACvC,sBAAsB,CAAC,QAAQ,CAAC;aACjC,CAAC,CAAC;YACH,KAAK,GAAG,IAAI,CAAC,MAAM,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;SAC1C;QAED,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAED,KAAK,UAAU,sBAAsB,CACnC,QAAgB;IAEhB,MAAM,MAAM,GAAG,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACvE,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,MAAM,CAAC;IACjC,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAgB,2BAA2B,CACzC,UAAqC;IAErC,OAAO,IAAI,qBAAqB,CAAC,UAAU,CAAC,CAAC;AAC/C,CAAC;AAJD,kEAIC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n// NOTE: do not change these type imports to actual imports. Doing so WILL break `@opentelemetry/instrumentation-http`,\n// as they'd be imported before the http/https modules can be wrapped.\nimport type * as https from 'https';\nimport type * as http from 'http';\nimport type { ExportResponse } from '../export-response';\nimport type { IExporterTransport } from '../exporter-transport';\nimport { sendWithHttp } from './http-transport-utils';\nimport type { NodeHttpRequestParameters } from './node-http-transport-types';\n\ninterface Utils {\n agent: http.Agent | https.Agent;\n request: typeof http.request | typeof https.request;\n}\n\nclass HttpExporterTransport implements IExporterTransport {\n private _utils: Utils | null = null;\n private _parameters: NodeHttpRequestParameters;\n\n constructor(parameters: NodeHttpRequestParameters) {\n this._parameters = parameters;\n }\n\n async send(data: Uint8Array, timeoutMillis: number): Promise<ExportResponse> {\n const { agent, request } = await this._loadUtils();\n const headers = await this._parameters.headers();\n\n return sendWithHttp(\n request,\n this._parameters.url,\n headers,\n this._parameters.compression,\n this._parameters.userAgent,\n agent,\n data,\n timeoutMillis\n );\n }\n\n shutdown() {\n // intentionally left empty, nothing to do.\n }\n\n private async _loadUtils(): Promise<Utils> {\n let utils = this._utils;\n\n if (utils === null) {\n const protocol = new URL(this._parameters.url).protocol;\n const [agent, request] = await Promise.all([\n this._parameters.agentFactory(protocol),\n requestFunctionFactory(protocol),\n ]);\n utils = this._utils = { agent, request };\n }\n\n return utils;\n }\n}\n\nasync function requestFunctionFactory(\n protocol: string\n): Promise<typeof http.request | typeof https.request> {\n const module = protocol === 'http:' ? import('http') : import('https');\n const { request } = await module;\n return request;\n}\n\nexport function createHttpExporterTransport(\n parameters: NodeHttpRequestParameters\n): IExporterTransport {\n return new HttpExporterTransport(parameters);\n}\n"]}
@@ -1,8 +0,0 @@
1
- import type { HeadersFactory } from '../configuration/otlp-http-configuration';
2
- export interface HttpRequestParameters {
3
- url: string;
4
- headers: HeadersFactory;
5
- compression: 'gzip' | 'none';
6
- userAgent?: string;
7
- }
8
- //# sourceMappingURL=http-transport-types.d.ts.map
@@ -1,7 +0,0 @@
1
- "use strict";
2
- /*
3
- * Copyright The OpenTelemetry Authors
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- //# sourceMappingURL=http-transport-types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"http-transport-types.js","sourceRoot":"","sources":["../../../src/transport/http-transport-types.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { HeadersFactory } from '../configuration/otlp-http-configuration';\n\nexport interface HttpRequestParameters {\n url: string;\n headers: HeadersFactory;\n compression: 'gzip' | 'none';\n userAgent?: string;\n}\n"]}
@@ -1,25 +0,0 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
- import type * as http from 'http';
4
- import type * as https from 'https';
5
- import type { ExportResponse } from '../export-response';
6
- /**
7
- * Maximum response body size (4 MB) that the HTTP transport will read.
8
- * If the server sends more data the connection is destroyed and the export
9
- * is treated as a non-retryable error regardless of status code.
10
- */
11
- export declare const MAX_RESPONSE_BODY_SIZE: number;
12
- /**
13
- * Sends data using http
14
- * @param request
15
- * @param url
16
- * @param headers
17
- * @param compression
18
- * @param userAgent
19
- * @param agent
20
- * @param data
21
- * @param timeoutMillis
22
- */
23
- export declare function sendWithHttp(request: typeof https.request | typeof http.request, url: string, headers: Record<string, string>, compression: 'gzip' | 'none', userAgent: string | undefined, agent: http.Agent | https.Agent, data: Uint8Array, timeoutMillis: number): Promise<ExportResponse>;
24
- export declare function compressAndSend(req: http.ClientRequest, compression: 'gzip' | 'none', data: Uint8Array, onError: (error: Error) => void): void;
25
- //# sourceMappingURL=http-transport-utils.d.ts.map