@opentelemetry/otlp-exporter-base 0.54.2 → 0.56.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 (309) hide show
  1. package/README.md +1 -7
  2. package/build/esm/OTLPExporterBase.d.ts +7 -28
  3. package/build/esm/OTLPExporterBase.js +6 -69
  4. package/build/esm/OTLPExporterBase.js.map +1 -1
  5. package/build/esm/bounded-queue-export-promise-handler.d.ts +13 -0
  6. package/build/esm/bounded-queue-export-promise-handler.js +96 -0
  7. package/build/esm/bounded-queue-export-promise-handler.js.map +1 -0
  8. package/build/esm/configuration/convert-legacy-browser-http-options.d.ts +11 -0
  9. package/build/esm/configuration/convert-legacy-browser-http-options.js +34 -0
  10. package/build/esm/configuration/convert-legacy-browser-http-options.js.map +1 -0
  11. package/build/esm/configuration/convert-legacy-node-http-options.d.ts +11 -0
  12. package/build/esm/configuration/convert-legacy-node-http-options.js +45 -0
  13. package/build/esm/configuration/convert-legacy-node-http-options.js.map +1 -0
  14. package/build/esm/configuration/create-legacy-browser-delegate.d.ts +12 -0
  15. package/build/esm/configuration/create-legacy-browser-delegate.js +20 -0
  16. package/build/esm/configuration/create-legacy-browser-delegate.js.map +1 -0
  17. package/build/esm/configuration/legacy-base-configuration.d.ts +9 -0
  18. package/build/esm/configuration/legacy-base-configuration.js +2 -0
  19. package/build/esm/configuration/legacy-base-configuration.js.map +1 -0
  20. package/build/{esnext/platform/node/types.d.ts → esm/configuration/legacy-node-configuration.d.ts} +2 -2
  21. package/build/esm/{platform/node/index.js → configuration/legacy-node-configuration.js} +6 -3
  22. package/build/esm/configuration/legacy-node-configuration.js.map +1 -0
  23. package/build/esm/configuration/otlp-http-configuration.d.ts +5 -1
  24. package/build/esm/configuration/otlp-http-configuration.js +16 -14
  25. package/build/esm/configuration/otlp-http-configuration.js.map +1 -1
  26. package/build/esm/configuration/otlp-http-env-configuration.js +3 -2
  27. package/build/esm/configuration/otlp-http-env-configuration.js.map +1 -1
  28. package/build/esm/configuration/shared-configuration.d.ts +1 -0
  29. package/build/esm/configuration/shared-configuration.js +6 -0
  30. package/build/esm/configuration/shared-configuration.js.map +1 -1
  31. package/build/esm/index-browser-http.d.ts +4 -0
  32. package/build/esm/index-browser-http.js +19 -0
  33. package/build/esm/index-browser-http.js.map +1 -0
  34. package/build/esm/index-node-http.d.ts +4 -0
  35. package/build/esm/index-node-http.js +19 -0
  36. package/build/esm/index-node-http.js.map +1 -0
  37. package/build/esm/index.d.ts +5 -4
  38. package/build/esm/index.js +3 -7
  39. package/build/esm/index.js.map +1 -1
  40. package/build/esm/logging-response-handler.d.ts +6 -0
  41. package/build/esm/logging-response-handler.js +38 -0
  42. package/build/esm/logging-response-handler.js.map +1 -0
  43. package/build/esm/otlp-browser-http-export-delegate.d.ts +6 -0
  44. package/build/esm/otlp-browser-http-export-delegate.js +18 -0
  45. package/build/esm/otlp-browser-http-export-delegate.js.map +1 -0
  46. package/build/esm/otlp-export-delegate.d.ts +24 -0
  47. package/build/esm/otlp-export-delegate.js +155 -0
  48. package/build/esm/otlp-export-delegate.js.map +1 -0
  49. package/build/esm/otlp-http-export-delegate.d.ts +5 -0
  50. package/build/esm/otlp-http-export-delegate.js +29 -0
  51. package/build/esm/otlp-http-export-delegate.js.map +1 -0
  52. package/build/esm/otlp-network-export-delegate.d.ts +6 -0
  53. package/build/esm/otlp-network-export-delegate.js +25 -0
  54. package/build/esm/otlp-network-export-delegate.js.map +1 -0
  55. package/build/esm/response-handler.d.ts +12 -0
  56. package/build/esm/{platform/browser/index.js → response-handler.js} +2 -2
  57. package/build/esm/response-handler.js.map +1 -0
  58. package/build/esm/{platform/node → transport}/http-exporter-transport.d.ts +1 -1
  59. package/build/esm/transport/http-exporter-transport.js.map +1 -0
  60. package/build/{esnext/platform/node → esm/transport}/http-transport-types.d.ts +2 -2
  61. package/build/esm/transport/http-transport-types.js.map +1 -0
  62. package/build/{esnext/platform/node → esm/transport}/http-transport-utils.d.ts +2 -1
  63. package/build/esm/{platform/node → transport}/http-transport-utils.js +6 -6
  64. package/build/esm/transport/http-transport-utils.js.map +1 -0
  65. package/build/esm/{platform/browser → transport}/send-beacon-transport.d.ts +1 -1
  66. package/build/esm/transport/send-beacon-transport.js.map +1 -0
  67. package/build/{esnext/platform/browser → esm/transport}/xhr-transport.d.ts +2 -2
  68. package/build/esm/{platform/browser → transport}/xhr-transport.js +4 -3
  69. package/build/esm/transport/xhr-transport.js.map +1 -0
  70. package/build/esm/types.d.ts +0 -11
  71. package/build/esm/types.js.map +1 -1
  72. package/build/esm/util.d.ts +1 -1
  73. package/build/esm/util.js +14 -12
  74. package/build/esm/util.js.map +1 -1
  75. package/build/esm/version.d.ts +1 -1
  76. package/build/esm/version.js +1 -1
  77. package/build/esm/version.js.map +1 -1
  78. package/build/esnext/OTLPExporterBase.d.ts +7 -28
  79. package/build/esnext/OTLPExporterBase.js +6 -67
  80. package/build/esnext/OTLPExporterBase.js.map +1 -1
  81. package/build/esnext/bounded-queue-export-promise-handler.d.ts +13 -0
  82. package/build/esnext/bounded-queue-export-promise-handler.js +49 -0
  83. package/build/esnext/bounded-queue-export-promise-handler.js.map +1 -0
  84. package/build/esnext/configuration/convert-legacy-browser-http-options.d.ts +11 -0
  85. package/build/esnext/configuration/convert-legacy-browser-http-options.js +34 -0
  86. package/build/esnext/configuration/convert-legacy-browser-http-options.js.map +1 -0
  87. package/build/esnext/configuration/convert-legacy-node-http-options.d.ts +11 -0
  88. package/build/esnext/configuration/convert-legacy-node-http-options.js +45 -0
  89. package/build/esnext/configuration/convert-legacy-node-http-options.js.map +1 -0
  90. package/build/esnext/configuration/create-legacy-browser-delegate.d.ts +12 -0
  91. package/build/esnext/configuration/create-legacy-browser-delegate.js +20 -0
  92. package/build/esnext/configuration/create-legacy-browser-delegate.js.map +1 -0
  93. package/build/esnext/configuration/legacy-base-configuration.d.ts +9 -0
  94. package/build/esnext/configuration/legacy-base-configuration.js +2 -0
  95. package/build/esnext/configuration/legacy-base-configuration.js.map +1 -0
  96. package/build/{src/platform/node/types.d.ts → esnext/configuration/legacy-node-configuration.d.ts} +2 -2
  97. package/build/{esm/platform/index.js → esnext/configuration/legacy-node-configuration.js} +6 -3
  98. package/build/esnext/configuration/legacy-node-configuration.js.map +1 -0
  99. package/build/esnext/configuration/otlp-http-configuration.d.ts +5 -1
  100. package/build/esnext/configuration/otlp-http-configuration.js +16 -14
  101. package/build/esnext/configuration/otlp-http-configuration.js.map +1 -1
  102. package/build/esnext/configuration/otlp-http-env-configuration.js +3 -2
  103. package/build/esnext/configuration/otlp-http-env-configuration.js.map +1 -1
  104. package/build/esnext/configuration/shared-configuration.d.ts +1 -0
  105. package/build/esnext/configuration/shared-configuration.js +6 -0
  106. package/build/esnext/configuration/shared-configuration.js.map +1 -1
  107. package/build/esnext/index-browser-http.d.ts +4 -0
  108. package/build/esnext/index-browser-http.js +19 -0
  109. package/build/esnext/index-browser-http.js.map +1 -0
  110. package/build/esnext/index-node-http.d.ts +4 -0
  111. package/build/esnext/index-node-http.js +19 -0
  112. package/build/esnext/index-node-http.js.map +1 -0
  113. package/build/esnext/index.d.ts +5 -4
  114. package/build/esnext/index.js +3 -7
  115. package/build/esnext/index.js.map +1 -1
  116. package/build/esnext/logging-response-handler.d.ts +6 -0
  117. package/build/esnext/logging-response-handler.js +38 -0
  118. package/build/esnext/logging-response-handler.js.map +1 -0
  119. package/build/esnext/otlp-browser-http-export-delegate.d.ts +6 -0
  120. package/build/esnext/otlp-browser-http-export-delegate.js +18 -0
  121. package/build/esnext/otlp-browser-http-export-delegate.js.map +1 -0
  122. package/build/esnext/otlp-export-delegate.d.ts +24 -0
  123. package/build/esnext/otlp-export-delegate.js +105 -0
  124. package/build/esnext/otlp-export-delegate.js.map +1 -0
  125. package/build/esnext/otlp-http-export-delegate.d.ts +5 -0
  126. package/build/esnext/otlp-http-export-delegate.js +29 -0
  127. package/build/esnext/otlp-http-export-delegate.js.map +1 -0
  128. package/build/esnext/otlp-network-export-delegate.d.ts +6 -0
  129. package/build/esnext/otlp-network-export-delegate.js +25 -0
  130. package/build/esnext/otlp-network-export-delegate.js.map +1 -0
  131. package/build/esnext/response-handler.d.ts +12 -0
  132. package/build/esnext/{platform/browser/index.js → response-handler.js} +2 -2
  133. package/build/esnext/response-handler.js.map +1 -0
  134. package/build/esnext/{platform/node → transport}/http-exporter-transport.d.ts +1 -1
  135. package/build/esnext/transport/http-exporter-transport.js.map +1 -0
  136. package/build/{src/platform/node → esnext/transport}/http-transport-types.d.ts +2 -2
  137. package/build/esnext/transport/http-transport-types.js.map +1 -0
  138. package/build/{esm/platform/node → esnext/transport}/http-transport-utils.d.ts +2 -1
  139. package/build/esnext/{platform/node → transport}/http-transport-utils.js +6 -6
  140. package/build/esnext/transport/http-transport-utils.js.map +1 -0
  141. package/build/{src/platform/browser → esnext/transport}/send-beacon-transport.d.ts +1 -1
  142. package/build/esnext/transport/send-beacon-transport.js.map +1 -0
  143. package/build/{src/platform/browser → esnext/transport}/xhr-transport.d.ts +2 -2
  144. package/build/esnext/{platform/browser → transport}/xhr-transport.js +4 -3
  145. package/build/esnext/transport/xhr-transport.js.map +1 -0
  146. package/build/esnext/types.d.ts +0 -11
  147. package/build/esnext/types.js.map +1 -1
  148. package/build/esnext/util.d.ts +1 -1
  149. package/build/esnext/util.js +14 -11
  150. package/build/esnext/util.js.map +1 -1
  151. package/build/esnext/version.d.ts +1 -1
  152. package/build/esnext/version.js +1 -1
  153. package/build/esnext/version.js.map +1 -1
  154. package/build/src/OTLPExporterBase.d.ts +7 -28
  155. package/build/src/OTLPExporterBase.js +6 -67
  156. package/build/src/OTLPExporterBase.js.map +1 -1
  157. package/build/src/bounded-queue-export-promise-handler.d.ts +13 -0
  158. package/build/src/bounded-queue-export-promise-handler.js +53 -0
  159. package/build/src/bounded-queue-export-promise-handler.js.map +1 -0
  160. package/build/src/configuration/convert-legacy-browser-http-options.d.ts +11 -0
  161. package/build/src/configuration/convert-legacy-browser-http-options.js +38 -0
  162. package/build/src/configuration/convert-legacy-browser-http-options.js.map +1 -0
  163. package/build/src/configuration/convert-legacy-node-http-options.d.ts +11 -0
  164. package/build/src/configuration/convert-legacy-node-http-options.js +49 -0
  165. package/build/src/configuration/convert-legacy-node-http-options.js.map +1 -0
  166. package/build/src/configuration/create-legacy-browser-delegate.d.ts +12 -0
  167. package/build/src/configuration/create-legacy-browser-delegate.js +24 -0
  168. package/build/src/configuration/create-legacy-browser-delegate.js.map +1 -0
  169. package/build/src/configuration/legacy-base-configuration.d.ts +9 -0
  170. package/build/src/configuration/legacy-base-configuration.js +3 -0
  171. package/build/src/configuration/legacy-base-configuration.js.map +1 -0
  172. package/build/{esm/platform/node/types.d.ts → src/configuration/legacy-node-configuration.d.ts} +2 -2
  173. package/build/src/{platform/browser/index.js → configuration/legacy-node-configuration.js} +7 -4
  174. package/build/src/configuration/legacy-node-configuration.js.map +1 -0
  175. package/build/src/configuration/otlp-http-configuration.d.ts +5 -1
  176. package/build/src/configuration/otlp-http-configuration.js +16 -14
  177. package/build/src/configuration/otlp-http-configuration.js.map +1 -1
  178. package/build/src/configuration/otlp-http-env-configuration.js +3 -2
  179. package/build/src/configuration/otlp-http-env-configuration.js.map +1 -1
  180. package/build/src/configuration/shared-configuration.d.ts +1 -0
  181. package/build/src/configuration/shared-configuration.js +8 -1
  182. package/build/src/configuration/shared-configuration.js.map +1 -1
  183. package/build/src/index-browser-http.d.ts +4 -0
  184. package/build/src/index-browser-http.js +26 -0
  185. package/build/src/index-browser-http.js.map +1 -0
  186. package/build/src/index-node-http.d.ts +4 -0
  187. package/build/src/index-node-http.js +25 -0
  188. package/build/src/index-node-http.js.map +1 -0
  189. package/build/src/index.d.ts +5 -4
  190. package/build/src/index.js +5 -19
  191. package/build/src/index.js.map +1 -1
  192. package/build/src/logging-response-handler.d.ts +6 -0
  193. package/build/src/logging-response-handler.js +42 -0
  194. package/build/src/logging-response-handler.js.map +1 -0
  195. package/build/src/otlp-browser-http-export-delegate.d.ts +6 -0
  196. package/build/src/otlp-browser-http-export-delegate.js +23 -0
  197. package/build/src/otlp-browser-http-export-delegate.js.map +1 -0
  198. package/build/src/otlp-export-delegate.d.ts +24 -0
  199. package/build/src/otlp-export-delegate.js +109 -0
  200. package/build/src/otlp-export-delegate.js.map +1 -0
  201. package/build/src/otlp-http-export-delegate.d.ts +5 -0
  202. package/build/src/otlp-http-export-delegate.js +33 -0
  203. package/build/src/otlp-http-export-delegate.js.map +1 -0
  204. package/build/src/otlp-network-export-delegate.d.ts +6 -0
  205. package/build/src/otlp-network-export-delegate.js +29 -0
  206. package/build/src/otlp-network-export-delegate.js.map +1 -0
  207. package/build/src/response-handler.d.ts +12 -0
  208. package/build/src/response-handler.js +18 -0
  209. package/build/src/response-handler.js.map +1 -0
  210. package/build/src/{platform/node → transport}/http-exporter-transport.d.ts +1 -1
  211. package/build/src/transport/http-exporter-transport.js.map +1 -0
  212. package/build/{esm/platform/node → src/transport}/http-transport-types.d.ts +2 -2
  213. package/build/src/transport/http-transport-types.js.map +1 -0
  214. package/build/src/{platform/node → transport}/http-transport-utils.d.ts +2 -1
  215. package/build/src/{platform/node → transport}/http-transport-utils.js +7 -6
  216. package/build/src/transport/http-transport-utils.js.map +1 -0
  217. package/build/{esnext/platform/browser → src/transport}/send-beacon-transport.d.ts +1 -1
  218. package/build/src/transport/send-beacon-transport.js.map +1 -0
  219. package/build/{esm/platform/browser → src/transport}/xhr-transport.d.ts +2 -2
  220. package/build/src/{platform/browser → transport}/xhr-transport.js +4 -3
  221. package/build/src/transport/xhr-transport.js.map +1 -0
  222. package/build/src/types.d.ts +0 -11
  223. package/build/src/types.js.map +1 -1
  224. package/build/src/util.d.ts +1 -1
  225. package/build/src/util.js +14 -11
  226. package/build/src/util.js.map +1 -1
  227. package/build/src/version.d.ts +1 -1
  228. package/build/src/version.js +1 -1
  229. package/build/src/version.js.map +1 -1
  230. package/package.json +42 -15
  231. package/build/esm/platform/browser/OTLPExporterBrowserBase.d.ts +0 -21
  232. package/build/esm/platform/browser/OTLPExporterBrowserBase.js +0 -118
  233. package/build/esm/platform/browser/OTLPExporterBrowserBase.js.map +0 -1
  234. package/build/esm/platform/browser/index.d.ts +0 -2
  235. package/build/esm/platform/browser/index.js.map +0 -1
  236. package/build/esm/platform/browser/send-beacon-transport.js.map +0 -1
  237. package/build/esm/platform/browser/xhr-transport.js.map +0 -1
  238. package/build/esm/platform/index.d.ts +0 -3
  239. package/build/esm/platform/index.js.map +0 -1
  240. package/build/esm/platform/node/OTLPExporterNodeBase.d.ts +0 -16
  241. package/build/esm/platform/node/OTLPExporterNodeBase.js +0 -109
  242. package/build/esm/platform/node/OTLPExporterNodeBase.js.map +0 -1
  243. package/build/esm/platform/node/convert-legacy-agent-options.d.ts +0 -12
  244. package/build/esm/platform/node/convert-legacy-agent-options.js +0 -27
  245. package/build/esm/platform/node/convert-legacy-agent-options.js.map +0 -1
  246. package/build/esm/platform/node/http-exporter-transport.js.map +0 -1
  247. package/build/esm/platform/node/http-transport-types.js.map +0 -1
  248. package/build/esm/platform/node/http-transport-utils.js.map +0 -1
  249. package/build/esm/platform/node/index.d.ts +0 -3
  250. package/build/esm/platform/node/index.js.map +0 -1
  251. package/build/esm/platform/node/types.js +0 -6
  252. package/build/esm/platform/node/types.js.map +0 -1
  253. package/build/esnext/platform/browser/OTLPExporterBrowserBase.d.ts +0 -21
  254. package/build/esnext/platform/browser/OTLPExporterBrowserBase.js +0 -97
  255. package/build/esnext/platform/browser/OTLPExporterBrowserBase.js.map +0 -1
  256. package/build/esnext/platform/browser/index.d.ts +0 -2
  257. package/build/esnext/platform/browser/index.js.map +0 -1
  258. package/build/esnext/platform/browser/send-beacon-transport.js.map +0 -1
  259. package/build/esnext/platform/browser/xhr-transport.js.map +0 -1
  260. package/build/esnext/platform/index.d.ts +0 -3
  261. package/build/esnext/platform/index.js +0 -18
  262. package/build/esnext/platform/index.js.map +0 -1
  263. package/build/esnext/platform/node/OTLPExporterNodeBase.d.ts +0 -16
  264. package/build/esnext/platform/node/OTLPExporterNodeBase.js +0 -88
  265. package/build/esnext/platform/node/OTLPExporterNodeBase.js.map +0 -1
  266. package/build/esnext/platform/node/convert-legacy-agent-options.d.ts +0 -12
  267. package/build/esnext/platform/node/convert-legacy-agent-options.js +0 -27
  268. package/build/esnext/platform/node/convert-legacy-agent-options.js.map +0 -1
  269. package/build/esnext/platform/node/http-exporter-transport.js.map +0 -1
  270. package/build/esnext/platform/node/http-transport-types.js.map +0 -1
  271. package/build/esnext/platform/node/http-transport-utils.js.map +0 -1
  272. package/build/esnext/platform/node/index.d.ts +0 -3
  273. package/build/esnext/platform/node/index.js +0 -18
  274. package/build/esnext/platform/node/index.js.map +0 -1
  275. package/build/esnext/platform/node/types.js +0 -6
  276. package/build/esnext/platform/node/types.js.map +0 -1
  277. package/build/src/platform/browser/OTLPExporterBrowserBase.d.ts +0 -21
  278. package/build/src/platform/browser/OTLPExporterBrowserBase.js +0 -101
  279. package/build/src/platform/browser/OTLPExporterBrowserBase.js.map +0 -1
  280. package/build/src/platform/browser/index.d.ts +0 -2
  281. package/build/src/platform/browser/index.js.map +0 -1
  282. package/build/src/platform/browser/send-beacon-transport.js.map +0 -1
  283. package/build/src/platform/browser/xhr-transport.js.map +0 -1
  284. package/build/src/platform/index.d.ts +0 -3
  285. package/build/src/platform/index.js +0 -24
  286. package/build/src/platform/index.js.map +0 -1
  287. package/build/src/platform/node/OTLPExporterNodeBase.d.ts +0 -16
  288. package/build/src/platform/node/OTLPExporterNodeBase.js +0 -92
  289. package/build/src/platform/node/OTLPExporterNodeBase.js.map +0 -1
  290. package/build/src/platform/node/convert-legacy-agent-options.d.ts +0 -12
  291. package/build/src/platform/node/convert-legacy-agent-options.js +0 -31
  292. package/build/src/platform/node/convert-legacy-agent-options.js.map +0 -1
  293. package/build/src/platform/node/http-exporter-transport.js.map +0 -1
  294. package/build/src/platform/node/http-transport-types.js.map +0 -1
  295. package/build/src/platform/node/http-transport-utils.js.map +0 -1
  296. package/build/src/platform/node/index.d.ts +0 -3
  297. package/build/src/platform/node/index.js +0 -23
  298. package/build/src/platform/node/index.js.map +0 -1
  299. package/build/src/platform/node/types.js +0 -9
  300. package/build/src/platform/node/types.js.map +0 -1
  301. /package/build/esm/{platform/node → transport}/http-exporter-transport.js +0 -0
  302. /package/build/esm/{platform/node → transport}/http-transport-types.js +0 -0
  303. /package/build/esm/{platform/browser → transport}/send-beacon-transport.js +0 -0
  304. /package/build/esnext/{platform/node → transport}/http-exporter-transport.js +0 -0
  305. /package/build/esnext/{platform/node → transport}/http-transport-types.js +0 -0
  306. /package/build/esnext/{platform/browser → transport}/send-beacon-transport.js +0 -0
  307. /package/build/src/{platform/node → transport}/http-exporter-transport.js +0 -0
  308. /package/build/src/{platform/node → transport}/http-transport-types.js +0 -0
  309. /package/build/src/{platform/browser → transport}/send-beacon-transport.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"shared-configuration.js","sourceRoot":"","sources":["../../../src/configuration/shared-configuration.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAgBH,SAAgB,qBAAqB,CAAC,aAAqB;IACzD,IACE,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC;QAC5B,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC;QAC9B,aAAa,GAAG,CAAC,EACjB;QACA,OAAO,aAAa,CAAC;KACtB;IACD,MAAM,IAAI,KAAK,CACb,qFAAqF,aAAa,IAAI,CACvG,CAAC;AACJ,CAAC;AAXD,sDAWC;AAED;;;;GAIG;AACH,SAAgB,wCAAwC,CACtD,yBAA2D,EAC3D,qBAAuD,EACvD,oBAA6C;;IAE7C,OAAO;QACL,aAAa,EAAE,qBAAqB,CAClC,MAAA,MAAA,yBAAyB,CAAC,aAAa,mCACrC,qBAAqB,CAAC,aAAa,mCACnC,oBAAoB,CAAC,aAAa,CACrC;QACD,gBAAgB,EACd,MAAA,MAAA,yBAAyB,CAAC,gBAAgB,mCAC1C,qBAAqB,CAAC,gBAAgB,mCACtC,oBAAoB,CAAC,gBAAgB;QACvC,WAAW,EACT,MAAA,MAAA,yBAAyB,CAAC,WAAW,mCACrC,qBAAqB,CAAC,WAAW,mCACjC,oBAAoB,CAAC,WAAW;KACnC,CAAC;AACJ,CAAC;AApBD,4FAoBC;AAED,SAAgB,8BAA8B;IAC5C,OAAO;QACL,aAAa,EAAE,KAAK;QACpB,gBAAgB,EAAE,EAAE;QACpB,WAAW,EAAE,MAAM;KACpB,CAAC;AACJ,CAAC;AAND,wEAMC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\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 (\n !Number.isNaN(timeoutMillis) &&\n Number.isFinite(timeoutMillis) &&\n timeoutMillis > 0\n ) {\n return timeoutMillis;\n }\n throw new Error(\n `Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${timeoutMillis}')`\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 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
+ {"version":3,"file":"shared-configuration.js","sourceRoot":"","sources":["../../../src/configuration/shared-configuration.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAgBH,SAAgB,qBAAqB,CAAC,aAAqB;IACzD,IACE,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC;QAC5B,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC;QAC9B,aAAa,GAAG,CAAC,EACjB;QACA,OAAO,aAAa,CAAC;KACtB;IACD,MAAM,IAAI,KAAK,CACb,qFAAqF,aAAa,IAAI,CACvG,CAAC;AACJ,CAAC;AAXD,sDAWC;AAED,SAAgB,2BAA2B,CACzC,OAA2C;IAE3C,IAAI,OAAO,IAAI,IAAI,EAAE;QACnB,OAAO,SAAS,CAAC;KAClB;IAED,OAAO,GAAG,EAAE,CAAC,OAAO,CAAC;AACvB,CAAC;AARD,kEAQC;AAED;;;;GAIG;AACH,SAAgB,wCAAwC,CACtD,yBAA2D,EAC3D,qBAAuD,EACvD,oBAA6C;;IAE7C,OAAO;QACL,aAAa,EAAE,qBAAqB,CAClC,MAAA,MAAA,yBAAyB,CAAC,aAAa,mCACrC,qBAAqB,CAAC,aAAa,mCACnC,oBAAoB,CAAC,aAAa,CACrC;QACD,gBAAgB,EACd,MAAA,MAAA,yBAAyB,CAAC,gBAAgB,mCAC1C,qBAAqB,CAAC,gBAAgB,mCACtC,oBAAoB,CAAC,gBAAgB;QACvC,WAAW,EACT,MAAA,MAAA,yBAAyB,CAAC,WAAW,mCACrC,qBAAqB,CAAC,WAAW,mCACjC,oBAAoB,CAAC,WAAW;KACnC,CAAC;AACJ,CAAC;AApBD,4FAoBC;AAED,SAAgB,8BAA8B;IAC5C,OAAO;QACL,aAAa,EAAE,KAAK;QACpB,gBAAgB,EAAE,EAAE;QACpB,WAAW,EAAE,MAAM;KACpB,CAAC;AACJ,CAAC;AAND,wEAMC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\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 (\n !Number.isNaN(timeoutMillis) &&\n Number.isFinite(timeoutMillis) &&\n timeoutMillis > 0\n ) {\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): (() => Record<string, string>) | undefined {\n if (headers == null) {\n return undefined;\n }\n\n return () => 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"]}
@@ -0,0 +1,4 @@
1
+ export { createOtlpXhrExportDelegate, createOtlpSendBeaconExportDelegate, } from './otlp-browser-http-export-delegate';
2
+ export { convertLegacyBrowserHttpOptions } from './configuration/convert-legacy-browser-http-options';
3
+ export { createLegacyOtlpBrowserExportDelegate } from './configuration/create-legacy-browser-delegate';
4
+ //# sourceMappingURL=index-browser-http.d.ts.map
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright The OpenTelemetry Authors
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * https://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.createLegacyOtlpBrowserExportDelegate = exports.convertLegacyBrowserHttpOptions = exports.createOtlpSendBeaconExportDelegate = exports.createOtlpXhrExportDelegate = void 0;
19
+ var otlp_browser_http_export_delegate_1 = require("./otlp-browser-http-export-delegate");
20
+ Object.defineProperty(exports, "createOtlpXhrExportDelegate", { enumerable: true, get: function () { return otlp_browser_http_export_delegate_1.createOtlpXhrExportDelegate; } });
21
+ Object.defineProperty(exports, "createOtlpSendBeaconExportDelegate", { enumerable: true, get: function () { return otlp_browser_http_export_delegate_1.createOtlpSendBeaconExportDelegate; } });
22
+ var convert_legacy_browser_http_options_1 = require("./configuration/convert-legacy-browser-http-options");
23
+ Object.defineProperty(exports, "convertLegacyBrowserHttpOptions", { enumerable: true, get: function () { return convert_legacy_browser_http_options_1.convertLegacyBrowserHttpOptions; } });
24
+ var create_legacy_browser_delegate_1 = require("./configuration/create-legacy-browser-delegate");
25
+ Object.defineProperty(exports, "createLegacyOtlpBrowserExportDelegate", { enumerable: true, get: function () { return create_legacy_browser_delegate_1.createLegacyOtlpBrowserExportDelegate; } });
26
+ //# sourceMappingURL=index-browser-http.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-browser-http.js","sourceRoot":"","sources":["../../src/index-browser-http.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,yFAG6C;AAF3C,gJAAA,2BAA2B,OAAA;AAC3B,uJAAA,kCAAkC,OAAA;AAGpC,2GAAsG;AAA7F,sJAAA,+BAA+B,OAAA;AACxC,iGAAuG;AAA9F,uJAAA,qCAAqC,OAAA","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport {\n createOtlpXhrExportDelegate,\n createOtlpSendBeaconExportDelegate,\n} from './otlp-browser-http-export-delegate';\n\nexport { convertLegacyBrowserHttpOptions } from './configuration/convert-legacy-browser-http-options';\nexport { createLegacyOtlpBrowserExportDelegate } from './configuration/create-legacy-browser-delegate';\n"]}
@@ -0,0 +1,4 @@
1
+ export { createOtlpHttpExportDelegate } from './otlp-http-export-delegate';
2
+ export { getSharedConfigurationFromEnvironment } from './configuration/shared-env-configuration';
3
+ export { convertLegacyHttpOptions } from './configuration/convert-legacy-node-http-options';
4
+ //# sourceMappingURL=index-node-http.d.ts.map
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright The OpenTelemetry Authors
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * https://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.convertLegacyHttpOptions = exports.getSharedConfigurationFromEnvironment = exports.createOtlpHttpExportDelegate = void 0;
19
+ var otlp_http_export_delegate_1 = require("./otlp-http-export-delegate");
20
+ Object.defineProperty(exports, "createOtlpHttpExportDelegate", { enumerable: true, get: function () { return otlp_http_export_delegate_1.createOtlpHttpExportDelegate; } });
21
+ var shared_env_configuration_1 = require("./configuration/shared-env-configuration");
22
+ Object.defineProperty(exports, "getSharedConfigurationFromEnvironment", { enumerable: true, get: function () { return shared_env_configuration_1.getSharedConfigurationFromEnvironment; } });
23
+ var convert_legacy_node_http_options_1 = require("./configuration/convert-legacy-node-http-options");
24
+ Object.defineProperty(exports, "convertLegacyHttpOptions", { enumerable: true, get: function () { return convert_legacy_node_http_options_1.convertLegacyHttpOptions; } });
25
+ //# sourceMappingURL=index-node-http.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-node-http.js","sourceRoot":"","sources":["../../src/index-node-http.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,yEAA2E;AAAlE,yIAAA,4BAA4B,OAAA;AACrC,qFAAiG;AAAxF,iJAAA,qCAAqC,OAAA;AAC9C,qGAA4F;AAAnF,4IAAA,wBAAwB,OAAA","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { createOtlpHttpExportDelegate } from './otlp-http-export-delegate';\nexport { getSharedConfigurationFromEnvironment } from './configuration/shared-env-configuration';\nexport { convertLegacyHttpOptions } from './configuration/convert-legacy-node-http-options';\n"]}
@@ -1,9 +1,10 @@
1
- export * from './platform';
2
1
  export { OTLPExporterBase } from './OTLPExporterBase';
3
- export { OTLPExporterError, OTLPExporterConfigBase, ExportServiceError, } from './types';
4
- export { validateAndNormalizeHeaders } from './util';
2
+ export { OTLPExporterError } from './types';
5
3
  export { ExportResponse, ExportResponseFailure, ExportResponseSuccess, ExportResponseRetryable, } from './export-response';
6
4
  export { IExporterTransport } from './exporter-transport';
7
5
  export { OtlpSharedConfiguration, mergeOtlpSharedConfigurationWithDefaults, getSharedConfigurationDefaults, } from './configuration/shared-configuration';
8
- export { getSharedConfigurationFromEnvironment } from './configuration/shared-env-configuration';
6
+ export { OTLPExporterNodeConfigBase, CompressionAlgorithm, } from './configuration/legacy-node-configuration';
7
+ export { OTLPExporterConfigBase } from './configuration/legacy-base-configuration';
8
+ export { IOtlpExportDelegate } from './otlp-export-delegate';
9
+ export { createOtlpNetworkExportDelegate } from './otlp-network-export-delegate';
9
10
  //# sourceMappingURL=index.d.ts.map
@@ -14,31 +14,17 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
- if (k2 === undefined) k2 = k;
19
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
20
- }) : (function(o, m, k, k2) {
21
- if (k2 === undefined) k2 = k;
22
- o[k2] = m[k];
23
- }));
24
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
25
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
26
- };
27
17
  Object.defineProperty(exports, "__esModule", { value: true });
