@opentelemetry/otlp-exporter-base 0.222.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,61 +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 { OTLPExporterConfigBase } from './legacy-base-configuration';
6
- import type { HttpAgentFactory } from './otlp-node-http-configuration';
7
- /**
8
- * Node.js HTTP exporter configuration.
9
- */
10
- export interface OTLPExporterNodeConfigBase extends OTLPExporterConfigBase {
11
- /**
12
- * Sets `keepAlive` on the Node.js HTTP or HTTPS agent created by the exporter.
13
- *
14
- * @remarks
15
- * If `httpAgentOptions` is an object with its own `keepAlive` value, the
16
- * value in `httpAgentOptions` takes precedence.
17
- *
18
- * @defaultValue true
19
- */
20
- keepAlive?: boolean;
21
- /**
22
- * Compression algorithm for outgoing OTLP HTTP requests.
23
- *
24
- * @defaultValue CompressionAlgorithm.NONE
25
- */
26
- compression?: CompressionAlgorithm;
27
- /**
28
- * Custom HTTP agent options or a factory function for creating agents.
29
- *
30
- * @remarks
31
- * Prefer using `http.AgentOptions` or `https.AgentOptions` over a factory function wherever possible.
32
- * If using a factory function (`HttpAgentFactory`), **do not import `http.Agent` or `https.Agent`
33
- * statically at the top of the file**.
34
- * Instead, use dynamic `import()` or `require()` to load the module. This lets
35
- * `@opentelemetry/instrumentation-http` instrument the module first.
36
- *
37
- * @example <caption> Using agent options directly: </caption>
38
- * httpAgentOptions: {
39
- * keepAlive: true,
40
- * maxSockets: 10
41
- * }
42
- *
43
- * @example <caption> Using a factory with dynamic import: </caption>
44
- * httpAgentOptions: async (protocol) => {
45
- * const module = protocol === 'http:' ? await import('http') : await import('https');
46
- * return new module.Agent({ keepAlive: true });
47
- * }
48
- */
49
- httpAgentOptions?: http.AgentOptions | https.AgentOptions | HttpAgentFactory;
50
- /**
51
- * User agent header string to be prepended to the exporter's default value.
52
- * Available since v1.49.0 of the spec.
53
- * Ref: https://opentelemetry.io/docs/specs/otel/protocol/exporter/#user-agent
54
- */
55
- userAgent?: string;
56
- }
57
- export declare enum CompressionAlgorithm {
58
- NONE = "none",
59
- GZIP = "gzip"
60
- }
61
- //# sourceMappingURL=legacy-node-configuration.d.ts.map
@@ -1,10 +0,0 @@
1
- /*
2
- * Copyright The OpenTelemetry Authors
3
- * SPDX-License-Identifier: Apache-2.0
4
- */
5
- export var CompressionAlgorithm;
6
- (function (CompressionAlgorithm) {
7
- CompressionAlgorithm["NONE"] = "none";
8
- CompressionAlgorithm["GZIP"] = "gzip";
9
- })(CompressionAlgorithm || (CompressionAlgorithm = {}));
10
- //# sourceMappingURL=legacy-node-configuration.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"legacy-node-configuration.js","sourceRoot":"","sources":["../../../src/configuration/legacy-node-configuration.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA4DH,MAAM,CAAN,IAAY,oBAGX;AAHD,WAAY,oBAAoB;IAC9B,qCAAa,CAAA;IACb,qCAAa,CAAA;AACf,CAAC,EAHW,oBAAoB,KAApB,oBAAoB,QAG/B","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n// NOTE: do not change these imports to be actual imports, otherwise they WILL break `@opentelemetry/instrumentation-http`\nimport type * as http from 'http';\nimport type * as https from 'https';\n\nimport type { OTLPExporterConfigBase } from './legacy-base-configuration';\nimport type { HttpAgentFactory } from './otlp-node-http-configuration';\n\n/**\n * Node.js HTTP exporter configuration.\n */\nexport interface OTLPExporterNodeConfigBase extends OTLPExporterConfigBase {\n /**\n * Sets `keepAlive` on the Node.js HTTP or HTTPS agent created by the exporter.\n *\n * @remarks\n * If `httpAgentOptions` is an object with its own `keepAlive` value, the\n * value in `httpAgentOptions` takes precedence.\n *\n * @defaultValue true\n */\n keepAlive?: boolean;\n /**\n * Compression algorithm for outgoing OTLP HTTP requests.\n *\n * @defaultValue CompressionAlgorithm.NONE\n */\n compression?: CompressionAlgorithm;\n /**\n * Custom HTTP agent options or a factory function for creating agents.\n *\n * @remarks\n * Prefer using `http.AgentOptions` or `https.AgentOptions` over a factory function wherever possible.\n * If using a factory function (`HttpAgentFactory`), **do not import `http.Agent` or `https.Agent`\n * statically at the top of the file**.\n * Instead, use dynamic `import()` or `require()` to load the module. This lets\n * `@opentelemetry/instrumentation-http` instrument the module first.\n *\n * @example <caption> Using agent options directly: </caption>\n * httpAgentOptions: {\n * keepAlive: true,\n * maxSockets: 10\n * }\n *\n * @example <caption> Using a factory with dynamic import: </caption>\n * httpAgentOptions: async (protocol) => {\n * const module = protocol === 'http:' ? await import('http') : await import('https');\n * return new module.Agent({ keepAlive: true });\n * }\n */\n httpAgentOptions?: http.AgentOptions | https.AgentOptions | HttpAgentFactory;\n /**\n * User agent header string to be prepended to the exporter's default value.\n * Available since v1.49.0 of the spec.\n * Ref: https://opentelemetry.io/docs/specs/otel/protocol/exporter/#user-agent\n */\n userAgent?: string;\n}\n\nexport enum CompressionAlgorithm {\n NONE = 'none',\n GZIP = 'gzip',\n}\n"]}
@@ -1,14 +0,0 @@
1
- import type { OtlpSharedConfiguration } from './shared-configuration';
2
- export type HeadersFactory = () => Promise<Record<string, string>>;
3
- export interface OtlpHttpConfiguration extends OtlpSharedConfiguration {
4
- url: string;
5
- headers: HeadersFactory;
6
- }
7
- /**
8
- * @param userProvidedConfiguration Configuration options provided by the user in code.
9
- * @param fallbackConfiguration Fallback to use when the {@link userProvidedConfiguration} does not specify an option.
10
- * @param defaultConfiguration The defaults as defined by the exporter specification
11
- */
12
- export declare function mergeOtlpHttpConfigurationWithDefaults(userProvidedConfiguration: Partial<OtlpHttpConfiguration>, fallbackConfiguration: Partial<OtlpHttpConfiguration>, defaultConfiguration: OtlpHttpConfiguration): OtlpHttpConfiguration;
13
- export declare function getHttpConfigurationDefaults(requiredHeaders: Record<string, string>, signalResourcePath: string): OtlpHttpConfiguration;
14
- //# sourceMappingURL=otlp-http-configuration.d.ts.map
@@ -1,59 +0,0 @@
1
- /*
2
- * Copyright The OpenTelemetry Authors
3
- * SPDX-License-Identifier: Apache-2.0
4
- */
5
- import { getSharedConfigurationDefaults, mergeOtlpSharedConfigurationWithDefaults, } from './shared-configuration';
6
- import { validateAndNormalizeHeaders } from '../util';
7
- function mergeHeaders(userProvidedHeaders, fallbackHeaders, defaultHeaders) {
8
- return async () => {
9
- const requiredHeaders = {
10
- ...(await defaultHeaders()),
11
- };
12
- const headers = {};
13
- // add fallback ones first
14
- if (fallbackHeaders != null) {
15
- Object.assign(headers, await fallbackHeaders());
16
- }
17
- // override with user-provided ones
18
- if (userProvidedHeaders != null) {
19
- Object.assign(headers, validateAndNormalizeHeaders(await userProvidedHeaders()));
20
- }
21
- // override required ones.
22
- return Object.assign(headers, requiredHeaders);
23
- };
24
- }
25
- function validateUserProvidedUrl(url) {
26
- if (url == null) {
27
- return undefined;
28
- }
29
- try {
30
- // NOTE: In non-browser environments, `globalThis.location` will be `undefined`.
31
- const base = globalThis.location?.href;
32
- return new URL(url, base).href;
33
- }
34
- catch {
35
- throw new Error(`Configuration: Could not parse user-provided export URL: '${url}'`);
36
- }
37
- }
38
- /**
39
- * @param userProvidedConfiguration Configuration options provided by the user in code.
40
- * @param fallbackConfiguration Fallback to use when the {@link userProvidedConfiguration} does not specify an option.
41
- * @param defaultConfiguration The defaults as defined by the exporter specification
42
- */
43
- export function mergeOtlpHttpConfigurationWithDefaults(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration) {
44
- return {
45
- ...mergeOtlpSharedConfigurationWithDefaults(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration),
46
- headers: mergeHeaders(userProvidedConfiguration.headers, fallbackConfiguration.headers, defaultConfiguration.headers),
47
- url: validateUserProvidedUrl(userProvidedConfiguration.url) ??
48
- fallbackConfiguration.url ??
49
- defaultConfiguration.url,
50
- };
51
- }
52
- export function getHttpConfigurationDefaults(requiredHeaders, signalResourcePath) {
53
- return {
54
- ...getSharedConfigurationDefaults(),
55
- headers: async () => requiredHeaders,
56
- url: 'http://localhost:4318/' + signalResourcePath,
57
- };
58
- }
59
- //# sourceMappingURL=otlp-http-configuration.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"otlp-http-configuration.js","sourceRoot":"","sources":["../../../src/configuration/otlp-http-configuration.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACL,8BAA8B,EAC9B,wCAAwC,GACzC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAStD,SAAS,YAAY,CACnB,mBAAsD,EACtD,eAAkD,EAClD,cAA8B;IAE9B,OAAO,KAAK,IAAI,EAAE;QAChB,MAAM,eAAe,GAAG;YACtB,GAAG,CAAC,MAAM,cAAc,EAAE,CAAC;SAC5B,CAAC;QACF,MAAM,OAAO,GAAG,EAAE,CAAC;QAEnB,0BAA0B;QAC1B,IAAI,eAAe,IAAI,IAAI,EAAE;YAC3B,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,eAAe,EAAE,CAAC,CAAC;SACjD;QAED,mCAAmC;QACnC,IAAI,mBAAmB,IAAI,IAAI,EAAE;YAC/B,MAAM,CAAC,MAAM,CACX,OAAO,EACP,2BAA2B,CAAC,MAAM,mBAAmB,EAAE,CAAC,CACzD,CAAC;SACH;QAED,0BAA0B;QAC1B,OAAO,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;IACjD,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,uBAAuB,CAAC,GAAuB;IACtD,IAAI,GAAG,IAAI,IAAI,EAAE;QACf,OAAO,SAAS,CAAC;KAClB;IACD,IAAI;QACF,gFAAgF;QAChF,MAAM,IAAI,GAAG,UAAU,CAAC,QAAQ,EAAE,IAAI,CAAC;QACvC,OAAO,IAAI,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC;KAChC;IAAC,MAAM;QACN,MAAM,IAAI,KAAK,CACb,6DAA6D,GAAG,GAAG,CACpE,CAAC;KACH;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,sCAAsC,CACpD,yBAAyD,EACzD,qBAAqD,EACrD,oBAA2C;IAE3C,OAAO;QACL,GAAG,wCAAwC,CACzC,yBAAyB,EACzB,qBAAqB,EACrB,oBAAoB,CACrB;QACD,OAAO,EAAE,YAAY,CACnB,yBAAyB,CAAC,OAAO,EACjC,qBAAqB,CAAC,OAAO,EAC7B,oBAAoB,CAAC,OAAO,CAC7B;QACD,GAAG,EACD,uBAAuB,CAAC,yBAAyB,CAAC,GAAG,CAAC;YACtD,qBAAqB,CAAC,GAAG;YACzB,oBAAoB,CAAC,GAAG;KAC3B,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,4BAA4B,CAC1C,eAAuC,EACvC,kBAA0B;IAE1B,OAAO;QACL,GAAG,8BAA8B,EAAE;QACnC,OAAO,EAAE,KAAK,IAAI,EAAE,CAAC,eAAe;QACpC,GAAG,EAAE,wBAAwB,GAAG,kBAAkB;KACnD,CAAC;AACJ,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { OtlpSharedConfiguration } from './shared-configuration';\nimport {\n getSharedConfigurationDefaults,\n mergeOtlpSharedConfigurationWithDefaults,\n} from './shared-configuration';\nimport { validateAndNormalizeHeaders } from '../util';\n\nexport type HeadersFactory = () => Promise<Record<string, string>>;\n\nexport interface OtlpHttpConfiguration extends OtlpSharedConfiguration {\n url: string;\n headers: HeadersFactory;\n}\n\nfunction mergeHeaders(\n userProvidedHeaders: HeadersFactory | undefined | null,\n fallbackHeaders: HeadersFactory | undefined | null,\n defaultHeaders: HeadersFactory\n): HeadersFactory {\n return async () => {\n const requiredHeaders = {\n ...(await defaultHeaders()),\n };\n const headers = {};\n\n // add fallback ones first\n if (fallbackHeaders != null) {\n Object.assign(headers, await fallbackHeaders());\n }\n\n // override with user-provided ones\n if (userProvidedHeaders != null) {\n Object.assign(\n headers,\n validateAndNormalizeHeaders(await userProvidedHeaders())\n );\n }\n\n // override required ones.\n return Object.assign(headers, requiredHeaders);\n };\n}\n\nfunction validateUserProvidedUrl(url: string | undefined): string | undefined {\n if (url == null) {\n return undefined;\n }\n try {\n // NOTE: In non-browser environments, `globalThis.location` will be `undefined`.\n const base = globalThis.location?.href;\n return new URL(url, base).href;\n } catch {\n throw new Error(\n `Configuration: Could not parse user-provided export URL: '${url}'`\n );\n }\n}\n\n/**\n * @param userProvidedConfiguration Configuration options provided by the user in code.\n * @param fallbackConfiguration Fallback to use when the {@link userProvidedConfiguration} does not specify an option.\n * @param defaultConfiguration The defaults as defined by the exporter specification\n */\nexport function mergeOtlpHttpConfigurationWithDefaults(\n userProvidedConfiguration: Partial<OtlpHttpConfiguration>,\n fallbackConfiguration: Partial<OtlpHttpConfiguration>,\n defaultConfiguration: OtlpHttpConfiguration\n): OtlpHttpConfiguration {\n return {\n ...mergeOtlpSharedConfigurationWithDefaults(\n userProvidedConfiguration,\n fallbackConfiguration,\n defaultConfiguration\n ),\n headers: mergeHeaders(\n userProvidedConfiguration.headers,\n fallbackConfiguration.headers,\n defaultConfiguration.headers\n ),\n url:\n validateUserProvidedUrl(userProvidedConfiguration.url) ??\n fallbackConfiguration.url ??\n defaultConfiguration.url,\n };\n}\n\nexport function getHttpConfigurationDefaults(\n requiredHeaders: Record<string, string>,\n signalResourcePath: string\n): OtlpHttpConfiguration {\n return {\n ...getSharedConfigurationDefaults(),\n headers: async () => requiredHeaders,\n url: 'http://localhost:4318/' + signalResourcePath,\n };\n}\n"]}
@@ -1,34 +0,0 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
- import type { OtlpHttpConfiguration } from './otlp-http-configuration';
4
- import type * as http from 'http';
5
- import type * as https from 'https';
6
- export type HttpAgentFactory = (protocol: string) => http.Agent | https.Agent | Promise<http.Agent> | Promise<https.Agent>;
7
- export interface OtlpNodeHttpConfiguration extends OtlpHttpConfiguration {
8
- /**
9
- * Factory function for creating agents.
10
- *
11
- * @remarks
12
- * Prefer using {@link httpAgentFactoryFromOptions} over manually writing a factory function wherever possible.
13
- * If using a factory function (`HttpAgentFactory`), **do not import `http.Agent` or `https.Agent`
14
- * statically at the top of the file**.
15
- * Instead, use dynamic `import()` or `require()` to load the module. This ensures that the `http` or `https`
16
- * module is not loaded before `@opentelemetry/instrumentation-http` can instrument it.
17
- */
18
- agentFactory: HttpAgentFactory;
19
- /**
20
- * User agent header string to be appended to the exporter's value as a prefix.
21
- * Availablie since v1.49.0 of the spec.
22
- * Ref: https://opentelemetry.io/docs/specs/otel/protocol/exporter/#user-agent
23
- */
24
- userAgent?: string;
25
- }
26
- export declare function httpAgentFactoryFromOptions(options: http.AgentOptions | https.AgentOptions): HttpAgentFactory;
27
- /**
28
- * @param userProvidedConfiguration Configuration options provided by the user in code.
29
- * @param fallbackConfiguration Fallback to use when the {@link userProvidedConfiguration} does not specify an option.
30
- * @param defaultConfiguration The defaults as defined by the exporter specification
31
- */
32
- export declare function mergeOtlpNodeHttpConfigurationWithDefaults(userProvidedConfiguration: Partial<OtlpNodeHttpConfiguration>, fallbackConfiguration: Partial<OtlpNodeHttpConfiguration>, defaultConfiguration: OtlpNodeHttpConfiguration): OtlpNodeHttpConfiguration;
33
- export declare function getNodeHttpConfigurationDefaults(requiredHeaders: Record<string, string>, signalResourcePath: string): OtlpNodeHttpConfiguration;
34
- //# sourceMappingURL=otlp-node-http-configuration.d.ts.map
@@ -1,35 +0,0 @@
1
- import { getHttpConfigurationDefaults, mergeOtlpHttpConfigurationWithDefaults, } from './otlp-http-configuration';
2
- export function httpAgentFactoryFromOptions(options) {
3
- return async (protocol) => {
4
- const isInsecure = protocol === 'http:';
5
- const module = isInsecure ? import('http') : import('https');
6
- const { Agent } = await module;
7
- if (isInsecure) {
8
- // eslint-disable-next-line @typescript-eslint/no-unused-vars -- these props should not be used in agent options
9
- const { ca, cert, key, ...insecureOptions } = options;
10
- return new Agent(insecureOptions);
11
- }
12
- return new Agent(options);
13
- };
14
- }
15
- /**
16
- * @param userProvidedConfiguration Configuration options provided by the user in code.
17
- * @param fallbackConfiguration Fallback to use when the {@link userProvidedConfiguration} does not specify an option.
18
- * @param defaultConfiguration The defaults as defined by the exporter specification
19
- */
20
- export function mergeOtlpNodeHttpConfigurationWithDefaults(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration) {
21
- return {
22
- ...mergeOtlpHttpConfigurationWithDefaults(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration),
23
- agentFactory: userProvidedConfiguration.agentFactory ??
24
- fallbackConfiguration.agentFactory ??
25
- defaultConfiguration.agentFactory,
26
- userAgent: userProvidedConfiguration.userAgent,
27
- };
28
- }
29
- export function getNodeHttpConfigurationDefaults(requiredHeaders, signalResourcePath) {
30
- return {
31
- ...getHttpConfigurationDefaults(requiredHeaders, signalResourcePath),
32
- agentFactory: httpAgentFactoryFromOptions({ keepAlive: true }),
33
- };
34
- }
35
- //# sourceMappingURL=otlp-node-http-configuration.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"otlp-node-http-configuration.js","sourceRoot":"","sources":["../../../src/configuration/otlp-node-http-configuration.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,4BAA4B,EAC5B,sCAAsC,GACvC,MAAM,2BAA2B,CAAC;AA8BnC,MAAM,UAAU,2BAA2B,CACzC,OAA+C;IAE/C,OAAO,KAAK,EAAC,QAAQ,EAAC,EAAE;QACtB,MAAM,UAAU,GAAG,QAAQ,KAAK,OAAO,CAAC;QACxC,MAAM,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC7D,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAAC;QAE/B,IAAI,UAAU,EAAE;YACd,gHAAgH;YAChH,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,eAAe,EAAE,GACzC,OAA6B,CAAC;YAChC,OAAO,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;SACnC;QACD,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;IAC5B,CAAC,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,0CAA0C,CACxD,yBAA6D,EAC7D,qBAAyD,EACzD,oBAA+C;IAE/C,OAAO;QACL,GAAG,sCAAsC,CACvC,yBAAyB,EACzB,qBAAqB,EACrB,oBAAoB,CACrB;QACD,YAAY,EACV,yBAAyB,CAAC,YAAY;YACtC,qBAAqB,CAAC,YAAY;YAClC,oBAAoB,CAAC,YAAY;QACnC,SAAS,EAAE,yBAAyB,CAAC,SAAS;KAC/C,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,gCAAgC,CAC9C,eAAuC,EACvC,kBAA0B;IAE1B,OAAO;QACL,GAAG,4BAA4B,CAAC,eAAe,EAAE,kBAAkB,CAAC;QACpE,YAAY,EAAE,2BAA2B,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;KAC/D,CAAC;AACJ,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport type { OtlpHttpConfiguration } from './otlp-http-configuration';\nimport {\n getHttpConfigurationDefaults,\n mergeOtlpHttpConfigurationWithDefaults,\n} from './otlp-http-configuration';\n\n// NOTE: do not change these imports to be actual imports, otherwise they WILL break `@opentelemetry/instrumentation-http`\nimport type * as http from 'http';\nimport type * as https from 'https';\n\nexport type HttpAgentFactory = (\n protocol: string\n) => http.Agent | https.Agent | Promise<http.Agent> | Promise<https.Agent>;\n\nexport interface OtlpNodeHttpConfiguration extends OtlpHttpConfiguration {\n /**\n * Factory function for creating agents.\n *\n * @remarks\n * Prefer using {@link httpAgentFactoryFromOptions} over manually writing a factory function wherever possible.\n * If using a factory function (`HttpAgentFactory`), **do not import `http.Agent` or `https.Agent`\n * statically at the top of the file**.\n * Instead, use dynamic `import()` or `require()` to load the module. This ensures that the `http` or `https`\n * module is not loaded before `@opentelemetry/instrumentation-http` can instrument it.\n */\n agentFactory: HttpAgentFactory;\n /**\n * User agent header string to be appended to the exporter's value as a prefix.\n * Availablie since v1.49.0 of the spec.\n * Ref: https://opentelemetry.io/docs/specs/otel/protocol/exporter/#user-agent\n */\n userAgent?: string;\n}\n\nexport function httpAgentFactoryFromOptions(\n options: http.AgentOptions | https.AgentOptions\n): HttpAgentFactory {\n return async protocol => {\n const isInsecure = protocol === 'http:';\n const module = isInsecure ? import('http') : import('https');\n const { Agent } = await module;\n\n if (isInsecure) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars -- these props should not be used in agent options\n const { ca, cert, key, ...insecureOptions } =\n options as https.AgentOptions;\n return new Agent(insecureOptions);\n }\n return new Agent(options);\n };\n}\n\n/**\n * @param userProvidedConfiguration Configuration options provided by the user in code.\n * @param fallbackConfiguration Fallback to use when the {@link userProvidedConfiguration} does not specify an option.\n * @param defaultConfiguration The defaults as defined by the exporter specification\n */\nexport function mergeOtlpNodeHttpConfigurationWithDefaults(\n userProvidedConfiguration: Partial<OtlpNodeHttpConfiguration>,\n fallbackConfiguration: Partial<OtlpNodeHttpConfiguration>,\n defaultConfiguration: OtlpNodeHttpConfiguration\n): OtlpNodeHttpConfiguration {\n return {\n ...mergeOtlpHttpConfigurationWithDefaults(\n userProvidedConfiguration,\n fallbackConfiguration,\n defaultConfiguration\n ),\n agentFactory:\n userProvidedConfiguration.agentFactory ??\n fallbackConfiguration.agentFactory ??\n defaultConfiguration.agentFactory,\n userAgent: userProvidedConfiguration.userAgent,\n };\n}\n\nexport function getNodeHttpConfigurationDefaults(\n requiredHeaders: Record<string, string>,\n signalResourcePath: string\n): OtlpNodeHttpConfiguration {\n return {\n ...getHttpConfigurationDefaults(requiredHeaders, signalResourcePath),\n agentFactory: httpAgentFactoryFromOptions({ keepAlive: true }),\n };\n}\n"]}
@@ -1,9 +0,0 @@
1
- import type { OtlpNodeHttpConfiguration } from './otlp-node-http-configuration';
2
- /**
3
- * Reads and returns configuration from the environment
4
- *
5
- * @param signalIdentifier all caps part in environment variables that identifies the signal (e.g.: METRICS, TRACES, LOGS)
6
- * @param signalResourcePath signal resource path to append if necessary (e.g.: v1/metrics, v1/traces, v1/logs)
7
- */
8
- export declare function getNodeHttpConfigurationFromEnvironment(signalIdentifier: string, signalResourcePath: string): Partial<OtlpNodeHttpConfiguration>;
9
- //# sourceMappingURL=otlp-node-http-env-configuration.d.ts.map
@@ -1,119 +0,0 @@
1
- /*
2
- * Copyright The OpenTelemetry Authors
3
- * SPDX-License-Identifier: Apache-2.0
4
- */
5
- import * as fs from 'fs';
6
- import * as path from 'path';
7
- import { getStringFromEnv, parseKeyPairsIntoRecord } from '@opentelemetry/core';
8
- import { diag } from '@opentelemetry/api';
9
- import { getSharedConfigurationFromEnvironment } from './shared-env-configuration';
10
- import { wrapStaticHeadersInFunction } from './shared-configuration';
11
- import { httpAgentFactoryFromOptions } from './otlp-node-http-configuration';
12
- function getStaticHeadersFromEnv(signalIdentifier) {
13
- const signalSpecificRawHeaders = getStringFromEnv(`OTEL_EXPORTER_OTLP_${signalIdentifier}_HEADERS`);
14
- const nonSignalSpecificRawHeaders = getStringFromEnv('OTEL_EXPORTER_OTLP_HEADERS');
15
- const signalSpecificHeaders = parseKeyPairsIntoRecord(signalSpecificRawHeaders);
16
- const nonSignalSpecificHeaders = parseKeyPairsIntoRecord(nonSignalSpecificRawHeaders);
17
- if (Object.keys(signalSpecificHeaders).length === 0 &&
18
- Object.keys(nonSignalSpecificHeaders).length === 0) {
19
- return undefined;
20
- }
21
- // headers are combined instead of overwritten, with the specific headers taking precedence over
22
- // the non-specific ones.
23
- return Object.assign({}, parseKeyPairsIntoRecord(nonSignalSpecificRawHeaders), parseKeyPairsIntoRecord(signalSpecificRawHeaders));
24
- }
25
- function appendRootPathToUrlIfNeeded(url) {
26
- try {
27
- const parsedUrl = new URL(url);
28
- // This will automatically append '/' if there's no root path.
29
- return parsedUrl.toString();
30
- }
31
- catch {
32
- diag.warn(`Configuration: Could not parse environment-provided export URL: '${url}', falling back to undefined`);
33
- return undefined;
34
- }
35
- }
36
- function appendResourcePathToUrl(url, path) {
37
- try {
38
- // just try to parse, if it fails we catch and warn.
39
- new URL(url);
40
- }
41
- catch {
42
- diag.warn(`Configuration: Could not parse environment-provided export URL: '${url}', falling back to undefined`);
43
- return undefined;
44
- }
45
- if (!url.endsWith('/')) {
46
- url = url + '/';
47
- }
48
- url += path;
49
- try {
50
- // just try to parse, if it fails we catch and warn.
51
- new URL(url);
52
- }
53
- catch {
54
- diag.warn(`Configuration: Provided URL appended with '${path}' is not a valid URL, using 'undefined' instead of '${url}'`);
55
- return undefined;
56
- }
57
- return url;
58
- }
59
- function getNonSpecificUrlFromEnv(signalResourcePath) {
60
- const envUrl = getStringFromEnv('OTEL_EXPORTER_OTLP_ENDPOINT');
61
- if (envUrl === undefined) {
62
- return undefined;
63
- }
64
- return appendResourcePathToUrl(envUrl, signalResourcePath);
65
- }
66
- function getSpecificUrlFromEnv(signalIdentifier) {
67
- const envUrl = getStringFromEnv(`OTEL_EXPORTER_OTLP_${signalIdentifier}_ENDPOINT`);
68
- if (envUrl === undefined) {
69
- return undefined;
70
- }
71
- return appendRootPathToUrlIfNeeded(envUrl);
72
- }
73
- function readFileFromEnv(signalSpecificEnvVar, nonSignalSpecificEnvVar, warningMessage) {
74
- const signalSpecificPath = getStringFromEnv(signalSpecificEnvVar);
75
- const nonSignalSpecificPath = getStringFromEnv(nonSignalSpecificEnvVar);
76
- const filePath = signalSpecificPath ?? nonSignalSpecificPath;
77
- if (filePath != null) {
78
- try {
79
- return fs.readFileSync(path.resolve(process.cwd(), filePath));
80
- }
81
- catch {
82
- diag.warn(warningMessage);
83
- return undefined;
84
- }
85
- }
86
- else {
87
- return undefined;
88
- }
89
- }
90
- function getClientCertificateFromEnv(signalIdentifier) {
91
- return readFileFromEnv(`OTEL_EXPORTER_OTLP_${signalIdentifier}_CLIENT_CERTIFICATE`, 'OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE', 'Failed to read client certificate chain file');
92
- }
93
- function getClientKeyFromEnv(signalIdentifier) {
94
- return readFileFromEnv(`OTEL_EXPORTER_OTLP_${signalIdentifier}_CLIENT_KEY`, 'OTEL_EXPORTER_OTLP_CLIENT_KEY', 'Failed to read client certificate private key file');
95
- }
96
- function getRootCertificateFromEnv(signalIdentifier) {
97
- return readFileFromEnv(`OTEL_EXPORTER_OTLP_${signalIdentifier}_CERTIFICATE`, 'OTEL_EXPORTER_OTLP_CERTIFICATE', 'Failed to read root certificate file');
98
- }
99
- /**
100
- * Reads and returns configuration from the environment
101
- *
102
- * @param signalIdentifier all caps part in environment variables that identifies the signal (e.g.: METRICS, TRACES, LOGS)
103
- * @param signalResourcePath signal resource path to append if necessary (e.g.: v1/metrics, v1/traces, v1/logs)
104
- */
105
- export function getNodeHttpConfigurationFromEnvironment(signalIdentifier, signalResourcePath) {
106
- return {
107
- ...getSharedConfigurationFromEnvironment(signalIdentifier),
108
- url: getSpecificUrlFromEnv(signalIdentifier) ??
109
- getNonSpecificUrlFromEnv(signalResourcePath),
110
- headers: wrapStaticHeadersInFunction(getStaticHeadersFromEnv(signalIdentifier)),
111
- agentFactory: httpAgentFactoryFromOptions({
112
- keepAlive: true,
113
- ca: getRootCertificateFromEnv(signalIdentifier),
114
- cert: getClientCertificateFromEnv(signalIdentifier),
115
- key: getClientKeyFromEnv(signalIdentifier),
116
- }),
117
- };
118
- }
119
- //# sourceMappingURL=otlp-node-http-env-configuration.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"otlp-node-http-env-configuration.js","sourceRoot":"","sources":["../../../src/configuration/otlp-node-http-env-configuration.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,qCAAqC,EAAE,MAAM,4BAA4B,CAAC;AACnF,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAErE,OAAO,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAE7E,SAAS,uBAAuB,CAC9B,gBAAwB;IAExB,MAAM,wBAAwB,GAAG,gBAAgB,CAC/C,sBAAsB,gBAAgB,UAAU,CACjD,CAAC;IACF,MAAM,2BAA2B,GAAG,gBAAgB,CAClD,4BAA4B,CAC7B,CAAC;IAEF,MAAM,qBAAqB,GAAG,uBAAuB,CACnD,wBAAwB,CACzB,CAAC;IACF,MAAM,wBAAwB,GAAG,uBAAuB,CACtD,2BAA2B,CAC5B,CAAC;IAEF,IACE,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,MAAM,KAAK,CAAC;QAC/C,MAAM,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC,MAAM,KAAK,CAAC,EAClD;QACA,OAAO,SAAS,CAAC;KAClB;IAED,gGAAgG;IAChG,yBAAyB;IACzB,OAAO,MAAM,CAAC,MAAM,CAClB,EAAE,EACF,uBAAuB,CAAC,2BAA2B,CAAC,EACpD,uBAAuB,CAAC,wBAAwB,CAAC,CAClD,CAAC;AACJ,CAAC;AAED,SAAS,2BAA2B,CAAC,GAAW;IAC9C,IAAI;QACF,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;QAC/B,8DAA8D;QAC9D,OAAO,SAAS,CAAC,QAAQ,EAAE,CAAC;KAC7B;IAAC,MAAM;QACN,IAAI,CAAC,IAAI,CACP,oEAAoE,GAAG,8BAA8B,CACtG,CAAC;QACF,OAAO,SAAS,CAAC;KAClB;AACH,CAAC;AAED,SAAS,uBAAuB,CAC9B,GAAW,EACX,IAAY;IAEZ,IAAI;QACF,oDAAoD;QACpD,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;KACd;IAAC,MAAM;QACN,IAAI,CAAC,IAAI,CACP,oEAAoE,GAAG,8BAA8B,CACtG,CAAC;QACF,OAAO,SAAS,CAAC;KAClB;IAED,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QACtB,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;KACjB;IACD,GAAG,IAAI,IAAI,CAAC;IAEZ,IAAI;QACF,oDAAoD;QACpD,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;KACd;IAAC,MAAM;QACN,IAAI,CAAC,IAAI,CACP,8CAA8C,IAAI,uDAAuD,GAAG,GAAG,CAChH,CAAC;QACF,OAAO,SAAS,CAAC;KAClB;IAED,OAAO,GAAG,CAAC;AACb,CAAC;AAED,SAAS,wBAAwB,CAC/B,kBAA0B;IAE1B,MAAM,MAAM,GAAG,gBAAgB,CAAC,6BAA6B,CAAC,CAAC;IAC/D,IAAI,MAAM,KAAK,SAAS,EAAE;QACxB,OAAO,SAAS,CAAC;KAClB;IACD,OAAO,uBAAuB,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;AAC7D,CAAC;AAED,SAAS,qBAAqB,CAAC,gBAAwB;IACrD,MAAM,MAAM,GAAG,gBAAgB,CAC7B,sBAAsB,gBAAgB,WAAW,CAClD,CAAC;IACF,IAAI,MAAM,KAAK,SAAS,EAAE;QACxB,OAAO,SAAS,CAAC;KAClB;IACD,OAAO,2BAA2B,CAAC,MAAM,CAAC,CAAC;AAC7C,CAAC;AAED,SAAS,eAAe,CACtB,oBAA4B,EAC5B,uBAA+B,EAC/B,cAAsB;IAEtB,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,oBAAoB,CAAC,CAAC;IAClE,MAAM,qBAAqB,GAAG,gBAAgB,CAAC,uBAAuB,CAAC,CAAC;IACxE,MAAM,QAAQ,GAAG,kBAAkB,IAAI,qBAAqB,CAAC;IAE7D,IAAI,QAAQ,IAAI,IAAI,EAAE;QACpB,IAAI;YACF,OAAO,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC;SAC/D;QAAC,MAAM;YACN,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;YAC1B,OAAO,SAAS,CAAC;SAClB;KACF;SAAM;QACL,OAAO,SAAS,CAAC;KAClB;AACH,CAAC;AAED,SAAS,2BAA2B,CAClC,gBAAwB;IAExB,OAAO,eAAe,CACpB,sBAAsB,gBAAgB,qBAAqB,EAC3D,uCAAuC,EACvC,8CAA8C,CAC/C,CAAC;AACJ,CAAC;AAED,SAAS,mBAAmB,CAAC,gBAAwB;IACnD,OAAO,eAAe,CACpB,sBAAsB,gBAAgB,aAAa,EACnD,+BAA+B,EAC/B,oDAAoD,CACrD,CAAC;AACJ,CAAC;AAED,SAAS,yBAAyB,CAChC,gBAAwB;IAExB,OAAO,eAAe,CACpB,sBAAsB,gBAAgB,cAAc,EACpD,gCAAgC,EAChC,sCAAsC,CACvC,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,uCAAuC,CACrD,gBAAwB,EACxB,kBAA0B;IAE1B,OAAO;QACL,GAAG,qCAAqC,CAAC,gBAAgB,CAAC;QAC1D,GAAG,EACD,qBAAqB,CAAC,gBAAgB,CAAC;YACvC,wBAAwB,CAAC,kBAAkB,CAAC;QAC9C,OAAO,EAAE,2BAA2B,CAClC,uBAAuB,CAAC,gBAAgB,CAAC,CAC1C;QACD,YAAY,EAAE,2BAA2B,CAAC;YACxC,SAAS,EAAE,IAAI;YACf,EAAE,EAAE,yBAAyB,CAAC,gBAAgB,CAAC;YAC/C,IAAI,EAAE,2BAA2B,CAAC,gBAAgB,CAAC;YACnD,GAAG,EAAE,mBAAmB,CAAC,gBAAgB,CAAC;SAC3C,CAAC;KACH,CAAC;AACJ,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { getStringFromEnv, parseKeyPairsIntoRecord } from '@opentelemetry/core';\nimport { diag } from '@opentelemetry/api';\nimport { getSharedConfigurationFromEnvironment } from './shared-env-configuration';\nimport { wrapStaticHeadersInFunction } from './shared-configuration';\nimport type { OtlpNodeHttpConfiguration } from './otlp-node-http-configuration';\nimport { httpAgentFactoryFromOptions } from './otlp-node-http-configuration';\n\nfunction getStaticHeadersFromEnv(\n signalIdentifier: string\n): Record<string, string> | undefined {\n const signalSpecificRawHeaders = getStringFromEnv(\n `OTEL_EXPORTER_OTLP_${signalIdentifier}_HEADERS`\n );\n const nonSignalSpecificRawHeaders = getStringFromEnv(\n 'OTEL_EXPORTER_OTLP_HEADERS'\n );\n\n const signalSpecificHeaders = parseKeyPairsIntoRecord(\n signalSpecificRawHeaders\n );\n const nonSignalSpecificHeaders = parseKeyPairsIntoRecord(\n nonSignalSpecificRawHeaders\n );\n\n if (\n Object.keys(signalSpecificHeaders).length === 0 &&\n Object.keys(nonSignalSpecificHeaders).length === 0\n ) {\n return undefined;\n }\n\n // headers are combined instead of overwritten, with the specific headers taking precedence over\n // the non-specific ones.\n return Object.assign(\n {},\n parseKeyPairsIntoRecord(nonSignalSpecificRawHeaders),\n parseKeyPairsIntoRecord(signalSpecificRawHeaders)\n );\n}\n\nfunction appendRootPathToUrlIfNeeded(url: string): string | undefined {\n try {\n const parsedUrl = new URL(url);\n // This will automatically append '/' if there's no root path.\n return parsedUrl.toString();\n } catch {\n diag.warn(\n `Configuration: Could not parse environment-provided export URL: '${url}', falling back to undefined`\n );\n return undefined;\n }\n}\n\nfunction appendResourcePathToUrl(\n url: string,\n path: string\n): string | undefined {\n try {\n // just try to parse, if it fails we catch and warn.\n new URL(url);\n } catch {\n diag.warn(\n `Configuration: Could not parse environment-provided export URL: '${url}', falling back to undefined`\n );\n return undefined;\n }\n\n if (!url.endsWith('/')) {\n url = url + '/';\n }\n url += path;\n\n try {\n // just try to parse, if it fails we catch and warn.\n new URL(url);\n } catch {\n diag.warn(\n `Configuration: Provided URL appended with '${path}' is not a valid URL, using 'undefined' instead of '${url}'`\n );\n return undefined;\n }\n\n return url;\n}\n\nfunction getNonSpecificUrlFromEnv(\n signalResourcePath: string\n): string | undefined {\n const envUrl = getStringFromEnv('OTEL_EXPORTER_OTLP_ENDPOINT');\n if (envUrl === undefined) {\n return undefined;\n }\n return appendResourcePathToUrl(envUrl, signalResourcePath);\n}\n\nfunction getSpecificUrlFromEnv(signalIdentifier: string): string | undefined {\n const envUrl = getStringFromEnv(\n `OTEL_EXPORTER_OTLP_${signalIdentifier}_ENDPOINT`\n );\n if (envUrl === undefined) {\n return undefined;\n }\n return appendRootPathToUrlIfNeeded(envUrl);\n}\n\nfunction readFileFromEnv(\n signalSpecificEnvVar: string,\n nonSignalSpecificEnvVar: string,\n warningMessage: string\n): Buffer | undefined {\n const signalSpecificPath = getStringFromEnv(signalSpecificEnvVar);\n const nonSignalSpecificPath = getStringFromEnv(nonSignalSpecificEnvVar);\n const filePath = signalSpecificPath ?? nonSignalSpecificPath;\n\n if (filePath != null) {\n try {\n return fs.readFileSync(path.resolve(process.cwd(), filePath));\n } catch {\n diag.warn(warningMessage);\n return undefined;\n }\n } else {\n return undefined;\n }\n}\n\nfunction getClientCertificateFromEnv(\n signalIdentifier: string\n): Buffer | undefined {\n return readFileFromEnv(\n `OTEL_EXPORTER_OTLP_${signalIdentifier}_CLIENT_CERTIFICATE`,\n 'OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE',\n 'Failed to read client certificate chain file'\n );\n}\n\nfunction getClientKeyFromEnv(signalIdentifier: string): Buffer | undefined {\n return readFileFromEnv(\n `OTEL_EXPORTER_OTLP_${signalIdentifier}_CLIENT_KEY`,\n 'OTEL_EXPORTER_OTLP_CLIENT_KEY',\n 'Failed to read client certificate private key file'\n );\n}\n\nfunction getRootCertificateFromEnv(\n signalIdentifier: string\n): Buffer | undefined {\n return readFileFromEnv(\n `OTEL_EXPORTER_OTLP_${signalIdentifier}_CERTIFICATE`,\n 'OTEL_EXPORTER_OTLP_CERTIFICATE',\n 'Failed to read root certificate file'\n );\n}\n\n/**\n * Reads and returns configuration from the environment\n *\n * @param signalIdentifier all caps part in environment variables that identifies the signal (e.g.: METRICS, TRACES, LOGS)\n * @param signalResourcePath signal resource path to append if necessary (e.g.: v1/metrics, v1/traces, v1/logs)\n */\nexport function getNodeHttpConfigurationFromEnvironment(\n signalIdentifier: string,\n signalResourcePath: string\n): Partial<OtlpNodeHttpConfiguration> {\n return {\n ...getSharedConfigurationFromEnvironment(signalIdentifier),\n url:\n getSpecificUrlFromEnv(signalIdentifier) ??\n getNonSpecificUrlFromEnv(signalResourcePath),\n headers: wrapStaticHeadersInFunction(\n getStaticHeadersFromEnv(signalIdentifier)\n ),\n agentFactory: httpAgentFactoryFromOptions({\n keepAlive: true,\n ca: getRootCertificateFromEnv(signalIdentifier),\n cert: getClientCertificateFromEnv(signalIdentifier),\n key: getClientKeyFromEnv(signalIdentifier),\n }),\n };\n}\n"]}
@@ -1,24 +0,0 @@
1
- import type { HeadersFactory } from './otlp-http-configuration';
2
- /**
3
- * Configuration shared across all OTLP exporters
4
- *
5
- * Implementation note: anything added here MUST be
6
- * - platform-agnostic
7
- * - signal-agnostic
8
- * - transport-agnostic
9
- */
10
- export interface OtlpSharedConfiguration {
11
- timeoutMillis: number;
12
- concurrencyLimit: number;
13
- compression: 'gzip' | 'none';
14
- }
15
- export declare function validateTimeoutMillis(timeoutMillis: number): number;
16
- export declare function wrapStaticHeadersInFunction(headers: Record<string, string> | undefined): HeadersFactory | undefined;
17
- /**
18
- * @param userProvidedConfiguration Configuration options provided by the user in code.
19
- * @param fallbackConfiguration Fallback to use when the {@link userProvidedConfiguration} does not specify an option.
20
- * @param defaultConfiguration The defaults as defined by the exporter specification
21
- */
22
- export declare function mergeOtlpSharedConfigurationWithDefaults(userProvidedConfiguration: Partial<OtlpSharedConfiguration>, fallbackConfiguration: Partial<OtlpSharedConfiguration>, defaultConfiguration: OtlpSharedConfiguration): OtlpSharedConfiguration;
23
- export declare function getSharedConfigurationDefaults(): OtlpSharedConfiguration;
24
- //# sourceMappingURL=shared-configuration.d.ts.map
@@ -1,42 +0,0 @@
1
- /*
2
- * Copyright The OpenTelemetry Authors
3
- * SPDX-License-Identifier: Apache-2.0
4
- */
5
- export function validateTimeoutMillis(timeoutMillis) {
6
- if (Number.isFinite(timeoutMillis) && timeoutMillis > 0) {
7
- return timeoutMillis;
8
- }
9
- throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${timeoutMillis}')`);
10
- }
11
- export function wrapStaticHeadersInFunction(headers) {
12
- if (headers == null) {
13
- return undefined;
14
- }
15
- return async () => headers;
16
- }
17
- /**
18
- * @param userProvidedConfiguration Configuration options provided by the user in code.
19
- * @param fallbackConfiguration Fallback to use when the {@link userProvidedConfiguration} does not specify an option.
20
- * @param defaultConfiguration The defaults as defined by the exporter specification
21
- */
22
- export function mergeOtlpSharedConfigurationWithDefaults(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration) {
23
- return {
24
- timeoutMillis: validateTimeoutMillis(userProvidedConfiguration.timeoutMillis ??
25
- fallbackConfiguration.timeoutMillis ??
26
- defaultConfiguration.timeoutMillis),
27
- concurrencyLimit: userProvidedConfiguration.concurrencyLimit ??
28
- fallbackConfiguration.concurrencyLimit ??
29
- defaultConfiguration.concurrencyLimit,
30
- compression: userProvidedConfiguration.compression ??
31
- fallbackConfiguration.compression ??
32
- defaultConfiguration.compression,
33
- };
34
- }
35
- export function getSharedConfigurationDefaults() {
36
- return {
37
- timeoutMillis: 10000,
38
- concurrencyLimit: 30,
39
- compression: 'none',
40
- };
41
- }
42
- //# sourceMappingURL=shared-configuration.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"shared-configuration.js","sourceRoot":"","sources":["../../../src/configuration/shared-configuration.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAkBH,MAAM,UAAU,qBAAqB,CAAC,aAAqB;IACzD,IAAI,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,aAAa,GAAG,CAAC,EAAE;QACvD,OAAO,aAAa,CAAC;KACtB;IACD,MAAM,IAAI,KAAK,CACb,qFAAqF,aAAa,IAAI,CACvG,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,2BAA2B,CACzC,OAA2C;IAE3C,IAAI,OAAO,IAAI,IAAI,EAAE;QACnB,OAAO,SAAS,CAAC;KAClB;IAED,OAAO,KAAK,IAAI,EAAE,CAAC,OAAO,CAAC;AAC7B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,wCAAwC,CACtD,yBAA2D,EAC3D,qBAAuD,EACvD,oBAA6C;IAE7C,OAAO;QACL,aAAa,EAAE,qBAAqB,CAClC,yBAAyB,CAAC,aAAa;YACrC,qBAAqB,CAAC,aAAa;YACnC,oBAAoB,CAAC,aAAa,CACrC;QACD,gBAAgB,EACd,yBAAyB,CAAC,gBAAgB;YAC1C,qBAAqB,CAAC,gBAAgB;YACtC,oBAAoB,CAAC,gBAAgB;QACvC,WAAW,EACT,yBAAyB,CAAC,WAAW;YACrC,qBAAqB,CAAC,WAAW;YACjC,oBAAoB,CAAC,WAAW;KACnC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,8BAA8B;IAC5C,OAAO;QACL,aAAa,EAAE,KAAK;QACpB,gBAAgB,EAAE,EAAE;QACpB,WAAW,EAAE,MAAM;KACpB,CAAC;AACJ,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { HeadersFactory } from './otlp-http-configuration';\n\n/**\n * Configuration shared across all OTLP exporters\n *\n * Implementation note: anything added here MUST be\n * - platform-agnostic\n * - signal-agnostic\n * - transport-agnostic\n */\nexport interface OtlpSharedConfiguration {\n timeoutMillis: number;\n concurrencyLimit: number;\n compression: 'gzip' | 'none';\n}\n\nexport function validateTimeoutMillis(timeoutMillis: number) {\n if (Number.isFinite(timeoutMillis) && timeoutMillis > 0) {\n return timeoutMillis;\n }\n throw new Error(\n `Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${timeoutMillis}')`\n );\n}\n\nexport function wrapStaticHeadersInFunction(\n headers: Record<string, string> | undefined\n): HeadersFactory | undefined {\n if (headers == null) {\n return undefined;\n }\n\n return async () => headers;\n}\n\n/**\n * @param userProvidedConfiguration Configuration options provided by the user in code.\n * @param fallbackConfiguration Fallback to use when the {@link userProvidedConfiguration} does not specify an option.\n * @param defaultConfiguration The defaults as defined by the exporter specification\n */\nexport function mergeOtlpSharedConfigurationWithDefaults(\n userProvidedConfiguration: Partial<OtlpSharedConfiguration>,\n fallbackConfiguration: Partial<OtlpSharedConfiguration>,\n defaultConfiguration: OtlpSharedConfiguration\n): OtlpSharedConfiguration {\n return {\n timeoutMillis: validateTimeoutMillis(\n userProvidedConfiguration.timeoutMillis ??\n fallbackConfiguration.timeoutMillis ??\n defaultConfiguration.timeoutMillis\n ),\n concurrencyLimit:\n userProvidedConfiguration.concurrencyLimit ??\n fallbackConfiguration.concurrencyLimit ??\n defaultConfiguration.concurrencyLimit,\n compression:\n userProvidedConfiguration.compression ??\n fallbackConfiguration.compression ??\n defaultConfiguration.compression,\n };\n}\n\nexport function getSharedConfigurationDefaults(): OtlpSharedConfiguration {\n return {\n timeoutMillis: 10000,\n concurrencyLimit: 30,\n compression: 'none',\n };\n}\n"]}
@@ -1,3 +0,0 @@
1
- import type { OtlpSharedConfiguration } from './shared-configuration';
2
- export declare function getSharedConfigurationFromEnvironment(signalIdentifier: string): Partial<OtlpSharedConfiguration>;
3
- //# sourceMappingURL=shared-env-configuration.d.ts.map
@@ -1,41 +0,0 @@
1
- /*
2
- * Copyright The OpenTelemetry Authors
3
- * SPDX-License-Identifier: Apache-2.0
4
- */
5
- import { getNumberFromEnv, getStringFromEnv } from '@opentelemetry/core';
6
- import { diag } from '@opentelemetry/api';
7
- function parseAndValidateTimeoutFromEnv(timeoutEnvVar) {
8
- const envTimeout = getNumberFromEnv(timeoutEnvVar);
9
- if (envTimeout != null) {
10
- if (Number.isFinite(envTimeout) && envTimeout > 0) {
11
- return envTimeout;
12
- }
13
- diag.warn(`Configuration: ${timeoutEnvVar} is invalid, expected number greater than 0 (actual: ${envTimeout})`);
14
- }
15
- return undefined;
16
- }
17
- function getTimeoutFromEnv(signalIdentifier) {
18
- const specificTimeout = parseAndValidateTimeoutFromEnv(`OTEL_EXPORTER_OTLP_${signalIdentifier}_TIMEOUT`);
19
- const nonSpecificTimeout = parseAndValidateTimeoutFromEnv('OTEL_EXPORTER_OTLP_TIMEOUT');
20
- return specificTimeout ?? nonSpecificTimeout;
21
- }
22
- function parseAndValidateCompressionFromEnv(compressionEnvVar) {
23
- const compression = getStringFromEnv(compressionEnvVar)?.trim();
24
- if (compression == null || compression === 'none' || compression === 'gzip') {
25
- return compression;
26
- }
27
- diag.warn(`Configuration: ${compressionEnvVar} is invalid, expected 'none' or 'gzip' (actual: '${compression}')`);
28
- return undefined;
29
- }
30
- function getCompressionFromEnv(signalIdentifier) {
31
- const specificCompression = parseAndValidateCompressionFromEnv(`OTEL_EXPORTER_OTLP_${signalIdentifier}_COMPRESSION`);
32
- const nonSpecificCompression = parseAndValidateCompressionFromEnv('OTEL_EXPORTER_OTLP_COMPRESSION');
33
- return specificCompression ?? nonSpecificCompression;
34
- }
35
- export function getSharedConfigurationFromEnvironment(signalIdentifier) {
36
- return {
37
- timeoutMillis: getTimeoutFromEnv(signalIdentifier),
38
- compression: getCompressionFromEnv(signalIdentifier),
39
- };
40
- }
41
- //# sourceMappingURL=shared-env-configuration.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"shared-env-configuration.js","sourceRoot":"","sources":["../../../src/configuration/shared-env-configuration.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEzE,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,SAAS,8BAA8B,CACrC,aAAqB;IAErB,MAAM,UAAU,GAAG,gBAAgB,CAAC,aAAa,CAAC,CAAC;IACnD,IAAI,UAAU,IAAI,IAAI,EAAE;QACtB,IAAI,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,UAAU,GAAG,CAAC,EAAE;YACjD,OAAO,UAAU,CAAC;SACnB;QACD,IAAI,CAAC,IAAI,CACP,kBAAkB,aAAa,wDAAwD,UAAU,GAAG,CACrG,CAAC;KACH;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,iBAAiB,CAAC,gBAAwB;IACjD,MAAM,eAAe,GAAG,8BAA8B,CACpD,sBAAsB,gBAAgB,UAAU,CACjD,CAAC;IACF,MAAM,kBAAkB,GAAG,8BAA8B,CACvD,4BAA4B,CAC7B,CAAC;IAEF,OAAO,eAAe,IAAI,kBAAkB,CAAC;AAC/C,CAAC;AAED,SAAS,kCAAkC,CACzC,iBAAyB;IAEzB,MAAM,WAAW,GAAG,gBAAgB,CAAC,iBAAiB,CAAC,EAAE,IAAI,EAAE,CAAC;IAEhE,IAAI,WAAW,IAAI,IAAI,IAAI,WAAW,KAAK,MAAM,IAAI,WAAW,KAAK,MAAM,EAAE;QAC3E,OAAO,WAAW,CAAC;KACpB;IAED,IAAI,CAAC,IAAI,CACP,kBAAkB,iBAAiB,oDAAoD,WAAW,IAAI,CACvG,CAAC;IACF,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,qBAAqB,CAC5B,gBAAwB;IAExB,MAAM,mBAAmB,GAAG,kCAAkC,CAC5D,sBAAsB,gBAAgB,cAAc,CACrD,CAAC;IACF,MAAM,sBAAsB,GAAG,kCAAkC,CAC/D,gCAAgC,CACjC,CAAC;IAEF,OAAO,mBAAmB,IAAI,sBAAsB,CAAC;AACvD,CAAC;AAED,MAAM,UAAU,qCAAqC,CACnD,gBAAwB;IAExB,OAAO;QACL,aAAa,EAAE,iBAAiB,CAAC,gBAAgB,CAAC;QAClD,WAAW,EAAE,qBAAqB,CAAC,gBAAgB,CAAC;KACrD,CAAC;AACJ,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { getNumberFromEnv, getStringFromEnv } from '@opentelemetry/core';\nimport type { OtlpSharedConfiguration } from './shared-configuration';\nimport { diag } from '@opentelemetry/api';\n\nfunction parseAndValidateTimeoutFromEnv(\n timeoutEnvVar: string\n): number | undefined {\n const envTimeout = getNumberFromEnv(timeoutEnvVar);\n if (envTimeout != null) {\n if (Number.isFinite(envTimeout) && envTimeout > 0) {\n return envTimeout;\n }\n diag.warn(\n `Configuration: ${timeoutEnvVar} is invalid, expected number greater than 0 (actual: ${envTimeout})`\n );\n }\n\n return undefined;\n}\n\nfunction getTimeoutFromEnv(signalIdentifier: string) {\n const specificTimeout = parseAndValidateTimeoutFromEnv(\n `OTEL_EXPORTER_OTLP_${signalIdentifier}_TIMEOUT`\n );\n const nonSpecificTimeout = parseAndValidateTimeoutFromEnv(\n 'OTEL_EXPORTER_OTLP_TIMEOUT'\n );\n\n return specificTimeout ?? nonSpecificTimeout;\n}\n\nfunction parseAndValidateCompressionFromEnv(\n compressionEnvVar: string\n): 'none' | 'gzip' | undefined {\n const compression = getStringFromEnv(compressionEnvVar)?.trim();\n\n if (compression == null || compression === 'none' || compression === 'gzip') {\n return compression;\n }\n\n diag.warn(\n `Configuration: ${compressionEnvVar} is invalid, expected 'none' or 'gzip' (actual: '${compression}')`\n );\n return undefined;\n}\n\nfunction getCompressionFromEnv(\n signalIdentifier: string\n): 'none' | 'gzip' | undefined {\n const specificCompression = parseAndValidateCompressionFromEnv(\n `OTEL_EXPORTER_OTLP_${signalIdentifier}_COMPRESSION`\n );\n const nonSpecificCompression = parseAndValidateCompressionFromEnv(\n 'OTEL_EXPORTER_OTLP_COMPRESSION'\n );\n\n return specificCompression ?? nonSpecificCompression;\n}\n\nexport function getSharedConfigurationFromEnvironment(\n signalIdentifier: string\n): Partial<OtlpSharedConfiguration> {\n return {\n timeoutMillis: getTimeoutFromEnv(signalIdentifier),\n compression: getCompressionFromEnv(signalIdentifier),\n };\n}\n"]}
@@ -1,15 +0,0 @@
1
- export interface ExportResponseSuccess {
2
- status: 'success';
3
- data?: Uint8Array;
4
- }
5
- export interface ExportResponseFailure {
6
- status: 'failure';
7
- error: Error;
8
- }
9
- export interface ExportResponseRetryable {
10
- status: 'retryable';
11
- retryInMillis?: number;
12
- error?: Error;
13
- }
14
- export type ExportResponse = ExportResponseSuccess | ExportResponseFailure | ExportResponseRetryable;
15
- //# sourceMappingURL=export-response.d.ts.map
@@ -1,6 +0,0 @@
1
- /*
2
- * Copyright The OpenTelemetry Authors
3
- * SPDX-License-Identifier: Apache-2.0
4
- */
5
- export {};
6
- //# sourceMappingURL=export-response.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"export-response.js","sourceRoot":"","sources":["../../src/export-response.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport interface ExportResponseSuccess {\n status: 'success';\n data?: Uint8Array;\n}\n\nexport interface ExportResponseFailure {\n status: 'failure';\n error: Error;\n}\n\nexport interface ExportResponseRetryable {\n status: 'retryable';\n retryInMillis?: number;\n error?: Error;\n}\n\nexport type ExportResponse =\n | ExportResponseSuccess\n | ExportResponseFailure\n | ExportResponseRetryable;\n"]}
@@ -1,6 +0,0 @@
1
- import type { ExportResponse } from './export-response';
2
- export interface IExporterTransport {
3
- send(data: Uint8Array, timeoutMillis: number): Promise<ExportResponse>;
4
- shutdown(): void;
5
- }
6
- //# sourceMappingURL=exporter-transport.d.ts.map
@@ -1,6 +0,0 @@
1
- /*
2
- * Copyright The OpenTelemetry Authors
3
- * SPDX-License-Identifier: Apache-2.0
4
- */
5
- export {};
6
- //# sourceMappingURL=exporter-transport.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"exporter-transport.js","sourceRoot":"","sources":["../../src/exporter-transport.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { ExportResponse } from './export-response';\n\nexport interface IExporterTransport {\n send(data: Uint8Array, timeoutMillis: number): Promise<ExportResponse>;\n shutdown(): void;\n}\n"]}
@@ -1,7 +0,0 @@
1
- /**
2
- * @deprecated Use `createOtlpFetchExportDelegate` instead.
3
- */
4
- export { createOtlpSendBeaconExportDelegate } from './otlp-browser-http-export-delegate';
5
- export { convertLegacyBrowserHttpOptions } from './configuration/convert-legacy-browser-http-options';
6
- export { createLegacyOtlpBrowserExportDelegate, createLegacyOtlpBrowserExporterMetrics, } from './configuration/create-legacy-browser-delegate';
7
- //# sourceMappingURL=index-browser-http.d.ts.map
@@ -1,11 +0,0 @@
1
- /*
2
- * Copyright The OpenTelemetry Authors
3
- * SPDX-License-Identifier: Apache-2.0
4
- */
5
- /**
6
- * @deprecated Use `createOtlpFetchExportDelegate` instead.
7
- */
8
- export { createOtlpSendBeaconExportDelegate } from './otlp-browser-http-export-delegate';
9
- export { convertLegacyBrowserHttpOptions } from './configuration/convert-legacy-browser-http-options';
10
- export { createLegacyOtlpBrowserExportDelegate, createLegacyOtlpBrowserExporterMetrics, } from './configuration/create-legacy-browser-delegate';
11
- //# sourceMappingURL=index-browser-http.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-browser-http.js","sourceRoot":"","sources":["../../src/index-browser-http.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,OAAO,EAAE,kCAAkC,EAAE,MAAM,qCAAqC,CAAC;AAEzF,OAAO,EAAE,+BAA+B,EAAE,MAAM,qDAAqD,CAAC;AACtG,OAAO,EACL,qCAAqC,EACrC,sCAAsC,GACvC,MAAM,gDAAgD,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @deprecated Use `createOtlpFetchExportDelegate` instead.\n */\nexport { createOtlpSendBeaconExportDelegate } from './otlp-browser-http-export-delegate';\n\nexport { convertLegacyBrowserHttpOptions } from './configuration/convert-legacy-browser-http-options';\nexport {\n createLegacyOtlpBrowserExportDelegate,\n createLegacyOtlpBrowserExporterMetrics,\n} from './configuration/create-legacy-browser-delegate';\n"]}
@@ -1,5 +0,0 @@
1
- export { httpAgentFactoryFromOptions } from './configuration/otlp-node-http-configuration';
2
- export { createOtlpHttpExportDelegate, createOtlpHttpExporterMetrics, } from './otlp-http-export-delegate';
3
- export { getSharedConfigurationFromEnvironment } from './configuration/shared-env-configuration';
4
- export { convertLegacyHttpOptions } from './configuration/convert-legacy-node-http-options';
5
- //# sourceMappingURL=index-node-http.d.ts.map