28
- exports.getSharedConfigurationFromEnvironment = exports.getSharedConfigurationDefaults = exports.mergeOtlpSharedConfigurationWithDefaults = exports.validateAndNormalizeHeaders = exports.OTLPExporterError = exports.OTLPExporterBase = void 0;
29
- /* eslint no-restricted-syntax: ["warn", "ExportAllDeclaration"] --
30
- * TODO: Replace export * with named exports before next major version
31
- */
32
- __exportStar(require("./platform"), exports);
18
+ exports.createOtlpNetworkExportDelegate = exports.CompressionAlgorithm = exports.getSharedConfigurationDefaults = exports.mergeOtlpSharedConfigurationWithDefaults = exports.OTLPExporterError = exports.OTLPExporterBase = void 0;
33
19
  var OTLPExporterBase_1 = require("./OTLPExporterBase");
34
20
  Object.defineProperty(exports, "OTLPExporterBase", { enumerable: true, get: function () { return OTLPExporterBase_1.OTLPExporterBase; } });
35
21
  var types_1 = require("./types");
36
22
  Object.defineProperty(exports, "OTLPExporterError", { enumerable: true, get: function () { return types_1.OTLPExporterError; } });
37
- var util_1 = require("./util");
38
- Object.defineProperty(exports, "validateAndNormalizeHeaders", { enumerable: true, get: function () { return util_1.validateAndNormalizeHeaders; } });
39
23
  var shared_configuration_1 = require("./configuration/shared-configuration");
40
24
  Object.defineProperty(exports, "mergeOtlpSharedConfigurationWithDefaults", { enumerable: true, get: function () { return shared_configuration_1.mergeOtlpSharedConfigurationWithDefaults; } });
41
25
  Object.defineProperty(exports, "getSharedConfigurationDefaults", { enumerable: true, get: function () { return shared_configuration_1.getSharedConfigurationDefaults; } });
42
- var shared_env_configuration_1 = require("./configuration/shared-env-configuration");
43
- Object.defineProperty(exports, "getSharedConfigurationFromEnvironment", { enumerable: true, get: function () { return shared_env_configuration_1.getSharedConfigurationFromEnvironment; } });
26
+ var legacy_node_configuration_1 = require("./configuration/legacy-node-configuration");
27
+ Object.defineProperty(exports, "CompressionAlgorithm", { enumerable: true, get: function () { return legacy_node_configuration_1.CompressionAlgorithm; } });
28
+ var otlp_network_export_delegate_1 = require("./otlp-network-export-delegate");
29
+ Object.defineProperty(exports, "createOtlpNetworkExportDelegate", { enumerable: true, get: function () { return otlp_network_export_delegate_1.createOtlpNetworkExportDelegate; } });
44
30
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;AAEH;;GAEG;AACH,6CAA2B;AAC3B,uDAAsD;AAA7C,oHAAA,gBAAgB,OAAA;AACzB,iCAIiB;AAHf,0GAAA,iBAAiB,OAAA;AAInB,+BAAqD;AAA5C,mHAAA,2BAA2B,OAAA;AAWpC,6EAI8C;AAF5C,gJAAA,wCAAwC,OAAA;AACxC,sIAAA,8BAA8B,OAAA;AAGhC,qFAAiG;AAAxF,iJAAA,qCAAqC,OAAA","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/* eslint no-restricted-syntax: [\"warn\", \"ExportAllDeclaration\"] --\n * TODO: Replace export * with named exports before next major version\n */\nexport * from './platform';\nexport { OTLPExporterBase } from './OTLPExporterBase';\nexport {\n OTLPExporterError,\n OTLPExporterConfigBase,\n ExportServiceError,\n} from './types';\nexport { validateAndNormalizeHeaders } from './util';\n\nexport {\n ExportResponse,\n ExportResponseFailure,\n ExportResponseSuccess,\n ExportResponseRetryable,\n} from './export-response';\n\nexport { IExporterTransport } from './exporter-transport';\n\nexport {\n OtlpSharedConfiguration,\n mergeOtlpSharedConfigurationWithDefaults,\n getSharedConfigurationDefaults,\n} from './configuration/shared-configuration';\n\nexport { getSharedConfigurationFromEnvironment } from './configuration/shared-env-configuration';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,uDAAsD;AAA7C,oHAAA,gBAAgB,OAAA;AACzB,iCAA4C;AAAnC,0GAAA,iBAAiB,OAAA;AAW1B,6EAI8C;AAF5C,gJAAA,wCAAwC,OAAA;AACxC,sIAAA,8BAA8B,OAAA;AAGhC,uFAGmD;AADjD,iIAAA,oBAAoB,OAAA;AAItB,+EAAiF;AAAxE,+IAAA,+BAA+B,OAAA","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { OTLPExporterBase } from './OTLPExporterBase';\nexport { OTLPExporterError } from './types';\n\nexport {\n ExportResponse,\n ExportResponseFailure,\n ExportResponseSuccess,\n ExportResponseRetryable,\n} from './export-response';\n\nexport { IExporterTransport } from './exporter-transport';\n\nexport {\n OtlpSharedConfiguration,\n mergeOtlpSharedConfigurationWithDefaults,\n getSharedConfigurationDefaults,\n} from './configuration/shared-configuration';\n\nexport {\n OTLPExporterNodeConfigBase,\n CompressionAlgorithm,\n} from './configuration/legacy-node-configuration';\nexport { OTLPExporterConfigBase } from './configuration/legacy-base-configuration';\nexport { IOtlpExportDelegate } from './otlp-export-delegate';\nexport { createOtlpNetworkExportDelegate } from './otlp-network-export-delegate';\n"]}
@@ -0,0 +1,6 @@
1
+ import { IOtlpResponseHandler } from './response-handler';
2
+ /**
3
+ * Default response handler that logs a partial success to the console.
4
+ */
5
+ export declare function createLoggingPartialSuccessResponseHandler<T>(): IOtlpResponseHandler<T>;
6
+ //# sourceMappingURL=logging-response-handler.d.ts.map
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createLoggingPartialSuccessResponseHandler = void 0;
4
+ /*
5
+ * Copyright The OpenTelemetry Authors
6
+ *
7
+ * Licensed under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License.
9
+ * You may obtain a copy of the License at
10
+ *
11
+ * https://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ */
19
+ const api_1 = require("@opentelemetry/api");
20
+ function isPartialSuccessResponse(response) {
21
+ return Object.prototype.hasOwnProperty.call(response, 'partialSuccess');
22
+ }
23
+ /**
24
+ * Default response handler that logs a partial success to the console.
25
+ */
26
+ function createLoggingPartialSuccessResponseHandler() {
27
+ return {
28
+ handleResponse(response) {
29
+ // Partial success MUST never be an empty object according the specification
30
+ // see https://opentelemetry.io/docs/specs/otlp/#partial-success
31
+ if (response == null ||
32
+ !isPartialSuccessResponse(response) ||
33
+ response.partialSuccess == null ||
34
+ Object.keys(response.partialSuccess).length === 0) {
35
+ return;
36
+ }
37
+ api_1.diag.warn('Received Partial Success response:', JSON.stringify(response.partialSuccess));
38
+ },
39
+ };
40
+ }
41
+ exports.createLoggingPartialSuccessResponseHandler = createLoggingPartialSuccessResponseHandler;
42
+ //# sourceMappingURL=logging-response-handler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logging-response-handler.js","sourceRoot":"","sources":["../../src/logging-response-handler.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH,4CAA0C;AAG1C,SAAS,wBAAwB,CAC/B,QAAiB;IAEjB,OAAO,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC;AAC1E,CAAC;AAED;;GAEG;AACH,SAAgB,0CAA0C;IAGxD,OAAO;QACL,cAAc,CAAC,QAAW;YACxB,4EAA4E;YAC5E,gEAAgE;YAChE,IACE,QAAQ,IAAI,IAAI;gBAChB,CAAC,wBAAwB,CAAC,QAAQ,CAAC;gBACnC,QAAQ,CAAC,cAAc,IAAI,IAAI;gBAC/B,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,MAAM,KAAK,CAAC,EACjD;gBACA,OAAO;aACR;YACD,UAAI,CAAC,IAAI,CACP,oCAAoC,EACpC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,cAAc,CAAC,CACxC,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC;AArBD,gGAqBC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { diag } from '@opentelemetry/api';\nimport { IOtlpResponseHandler } from './response-handler';\n\nfunction isPartialSuccessResponse(\n response: unknown\n): response is { partialSuccess: never } {\n return Object.prototype.hasOwnProperty.call(response, 'partialSuccess');\n}\n\n/**\n * Default response handler that logs a partial success to the console.\n */\nexport function createLoggingPartialSuccessResponseHandler<\n T,\n>(): IOtlpResponseHandler<T> {\n return {\n handleResponse(response: T) {\n // Partial success MUST never be an empty object according the specification\n // see https://opentelemetry.io/docs/specs/otlp/#partial-success\n if (\n response == null ||\n !isPartialSuccessResponse(response) ||\n response.partialSuccess == null ||\n Object.keys(response.partialSuccess).length === 0\n ) {\n return;\n }\n diag.warn(\n 'Received Partial Success response:',\n JSON.stringify(response.partialSuccess)\n );\n },\n };\n}\n"]}
@@ -0,0 +1,6 @@
1
+ import { OtlpHttpConfiguration } from './configuration/otlp-http-configuration';
2
+ import { ISerializer } from '@opentelemetry/otlp-transformer';
3
+ import { IOtlpExportDelegate } from './otlp-export-delegate';
4
+ export declare function createOtlpXhrExportDelegate<Internal, Response>(options: OtlpHttpConfiguration, serializer: ISerializer<Internal, Response>): IOtlpExportDelegate<Internal>;
5
+ export declare function createOtlpSendBeaconExportDelegate<Internal, Response>(options: OtlpHttpConfiguration, serializer: ISerializer<Internal, Response>): IOtlpExportDelegate<Internal>;
6
+ //# sourceMappingURL=otlp-browser-http-export-delegate.d.ts.map
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createOtlpSendBeaconExportDelegate = exports.createOtlpXhrExportDelegate = void 0;
4
+ const retrying_transport_1 = require("./retrying-transport");
5
+ const xhr_transport_1 = require("./transport/xhr-transport");
6
+ const send_beacon_transport_1 = require("./transport/send-beacon-transport");
7
+ const otlp_network_export_delegate_1 = require("./otlp-network-export-delegate");
8
+ function createOtlpXhrExportDelegate(options, serializer) {
9
+ return (0, otlp_network_export_delegate_1.createOtlpNetworkExportDelegate)(options, serializer, (0, retrying_transport_1.createRetryingTransport)({
10
+ transport: (0, xhr_transport_1.createXhrTransport)(options),
11
+ }));
12
+ }
13
+ exports.createOtlpXhrExportDelegate = createOtlpXhrExportDelegate;
14
+ function createOtlpSendBeaconExportDelegate(options, serializer) {
15
+ return (0, otlp_network_export_delegate_1.createOtlpNetworkExportDelegate)(options, serializer, (0, retrying_transport_1.createRetryingTransport)({
16
+ transport: (0, send_beacon_transport_1.createSendBeaconTransport)({
17
+ url: options.url,
18
+ blobType: options.headers()['Content-Type'],
19
+ }),
20
+ }));
21
+ }
22
+ exports.createOtlpSendBeaconExportDelegate = createOtlpSendBeaconExportDelegate;
23
+ //# sourceMappingURL=otlp-browser-http-export-delegate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"otlp-browser-http-export-delegate.js","sourceRoot":"","sources":["../../src/otlp-browser-http-export-delegate.ts"],"names":[],"mappings":";;;AAkBA,6DAA+D;AAC/D,6DAA+D;AAC/D,6EAA8E;AAC9E,iFAAiF;AAEjF,SAAgB,2BAA2B,CACzC,OAA8B,EAC9B,UAA2C;IAE3C,OAAO,IAAA,8DAA+B,EACpC,OAAO,EACP,UAAU,EACV,IAAA,4CAAuB,EAAC;QACtB,SAAS,EAAE,IAAA,kCAAkB,EAAC,OAAO,CAAC;KACvC,CAAC,CACH,CAAC;AACJ,CAAC;AAXD,kEAWC;AAED,SAAgB,kCAAkC,CAChD,OAA8B,EAC9B,UAA2C;IAE3C,OAAO,IAAA,8DAA+B,EACpC,OAAO,EACP,UAAU,EACV,IAAA,4CAAuB,EAAC;QACtB,SAAS,EAAE,IAAA,iDAAyB,EAAC;YACnC,GAAG,EAAE,OAAO,CAAC,GAAG;YAChB,QAAQ,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,cAAc,CAAC;SAC5C,CAAC;KACH,CAAC,CACH,CAAC;AACJ,CAAC;AAdD,gFAcC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { OtlpHttpConfiguration } from './configuration/otlp-http-configuration';\nimport { ISerializer } from '@opentelemetry/otlp-transformer';\nimport { IOtlpExportDelegate } from './otlp-export-delegate';\nimport { createRetryingTransport } from './retrying-transport';\nimport { createXhrTransport } from './transport/xhr-transport';\nimport { createSendBeaconTransport } from './transport/send-beacon-transport';\nimport { createOtlpNetworkExportDelegate } from './otlp-network-export-delegate';\n\nexport function createOtlpXhrExportDelegate<Internal, Response>(\n options: OtlpHttpConfiguration,\n serializer: ISerializer<Internal, Response>\n): IOtlpExportDelegate<Internal> {\n return createOtlpNetworkExportDelegate(\n options,\n serializer,\n createRetryingTransport({\n transport: createXhrTransport(options),\n })\n );\n}\n\nexport function createOtlpSendBeaconExportDelegate<Internal, Response>(\n options: OtlpHttpConfiguration,\n serializer: ISerializer<Internal, Response>\n): IOtlpExportDelegate<Internal> {\n return createOtlpNetworkExportDelegate(\n options,\n serializer,\n createRetryingTransport({\n transport: createSendBeaconTransport({\n url: options.url,\n blobType: options.headers()['Content-Type'],\n }),\n })\n );\n}\n"]}
@@ -0,0 +1,24 @@
1
+ import { ExportResult } from '@opentelemetry/core';
2
+ import { IExporterTransport } from './exporter-transport';
3
+ import { IExportPromiseHandler } from './bounded-queue-export-promise-handler';
4
+ import { ISerializer } from '@opentelemetry/otlp-transformer';
5
+ /**
6
+ * Internally shared export logic for OTLP.
7
+ */
8
+ export interface IOtlpExportDelegate<Internal> {
9
+ export(internalRepresentation: Internal, resultCallback: (result: ExportResult) => void): void;
10
+ forceFlush(): Promise<void>;
11
+ shutdown(): Promise<void>;
12
+ }
13
+ /**
14
+ * Creates a generic delegate for OTLP exports which only contains parts of the OTLP export that are shared across all
15
+ * signals.
16
+ */
17
+ export declare function createOtlpExportDelegate<Internal, Response>(components: {
18
+ transport: IExporterTransport;
19
+ serializer: ISerializer<Internal, Response>;
20
+ promiseHandler: IExportPromiseHandler;
21
+ }, settings: {
22
+ timeout: number;
23
+ }): IOtlpExportDelegate<Internal>;
24
+ //# sourceMappingURL=otlp-export-delegate.d.ts.map
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright The OpenTelemetry Authors
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * https://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.createOtlpExportDelegate = void 0;
19
+ const core_1 = require("@opentelemetry/core");
20
+ const types_1 = require("./types");
21
+ const logging_response_handler_1 = require("./logging-response-handler");
22
+ const api_1 = require("@opentelemetry/api");
23
+ class OTLPExportDelegate {
24
+ constructor(_transport, _serializer, _responseHandler, _promiseQueue, _timeout) {
25
+ this._transport = _transport;
26
+ this._serializer = _serializer;
27
+ this._responseHandler = _responseHandler;
28
+ this._promiseQueue = _promiseQueue;
29
+ this._timeout = _timeout;
30
+ this._diagLogger = api_1.diag.createComponentLogger({
31
+ namespace: 'OTLPExportDelegate',
32
+ });
33
+ }
34
+ export(internalRepresentation, resultCallback) {
35
+ this._diagLogger.debug('items to be sent', internalRepresentation);
36
+ // don't do any work if too many exports are in progress.
37
+ if (this._promiseQueue.hasReachedLimit()) {
38
+ resultCallback({
39
+ code: core_1.ExportResultCode.FAILED,
40
+ error: new Error('Concurrent export limit reached'),
41
+ });
42
+ return;
43
+ }
44
+ const serializedRequest = this._serializer.serializeRequest(internalRepresentation);
45
+ if (serializedRequest == null) {
46
+ resultCallback({
47
+ code: core_1.ExportResultCode.FAILED,
48
+ error: new Error('Nothing to send'),
49
+ });
50
+ return;
51
+ }
52
+ this._promiseQueue.pushPromise(this._transport.send(serializedRequest, this._timeout).then(response => {
53
+ if (response.status === 'success') {
54
+ if (response.data != null) {
55
+ try {
56
+ this._responseHandler.handleResponse(this._serializer.deserializeResponse(response.data));
57
+ }
58
+ catch (e) {
59
+ this._diagLogger.warn('Export succeeded but could not deserialize response - is the response specification compliant?', e, response.data);
60
+ }
61
+ }
62
+ // No matter the response, we can consider the export still successful.
63
+ resultCallback({
64
+ code: core_1.ExportResultCode.SUCCESS,
65
+ });
66
+ return;
67
+ }
68
+ else if (response.status === 'failure' && response.error) {
69
+ resultCallback({
70
+ code: core_1.ExportResultCode.FAILED,
71
+ error: response.error,
72
+ });
73
+ return;
74
+ }
75
+ else if (response.status === 'retryable') {
76
+ resultCallback({
77
+ code: core_1.ExportResultCode.FAILED,
78
+ error: new types_1.OTLPExporterError('Export failed with retryable status'),
79
+ });
80
+ }
81
+ else {
82
+ resultCallback({
83
+ code: core_1.ExportResultCode.FAILED,
84
+ error: new types_1.OTLPExporterError('Export failed with unknown error'),
85
+ });
86
+ }
87
+ }, reason => resultCallback({
88
+ code: core_1.ExportResultCode.FAILED,
89
+ error: reason,
90
+ })));
91
+ }
92
+ forceFlush() {
93
+ return this._promiseQueue.awaitAll();
94
+ }
95
+ async shutdown() {
96
+ this._diagLogger.debug('shutdown started');
97
+ await this.forceFlush();
98
+ this._transport.shutdown();
99
+ }
100
+ }
101
+ /**
102
+ * Creates a generic delegate for OTLP exports which only contains parts of the OTLP export that are shared across all
103
+ * signals.
104
+ */
105
+ function createOtlpExportDelegate(components, settings) {
106
+ return new OTLPExportDelegate(components.transport, components.serializer, (0, logging_response_handler_1.createLoggingPartialSuccessResponseHandler)(), components.promiseHandler, settings.timeout);
107
+ }
108
+ exports.createOtlpExportDelegate = createOtlpExportDelegate;
109
+ //# sourceMappingURL=otlp-export-delegate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"otlp-export-delegate.js","sourceRoot":"","sources":["../../src/otlp-export-delegate.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,8CAAqE;AAIrE,mCAA4C;AAE5C,yEAAwF;AACxF,4CAAsD;AActD,MAAM,kBAAkB;IAItB,YACU,UAA8B,EAC9B,WAA4C,EAC5C,gBAAgD,EAChD,aAAoC,EACpC,QAAgB;QAJhB,eAAU,GAAV,UAAU,CAAoB;QAC9B,gBAAW,GAAX,WAAW,CAAiC;QAC5C,qBAAgB,GAAhB,gBAAgB,CAAgC;QAChD,kBAAa,GAAb,aAAa,CAAuB;QACpC,aAAQ,GAAR,QAAQ,CAAQ;QAExB,IAAI,CAAC,WAAW,GAAG,UAAI,CAAC,qBAAqB,CAAC;YAC5C,SAAS,EAAE,oBAAoB;SAChC,CAAC,CAAC;IACL,CAAC;IAED,MAAM,CACJ,sBAAgC,EAChC,cAA8C;QAE9C,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,kBAAkB,EAAE,sBAAsB,CAAC,CAAC;QAEnE,yDAAyD;QACzD,IAAI,IAAI,CAAC,aAAa,CAAC,eAAe,EAAE,EAAE;YACxC,cAAc,CAAC;gBACb,IAAI,EAAE,uBAAgB,CAAC,MAAM;gBAC7B,KAAK,EAAE,IAAI,KAAK,CAAC,iCAAiC,CAAC;aACpD,CAAC,CAAC;YACH,OAAO;SACR;QAED,MAAM,iBAAiB,GAAG,IAAI,CAAC,WAAW,CAAC,gBAAgB,CACzD,sBAAsB,CACvB,CAAC;QAEF,IAAI,iBAAiB,IAAI,IAAI,EAAE;YAC7B,cAAc,CAAC;gBACb,IAAI,EAAE,uBAAgB,CAAC,MAAM;gBAC7B,KAAK,EAAE,IAAI,KAAK,CAAC,iBAAiB,CAAC;aACpC,CAAC,CAAC;YACH,OAAO;SACR;QAED,IAAI,CAAC,aAAa,CAAC,WAAW,CAC5B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,iBAAiB,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,CACzD,QAAQ,CAAC,EAAE;YACT,IAAI,QAAQ,CAAC,MAAM,KAAK,SAAS,EAAE;gBACjC,IAAI,QAAQ,CAAC,IAAI,IAAI,IAAI,EAAE;oBACzB,IAAI;wBACF,IAAI,CAAC,gBAAgB,CAAC,cAAc,CAClC,IAAI,CAAC,WAAW,CAAC,mBAAmB,CAAC,QAAQ,CAAC,IAAI,CAAC,CACpD,CAAC;qBACH;oBAAC,OAAO,CAAC,EAAE;wBACV,IAAI,CAAC,WAAW,CAAC,IAAI,CACnB,gGAAgG,EAChG,CAAC,EACD,QAAQ,CAAC,IAAI,CACd,CAAC;qBACH;iBACF;gBACD,uEAAuE;gBACvE,cAAc,CAAC;oBACb,IAAI,EAAE,uBAAgB,CAAC,OAAO;iBAC/B,CAAC,CAAC;gBACH,OAAO;aACR;iBAAM,IAAI,QAAQ,CAAC,MAAM,KAAK,SAAS,IAAI,QAAQ,CAAC,KAAK,EAAE;gBAC1D,cAAc,CAAC;oBACb,IAAI,EAAE,uBAAgB,CAAC,MAAM;oBAC7B,KAAK,EAAE,QAAQ,CAAC,KAAK;iBACtB,CAAC,CAAC;gBACH,OAAO;aACR;iBAAM,IAAI,QAAQ,CAAC,MAAM,KAAK,WAAW,EAAE;gBAC1C,cAAc,CAAC;oBACb,IAAI,EAAE,uBAAgB,CAAC,MAAM;oBAC7B,KAAK,EAAE,IAAI,yBAAiB,CAC1B,qCAAqC,CACtC;iBACF,CAAC,CAAC;aACJ;iBAAM;gBACL,cAAc,CAAC;oBACb,IAAI,EAAE,uBAAgB,CAAC,MAAM;oBAC7B,KAAK,EAAE,IAAI,yBAAiB,CAAC,kCAAkC,CAAC;iBACjE,CAAC,CAAC;aACJ;QACH,CAAC,EACD,MAAM,CAAC,EAAE,CACP,cAAc,CAAC;YACb,IAAI,EAAE,uBAAgB,CAAC,MAAM;YAC7B,KAAK,EAAE,MAAM;SACd,CAAC,CACL,CACF,CAAC;IACJ,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,CAAC;IACvC,CAAC;IAED,KAAK,CAAC,QAAQ;QACZ,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;QAC3C,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;QACxB,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;IAC7B,CAAC;CACF;AAED;;;GAGG;AACH,SAAgB,wBAAwB,CACtC,UAIC,EACD,QAA6B;IAE7B,OAAO,IAAI,kBAAkB,CAC3B,UAAU,CAAC,SAAS,EACpB,UAAU,CAAC,UAAU,EACrB,IAAA,qEAA0C,GAAE,EAC5C,UAAU,CAAC,cAAc,EACzB,QAAQ,CAAC,OAAO,CACjB,CAAC;AACJ,CAAC;AAfD,4DAeC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ExportResult, ExportResultCode } from '@opentelemetry/core';\nimport { IExporterTransport } from './exporter-transport';\nimport { IExportPromiseHandler } from './bounded-queue-export-promise-handler';\nimport { ISerializer } from '@opentelemetry/otlp-transformer';\nimport { OTLPExporterError } from './types';\nimport { IOtlpResponseHandler } from './response-handler';\nimport { createLoggingPartialSuccessResponseHandler } from './logging-response-handler';\nimport { diag, DiagLogger } from '@opentelemetry/api';\n\n/**\n * Internally shared export logic for OTLP.\n */\nexport interface IOtlpExportDelegate<Internal> {\n export(\n internalRepresentation: Internal,\n resultCallback: (result: ExportResult) => void\n ): void;\n forceFlush(): Promise<void>;\n shutdown(): Promise<void>;\n}\n\nclass OTLPExportDelegate<Internal, Response>\n implements IOtlpExportDelegate<Internal>\n{\n private _diagLogger: DiagLogger;\n constructor(\n private _transport: IExporterTransport,\n private _serializer: ISerializer<Internal, Response>,\n private _responseHandler: IOtlpResponseHandler<Response>,\n private _promiseQueue: IExportPromiseHandler,\n private _timeout: number\n ) {\n this._diagLogger = diag.createComponentLogger({\n namespace: 'OTLPExportDelegate',\n });\n }\n\n export(\n internalRepresentation: Internal,\n resultCallback: (result: ExportResult) => void\n ): void {\n this._diagLogger.debug('items to be sent', internalRepresentation);\n\n // don't do any work if too many exports are in progress.\n if (this._promiseQueue.hasReachedLimit()) {\n resultCallback({\n code: ExportResultCode.FAILED,\n error: new Error('Concurrent export limit reached'),\n });\n return;\n }\n\n const serializedRequest = this._serializer.serializeRequest(\n internalRepresentation\n );\n\n if (serializedRequest == null) {\n resultCallback({\n code: ExportResultCode.FAILED,\n error: new Error('Nothing to send'),\n });\n return;\n }\n\n this._promiseQueue.pushPromise(\n this._transport.send(serializedRequest, this._timeout).then(\n response => {\n if (response.status === 'success') {\n if (response.data != null) {\n try {\n this._responseHandler.handleResponse(\n this._serializer.deserializeResponse(response.data)\n );\n } catch (e) {\n this._diagLogger.warn(\n 'Export succeeded but could not deserialize response - is the response specification compliant?',\n e,\n response.data\n );\n }\n }\n // No matter the response, we can consider the export still successful.\n resultCallback({\n code: ExportResultCode.SUCCESS,\n });\n return;\n } else if (response.status === 'failure' && response.error) {\n resultCallback({\n code: ExportResultCode.FAILED,\n error: response.error,\n });\n return;\n } else if (response.status === 'retryable') {\n resultCallback({\n code: ExportResultCode.FAILED,\n error: new OTLPExporterError(\n 'Export failed with retryable status'\n ),\n });\n } else {\n resultCallback({\n code: ExportResultCode.FAILED,\n error: new OTLPExporterError('Export failed with unknown error'),\n });\n }\n },\n reason =>\n resultCallback({\n code: ExportResultCode.FAILED,\n error: reason,\n })\n )\n );\n }\n\n forceFlush(): Promise<void> {\n return this._promiseQueue.awaitAll();\n }\n\n async shutdown(): Promise<void> {\n this._diagLogger.debug('shutdown started');\n await this.forceFlush();\n this._transport.shutdown();\n }\n}\n\n/**\n * Creates a generic delegate for OTLP exports which only contains parts of the OTLP export that are shared across all\n * signals.\n */\nexport function createOtlpExportDelegate<Internal, Response>(\n components: {\n transport: IExporterTransport;\n serializer: ISerializer<Internal, Response>;\n promiseHandler: IExportPromiseHandler;\n },\n settings: { timeout: number }\n): IOtlpExportDelegate<Internal> {\n return new OTLPExportDelegate(\n components.transport,\n components.serializer,\n createLoggingPartialSuccessResponseHandler(),\n components.promiseHandler,\n settings.timeout\n );\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import { IOtlpExportDelegate } from './otlp-export-delegate';
2
+ import { OtlpHttpConfiguration } from './configuration/otlp-http-configuration';
3
+ import { ISerializer } from '@opentelemetry/otlp-transformer';
4
+ export declare function createOtlpHttpExportDelegate<Internal, Response>(options: OtlpHttpConfiguration, serializer: ISerializer<Internal, Response>): IOtlpExportDelegate<Internal>;
5
+ //# sourceMappingURL=otlp-http-export-delegate.d.ts.map
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createOtlpHttpExportDelegate = void 0;
4
+ /*
5
+ * Copyright The OpenTelemetry Authors
6
+ *
7
+ * Licensed under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License.
9
+ * You may obtain a copy of the License at
10
+ *
11
+ * https://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ */
19
+ const otlp_export_delegate_1 = require("./otlp-export-delegate");
20
+ const http_exporter_transport_1 = require("./transport/http-exporter-transport");
21
+ const bounded_queue_export_promise_handler_1 = require("./bounded-queue-export-promise-handler");
22
+ const retrying_transport_1 = require("./retrying-transport");
23
+ function createOtlpHttpExportDelegate(options, serializer) {
24
+ return (0, otlp_export_delegate_1.createOtlpExportDelegate)({
25
+ transport: (0, retrying_transport_1.createRetryingTransport)({
26
+ transport: (0, http_exporter_transport_1.createHttpExporterTransport)(options),
27
+ }),
28
+ serializer: serializer,
29
+ promiseHandler: (0, bounded_queue_export_promise_handler_1.createBoundedQueueExportPromiseHandler)(options),
30
+ }, { timeout: options.timeoutMillis });
31
+ }
32
+ exports.createOtlpHttpExportDelegate = createOtlpHttpExportDelegate;
33
+ //# sourceMappingURL=otlp-http-export-delegate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"otlp-http-export-delegate.js","sourceRoot":"","sources":["../../src/otlp-http-export-delegate.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH,iEAGgC;AAGhC,iFAAkF;AAClF,iGAAgG;AAChG,6DAA+D;AAE/D,SAAgB,4BAA4B,CAC1C,OAA8B,EAC9B,UAA2C;IAE3C,OAAO,IAAA,+CAAwB,EAC7B;QACE,SAAS,EAAE,IAAA,4CAAuB,EAAC;YACjC,SAAS,EAAE,IAAA,qDAA2B,EAAC,OAAO,CAAC;SAChD,CAAC;QACF,UAAU,EAAE,UAAU;QACtB,cAAc,EAAE,IAAA,6EAAsC,EAAC,OAAO,CAAC;KAChE,EACD,EAAE,OAAO,EAAE,OAAO,CAAC,aAAa,EAAE,CACnC,CAAC;AACJ,CAAC;AAdD,oEAcC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n createOtlpExportDelegate,\n IOtlpExportDelegate,\n} from './otlp-export-delegate';\nimport { OtlpHttpConfiguration } from './configuration/otlp-http-configuration';\nimport { ISerializer } from '@opentelemetry/otlp-transformer';\nimport { createHttpExporterTransport } from './transport/http-exporter-transport';\nimport { createBoundedQueueExportPromiseHandler } from './bounded-queue-export-promise-handler';\nimport { createRetryingTransport } from './retrying-transport';\n\nexport function createOtlpHttpExportDelegate<Internal, Response>(\n options: OtlpHttpConfiguration,\n serializer: ISerializer<Internal, Response>\n): IOtlpExportDelegate<Internal> {\n return createOtlpExportDelegate(\n {\n transport: createRetryingTransport({\n transport: createHttpExporterTransport(options),\n }),\n serializer: serializer,\n promiseHandler: createBoundedQueueExportPromiseHandler(options),\n },\n { timeout: options.timeoutMillis }\n );\n}\n"]}
@@ -0,0 +1,6 @@
1
+ import { OtlpSharedConfiguration } from './configuration/shared-configuration';
2
+ import { ISerializer } from '@opentelemetry/otlp-transformer';
3
+ import { IExporterTransport } from './exporter-transport';
4
+ import { IOtlpExportDelegate } from './otlp-export-delegate';
5
+ export declare function createOtlpNetworkExportDelegate<Internal, Response>(options: OtlpSharedConfiguration, serializer: ISerializer<Internal, Response>, transport: IExporterTransport): IOtlpExportDelegate<Internal>;
6
+ //# sourceMappingURL=otlp-network-export-delegate.d.ts.map
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright The OpenTelemetry Authors
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * https://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.createOtlpNetworkExportDelegate = void 0;
19
+ const bounded_queue_export_promise_handler_1 = require("./bounded-queue-export-promise-handler");
20
+ const otlp_export_delegate_1 = require("./otlp-export-delegate");
21
+ function createOtlpNetworkExportDelegate(options, serializer, transport) {
22
+ return (0, otlp_export_delegate_1.createOtlpExportDelegate)({
23
+ transport: transport,
24
+ serializer,
25
+ promiseHandler: (0, bounded_queue_export_promise_handler_1.createBoundedQueueExportPromiseHandler)(options),
26
+ }, { timeout: options.timeoutMillis });
27
+ }
28
+ exports.createOtlpNetworkExportDelegate = createOtlpNetworkExportDelegate;
29
+ //# sourceMappingURL=otlp-network-export-delegate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"otlp-network-export-delegate.js","sourceRoot":"","sources":["../../src/otlp-network-export-delegate.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,iGAAgG;AAIhG,iEAGgC;AAEhC,SAAgB,+BAA+B,CAC7C,OAAgC,EAChC,UAA2C,EAC3C,SAA6B;IAE7B,OAAO,IAAA,+CAAwB,EAC7B;QACE,SAAS,EAAE,SAAS;QACpB,UAAU;QACV,cAAc,EAAE,IAAA,6EAAsC,EAAC,OAAO,CAAC;KAChE,EACD,EAAE,OAAO,EAAE,OAAO,CAAC,aAAa,EAAE,CACnC,CAAC;AACJ,CAAC;AAbD,0EAaC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createBoundedQueueExportPromiseHandler } from './bounded-queue-export-promise-handler';\nimport { OtlpSharedConfiguration } from './configuration/shared-configuration';\nimport { ISerializer } from '@opentelemetry/otlp-transformer';\nimport { IExporterTransport } from './exporter-transport';\nimport {\n createOtlpExportDelegate,\n IOtlpExportDelegate,\n} from './otlp-export-delegate';\n\nexport function createOtlpNetworkExportDelegate<Internal, Response>(\n options: OtlpSharedConfiguration,\n serializer: ISerializer<Internal, Response>,\n transport: IExporterTransport\n): IOtlpExportDelegate<Internal> {\n return createOtlpExportDelegate(\n {\n transport: transport,\n serializer,\n promiseHandler: createBoundedQueueExportPromiseHandler(options),\n },\n { timeout: options.timeoutMillis }\n );\n}\n"]}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Generic export response handler. Can be implemented to handle export responses like partial success.
3
+ */
4
+ export interface IOtlpResponseHandler<Response> {
5
+ /**
6
+ * Handles an OTLP export response.
7
+ * Implementations MUST NOT throw.
8
+ * @param response
9
+ */
10
+ handleResponse(response: Response): void;
11
+ }
12
+ //# sourceMappingURL=response-handler.d.ts.map
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright The OpenTelemetry Authors
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * https://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ //# sourceMappingURL=response-handler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response-handler.js","sourceRoot":"","sources":["../../src/response-handler.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Generic export response handler. Can be implemented to handle export responses like partial success.\n */\nexport interface IOtlpResponseHandler<Response> {\n /**\n * Handles an OTLP export response.\n * Implementations MUST NOT throw.\n * @param response\n */\n handleResponse(response: Response): void;\n}\n"]}
@@ -1,4 +1,4 @@
1
1
  import type { HttpRequestParameters } from './http-transport-types';
2
- import { IExporterTransport } from '../../exporter-transport';
2
+ import { IExporterTransport } from '../exporter-transport';
3
3
  export declare function createHttpExporterTransport(parameters: HttpRequestParameters): IExporterTransport;
4
4
  //# sourceMappingURL=http-exporter-transport.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-exporter-transport.js","sourceRoot":"","sources":["../../../src/transport/http-exporter-transport.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAcH,MAAM,qBAAqB;IAIzB,YAAoB,WAAkC;QAAlC,gBAAW,GAAX,WAAW,CAAuB;QAH9C,UAAK,GAAwB,IAAI,CAAC;QAClC,WAAM,GAAoC,IAAI,CAAC;IAEE,CAAC;IAE1D,KAAK,CAAC,IAAI,CAAC,IAAgB,EAAE,aAAqB;QAChD,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,EAAE;YACtB,8FAA8F;YAC9F,MAAM,EACJ,YAAY,EACZ,eAAe;YACf,8DAA8D;cAC/D,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;YACtC,IAAI,CAAC,MAAM,GAAG,eAAe,CAC3B,IAAI,CAAC,WAAW,CAAC,GAAG,EACpB,IAAI,CAAC,WAAW,CAAC,YAAY,CAC9B,CAAC;YACF,IAAI,CAAC,KAAK,GAAG,YAAY,CAAC;SAC3B;QAED,OAAO,IAAI,OAAO,CAAiB,OAAO,CAAC,EAAE;;YAC3C,8BAA8B;YAC9B,oEAAoE;YACpE,MAAA,IAAI,CAAC,KAAK,+CAAV,IAAI,EACF,IAAI,CAAC,WAAW,EAChB,IAAI,CAAC,MAAO,EACZ,IAAI,EACJ,MAAM,CAAC,EAAE;gBACP,OAAO,CAAC,MAAM,CAAC,CAAC;YAClB,CAAC,EACD,aAAa,CACd,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;IACD,QAAQ;QACN,2CAA2C;IAC7C,CAAC;CACF;AAED,SAAgB,2BAA2B,CACzC,UAAiC;IAEjC,OAAO,IAAI,qBAAqB,CAAC,UAAU,CAAC,CAAC;AAC/C,CAAC;AAJD,kEAIC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n HttpRequestParameters,\n sendWithHttp,\n} from './http-transport-types';\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 { ExportResponse } from '../export-response';\nimport { IExporterTransport } from '../exporter-transport';\n\nclass HttpExporterTransport implements IExporterTransport {\n private _send: sendWithHttp | null = null;\n private _agent: http.Agent | https.Agent | null = null;\n\n constructor(private _parameters: HttpRequestParameters) {}\n\n async send(data: Uint8Array, timeoutMillis: number): Promise<ExportResponse> {\n if (this._send == null) {\n // Lazy require to ensure that http/https is not required before instrumentations can wrap it.\n const {\n sendWithHttp,\n createHttpAgent,\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n } = require('./http-transport-utils');\n this._agent = createHttpAgent(\n this._parameters.url,\n this._parameters.agentOptions\n );\n this._send = sendWithHttp;\n }\n\n return new Promise<ExportResponse>(resolve => {\n // this will always be defined\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this._send?.(\n this._parameters,\n this._agent!,\n data,\n result => {\n resolve(result);\n },\n timeoutMillis\n );\n });\n }\n shutdown() {\n // intentionally left empty, nothing to do.\n }\n}\n\nexport function createHttpExporterTransport(\n parameters: HttpRequestParameters\n): IExporterTransport {\n return new HttpExporterTransport(parameters);\n}\n"]}
@@ -1,11 +1,11 @@
1
1
  /// <reference types="node" />
2
2
  import type * as http from 'http';
3
3
  import type * as https from 'https';
4
- import { ExportResponse } from '../../export-response';
4
+ import { ExportResponse } from '../export-response';
5
5
  export declare type sendWithHttp = (params: HttpRequestParameters, agent: http.Agent | https.Agent, data: Uint8Array, onDone: (response: ExportResponse) => void, timeoutMillis: number) => void;
6
6
  export interface HttpRequestParameters {
7
7
  url: string;
8
- headers: Record<string, string>;
8
+ headers: () => Record<string, string>;
9
9
  compression: 'gzip' | 'none';
10
10
  agentOptions: http.AgentOptions | https.AgentOptions;
11
11
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-transport-types.js","sourceRoot":"","sources":["../../../src/transport/http-transport-types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type * as http from 'http';\nimport type * as https from 'https';\nimport { ExportResponse } from '../export-response';\n\nexport type sendWithHttp = (\n params: HttpRequestParameters,\n agent: http.Agent | https.Agent,\n data: Uint8Array,\n onDone: (response: ExportResponse) => void,\n timeoutMillis: number\n) => void;\n\nexport interface HttpRequestParameters {\n url: string;\n headers: () => Record<string, string>;\n compression: 'gzip' | 'none';\n agentOptions: http.AgentOptions | https.AgentOptions;\n}\n"]}
@@ -2,7 +2,7 @@
2
2
  import * as http from 'http';
3
3
  import * as https from 'https';
4
4
  import { HttpRequestParameters } from './http-transport-types';
5
- import { ExportResponse } from '../../export-response';
5
+ import { ExportResponse } from '../export-response';
6
6
  /**
7
7
  * Sends data using http
8
8
  * @param params
@@ -12,5 +12,6 @@ import { ExportResponse } from '../../export-response';
12
12
  * @param timeoutMillis
13
13
  */
14
14
  export declare function sendWithHttp(params: HttpRequestParameters, agent: http.Agent | https.Agent, data: Uint8Array, onDone: (response: ExportResponse) => void, timeoutMillis: number): void;
15
+ export declare function compressAndSend(req: http.ClientRequest, compression: 'gzip' | 'none', data: Uint8Array, onError: (error: Error) => void): void;
15
16
  export declare function createHttpAgent(rawUrl: string, agentOptions: http.AgentOptions | https.AgentOptions): http.Agent;
16
17
  //# sourceMappingURL=http-transport-utils.d.ts.map