@opentelemetry/otlp-exporter-base 0.212.0 → 0.214.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 (283) hide show
  1. package/build/esm/OTLPExporterBase.d.ts +2 -2
  2. package/build/esm/OTLPExporterBase.js +1 -12
  3. package/build/esm/OTLPExporterBase.js.map +1 -1
  4. package/build/esm/bounded-queue-export-promise-handler.js +1 -12
  5. package/build/esm/bounded-queue-export-promise-handler.js.map +1 -1
  6. package/build/esm/configuration/convert-legacy-browser-http-options.d.ts +2 -2
  7. package/build/esm/configuration/convert-legacy-browser-http-options.js +0 -15
  8. package/build/esm/configuration/convert-legacy-browser-http-options.js.map +1 -1
  9. package/build/esm/configuration/convert-legacy-http-options.d.ts +2 -2
  10. package/build/esm/configuration/convert-legacy-http-options.js +1 -12
  11. package/build/esm/configuration/convert-legacy-http-options.js.map +1 -1
  12. package/build/esm/configuration/convert-legacy-node-http-options.d.ts +2 -2
  13. package/build/esm/configuration/convert-legacy-node-http-options.js.map +1 -1
  14. package/build/esm/configuration/create-legacy-browser-delegate.d.ts +3 -5
  15. package/build/esm/configuration/create-legacy-browser-delegate.js +2 -9
  16. package/build/esm/configuration/create-legacy-browser-delegate.js.map +1 -1
  17. package/build/esm/configuration/legacy-base-configuration.d.ts +1 -1
  18. package/build/esm/configuration/legacy-base-configuration.js.map +1 -1
  19. package/build/esm/configuration/legacy-node-configuration.js +1 -12
  20. package/build/esm/configuration/legacy-node-configuration.js.map +1 -1
  21. package/build/esm/configuration/otlp-http-configuration.d.ts +1 -1
  22. package/build/esm/configuration/otlp-http-configuration.js +1 -12
  23. package/build/esm/configuration/otlp-http-configuration.js.map +1 -1
  24. package/build/esm/configuration/otlp-node-http-configuration.d.ts +1 -1
  25. package/build/esm/configuration/otlp-node-http-configuration.js +0 -15
  26. package/build/esm/configuration/otlp-node-http-configuration.js.map +1 -1
  27. package/build/esm/configuration/otlp-node-http-env-configuration.d.ts +1 -1
  28. package/build/esm/configuration/otlp-node-http-env-configuration.js +2 -13
  29. package/build/esm/configuration/otlp-node-http-env-configuration.js.map +1 -1
  30. package/build/esm/configuration/shared-configuration.d.ts +1 -1
  31. package/build/esm/configuration/shared-configuration.js +1 -12
  32. package/build/esm/configuration/shared-configuration.js.map +1 -1
  33. package/build/esm/configuration/shared-env-configuration.d.ts +1 -1
  34. package/build/esm/configuration/shared-env-configuration.js +1 -12
  35. package/build/esm/configuration/shared-env-configuration.js.map +1 -1
  36. package/build/esm/export-response.js +1 -12
  37. package/build/esm/export-response.js.map +1 -1
  38. package/build/esm/exporter-transport.d.ts +1 -1
  39. package/build/esm/exporter-transport.js +1 -12
  40. package/build/esm/exporter-transport.js.map +1 -1
  41. package/build/esm/index-browser-http.d.ts +3 -0
  42. package/build/esm/index-browser-http.js +4 -12
  43. package/build/esm/index-browser-http.js.map +1 -1
  44. package/build/esm/index-node-http.js +1 -12
  45. package/build/esm/index-node-http.js.map +1 -1
  46. package/build/esm/index.js +1 -12
  47. package/build/esm/index.js.map +1 -1
  48. package/build/esm/is-export-retryable.js +1 -12
  49. package/build/esm/is-export-retryable.js.map +1 -1
  50. package/build/esm/logging-response-handler.d.ts +1 -1
  51. package/build/esm/logging-response-handler.js +1 -12
  52. package/build/esm/logging-response-handler.js.map +1 -1
  53. package/build/esm/otlp-browser-http-export-delegate.d.ts +6 -3
  54. package/build/esm/otlp-browser-http-export-delegate.js +4 -7
  55. package/build/esm/otlp-browser-http-export-delegate.js.map +1 -1
  56. package/build/esm/otlp-export-delegate.d.ts +4 -4
  57. package/build/esm/otlp-export-delegate.js +1 -12
  58. package/build/esm/otlp-export-delegate.js.map +1 -1
  59. package/build/esm/otlp-http-export-delegate.d.ts +3 -3
  60. package/build/esm/otlp-http-export-delegate.js +1 -16
  61. package/build/esm/otlp-http-export-delegate.js.map +1 -1
  62. package/build/esm/otlp-network-export-delegate.d.ts +4 -4
  63. package/build/esm/otlp-network-export-delegate.js +2 -13
  64. package/build/esm/otlp-network-export-delegate.js.map +1 -1
  65. package/build/esm/response-handler.js +1 -12
  66. package/build/esm/response-handler.js.map +1 -1
  67. package/build/esm/retrying-transport.d.ts +1 -1
  68. package/build/esm/retrying-transport.js +1 -12
  69. package/build/esm/retrying-transport.js.map +1 -1
  70. package/build/esm/transport/fetch-transport.d.ts +2 -2
  71. package/build/esm/transport/fetch-transport.js +52 -18
  72. package/build/esm/transport/fetch-transport.js.map +1 -1
  73. package/build/esm/transport/http-exporter-transport.d.ts +2 -2
  74. package/build/esm/transport/http-exporter-transport.js +2 -17
  75. package/build/esm/transport/http-exporter-transport.js.map +1 -1
  76. package/build/esm/transport/http-transport-types.d.ts +1 -1
  77. package/build/esm/transport/http-transport-types.js +1 -12
  78. package/build/esm/transport/http-transport-types.js.map +1 -1
  79. package/build/esm/transport/http-transport-utils.d.ts +6 -4
  80. package/build/esm/transport/http-transport-utils.js +86 -56
  81. package/build/esm/transport/http-transport-utils.js.map +1 -1
  82. package/build/esm/transport/node-http-transport-types.d.ts +2 -2
  83. package/build/esm/transport/node-http-transport-types.js +1 -12
  84. package/build/esm/transport/node-http-transport-types.js.map +1 -1
  85. package/build/esm/types.js +1 -12
  86. package/build/esm/types.js.map +1 -1
  87. package/build/esm/util.js +1 -12
  88. package/build/esm/util.js.map +1 -1
  89. package/build/esm/version.d.ts +1 -1
  90. package/build/esm/version.js +2 -13
  91. package/build/esm/version.js.map +1 -1
  92. package/build/esnext/OTLPExporterBase.d.ts +2 -2
  93. package/build/esnext/OTLPExporterBase.js +1 -12
  94. package/build/esnext/OTLPExporterBase.js.map +1 -1
  95. package/build/esnext/bounded-queue-export-promise-handler.js +1 -12
  96. package/build/esnext/bounded-queue-export-promise-handler.js.map +1 -1
  97. package/build/esnext/configuration/convert-legacy-browser-http-options.d.ts +2 -2
  98. package/build/esnext/configuration/convert-legacy-browser-http-options.js +0 -15
  99. package/build/esnext/configuration/convert-legacy-browser-http-options.js.map +1 -1
  100. package/build/esnext/configuration/convert-legacy-http-options.d.ts +2 -2
  101. package/build/esnext/configuration/convert-legacy-http-options.js +1 -12
  102. package/build/esnext/configuration/convert-legacy-http-options.js.map +1 -1
  103. package/build/esnext/configuration/convert-legacy-node-http-options.d.ts +2 -2
  104. package/build/esnext/configuration/convert-legacy-node-http-options.js.map +1 -1
  105. package/build/esnext/configuration/create-legacy-browser-delegate.d.ts +3 -5
  106. package/build/esnext/configuration/create-legacy-browser-delegate.js +2 -9
  107. package/build/esnext/configuration/create-legacy-browser-delegate.js.map +1 -1
  108. package/build/esnext/configuration/legacy-base-configuration.d.ts +1 -1
  109. package/build/esnext/configuration/legacy-base-configuration.js.map +1 -1
  110. package/build/esnext/configuration/legacy-node-configuration.js +1 -12
  111. package/build/esnext/configuration/legacy-node-configuration.js.map +1 -1
  112. package/build/esnext/configuration/otlp-http-configuration.d.ts +1 -1
  113. package/build/esnext/configuration/otlp-http-configuration.js +1 -12
  114. package/build/esnext/configuration/otlp-http-configuration.js.map +1 -1
  115. package/build/esnext/configuration/otlp-node-http-configuration.d.ts +1 -1
  116. package/build/esnext/configuration/otlp-node-http-configuration.js +0 -15
  117. package/build/esnext/configuration/otlp-node-http-configuration.js.map +1 -1
  118. package/build/esnext/configuration/otlp-node-http-env-configuration.d.ts +1 -1
  119. package/build/esnext/configuration/otlp-node-http-env-configuration.js +2 -13
  120. package/build/esnext/configuration/otlp-node-http-env-configuration.js.map +1 -1
  121. package/build/esnext/configuration/shared-configuration.d.ts +1 -1
  122. package/build/esnext/configuration/shared-configuration.js +1 -12
  123. package/build/esnext/configuration/shared-configuration.js.map +1 -1
  124. package/build/esnext/configuration/shared-env-configuration.d.ts +1 -1
  125. package/build/esnext/configuration/shared-env-configuration.js +1 -12
  126. package/build/esnext/configuration/shared-env-configuration.js.map +1 -1
  127. package/build/esnext/export-response.js +1 -12
  128. package/build/esnext/export-response.js.map +1 -1
  129. package/build/esnext/exporter-transport.d.ts +1 -1
  130. package/build/esnext/exporter-transport.js +1 -12
  131. package/build/esnext/exporter-transport.js.map +1 -1
  132. package/build/esnext/index-browser-http.d.ts +3 -0
  133. package/build/esnext/index-browser-http.js +4 -12
  134. package/build/esnext/index-browser-http.js.map +1 -1
  135. package/build/esnext/index-node-http.js +1 -12
  136. package/build/esnext/index-node-http.js.map +1 -1
  137. package/build/esnext/index.js +1 -12
  138. package/build/esnext/index.js.map +1 -1
  139. package/build/esnext/is-export-retryable.js +1 -12
  140. package/build/esnext/is-export-retryable.js.map +1 -1
  141. package/build/esnext/logging-response-handler.d.ts +1 -1
  142. package/build/esnext/logging-response-handler.js +1 -12
  143. package/build/esnext/logging-response-handler.js.map +1 -1
  144. package/build/esnext/otlp-browser-http-export-delegate.d.ts +6 -3
  145. package/build/esnext/otlp-browser-http-export-delegate.js +4 -7
  146. package/build/esnext/otlp-browser-http-export-delegate.js.map +1 -1
  147. package/build/esnext/otlp-export-delegate.d.ts +4 -4
  148. package/build/esnext/otlp-export-delegate.js +1 -12
  149. package/build/esnext/otlp-export-delegate.js.map +1 -1
  150. package/build/esnext/otlp-http-export-delegate.d.ts +3 -3
  151. package/build/esnext/otlp-http-export-delegate.js +1 -16
  152. package/build/esnext/otlp-http-export-delegate.js.map +1 -1
  153. package/build/esnext/otlp-network-export-delegate.d.ts +4 -4
  154. package/build/esnext/otlp-network-export-delegate.js +2 -13
  155. package/build/esnext/otlp-network-export-delegate.js.map +1 -1
  156. package/build/esnext/response-handler.js +1 -12
  157. package/build/esnext/response-handler.js.map +1 -1
  158. package/build/esnext/retrying-transport.d.ts +1 -1
  159. package/build/esnext/retrying-transport.js +1 -12
  160. package/build/esnext/retrying-transport.js.map +1 -1
  161. package/build/esnext/transport/fetch-transport.d.ts +2 -2
  162. package/build/esnext/transport/fetch-transport.js +52 -18
  163. package/build/esnext/transport/fetch-transport.js.map +1 -1
  164. package/build/esnext/transport/http-exporter-transport.d.ts +2 -2
  165. package/build/esnext/transport/http-exporter-transport.js +2 -17
  166. package/build/esnext/transport/http-exporter-transport.js.map +1 -1
  167. package/build/esnext/transport/http-transport-types.d.ts +1 -1
  168. package/build/esnext/transport/http-transport-types.js +1 -12
  169. package/build/esnext/transport/http-transport-types.js.map +1 -1
  170. package/build/esnext/transport/http-transport-utils.d.ts +6 -4
  171. package/build/esnext/transport/http-transport-utils.js +86 -56
  172. package/build/esnext/transport/http-transport-utils.js.map +1 -1
  173. package/build/esnext/transport/node-http-transport-types.d.ts +2 -2
  174. package/build/esnext/transport/node-http-transport-types.js +1 -12
  175. package/build/esnext/transport/node-http-transport-types.js.map +1 -1
  176. package/build/esnext/types.js +1 -12
  177. package/build/esnext/types.js.map +1 -1
  178. package/build/esnext/util.js +1 -12
  179. package/build/esnext/util.js.map +1 -1
  180. package/build/esnext/version.d.ts +1 -1
  181. package/build/esnext/version.js +2 -13
  182. package/build/esnext/version.js.map +1 -1
  183. package/build/src/OTLPExporterBase.d.ts +2 -2
  184. package/build/src/OTLPExporterBase.js +1 -12
  185. package/build/src/OTLPExporterBase.js.map +1 -1
  186. package/build/src/bounded-queue-export-promise-handler.js +1 -12
  187. package/build/src/bounded-queue-export-promise-handler.js.map +1 -1
  188. package/build/src/configuration/convert-legacy-browser-http-options.d.ts +2 -2
  189. package/build/src/configuration/convert-legacy-browser-http-options.js +0 -15
  190. package/build/src/configuration/convert-legacy-browser-http-options.js.map +1 -1
  191. package/build/src/configuration/convert-legacy-http-options.d.ts +2 -2
  192. package/build/src/configuration/convert-legacy-http-options.js +1 -12
  193. package/build/src/configuration/convert-legacy-http-options.js.map +1 -1
  194. package/build/src/configuration/convert-legacy-node-http-options.d.ts +2 -2
  195. package/build/src/configuration/convert-legacy-node-http-options.js.map +1 -1
  196. package/build/src/configuration/create-legacy-browser-delegate.d.ts +3 -5
  197. package/build/src/configuration/create-legacy-browser-delegate.js +2 -10
  198. package/build/src/configuration/create-legacy-browser-delegate.js.map +1 -1
  199. package/build/src/configuration/legacy-base-configuration.d.ts +1 -1
  200. package/build/src/configuration/legacy-base-configuration.js.map +1 -1
  201. package/build/src/configuration/legacy-node-configuration.js +1 -12
  202. package/build/src/configuration/legacy-node-configuration.js.map +1 -1
  203. package/build/src/configuration/otlp-http-configuration.d.ts +1 -1
  204. package/build/src/configuration/otlp-http-configuration.js +1 -12
  205. package/build/src/configuration/otlp-http-configuration.js.map +1 -1
  206. package/build/src/configuration/otlp-node-http-configuration.d.ts +1 -1
  207. package/build/src/configuration/otlp-node-http-configuration.js +0 -15
  208. package/build/src/configuration/otlp-node-http-configuration.js.map +1 -1
  209. package/build/src/configuration/otlp-node-http-env-configuration.d.ts +1 -1
  210. package/build/src/configuration/otlp-node-http-env-configuration.js +1 -12
  211. package/build/src/configuration/otlp-node-http-env-configuration.js.map +1 -1
  212. package/build/src/configuration/shared-configuration.d.ts +1 -1
  213. package/build/src/configuration/shared-configuration.js +1 -12
  214. package/build/src/configuration/shared-configuration.js.map +1 -1
  215. package/build/src/configuration/shared-env-configuration.d.ts +1 -1
  216. package/build/src/configuration/shared-env-configuration.js +1 -12
  217. package/build/src/configuration/shared-env-configuration.js.map +1 -1
  218. package/build/src/export-response.js +1 -12
  219. package/build/src/export-response.js.map +1 -1
  220. package/build/src/exporter-transport.d.ts +1 -1
  221. package/build/src/exporter-transport.js +1 -12
  222. package/build/src/exporter-transport.js.map +1 -1
  223. package/build/src/index-browser-http.d.ts +3 -0
  224. package/build/src/index-browser-http.js +4 -12
  225. package/build/src/index-browser-http.js.map +1 -1
  226. package/build/src/index-node-http.js +1 -12
  227. package/build/src/index-node-http.js.map +1 -1
  228. package/build/src/index.js +1 -12
  229. package/build/src/index.js.map +1 -1
  230. package/build/src/is-export-retryable.js +1 -12
  231. package/build/src/is-export-retryable.js.map +1 -1
  232. package/build/src/logging-response-handler.d.ts +1 -1
  233. package/build/src/logging-response-handler.js +1 -12
  234. package/build/src/logging-response-handler.js.map +1 -1
  235. package/build/src/otlp-browser-http-export-delegate.d.ts +6 -3
  236. package/build/src/otlp-browser-http-export-delegate.js +4 -7
  237. package/build/src/otlp-browser-http-export-delegate.js.map +1 -1
  238. package/build/src/otlp-export-delegate.d.ts +4 -4
  239. package/build/src/otlp-export-delegate.js +1 -12
  240. package/build/src/otlp-export-delegate.js.map +1 -1
  241. package/build/src/otlp-http-export-delegate.d.ts +3 -3
  242. package/build/src/otlp-http-export-delegate.js +0 -15
  243. package/build/src/otlp-http-export-delegate.js.map +1 -1
  244. package/build/src/otlp-network-export-delegate.d.ts +4 -4
  245. package/build/src/otlp-network-export-delegate.js +1 -12
  246. package/build/src/otlp-network-export-delegate.js.map +1 -1
  247. package/build/src/response-handler.js +1 -12
  248. package/build/src/response-handler.js.map +1 -1
  249. package/build/src/retrying-transport.d.ts +1 -1
  250. package/build/src/retrying-transport.js +1 -12
  251. package/build/src/retrying-transport.js.map +1 -1
  252. package/build/src/transport/fetch-transport.d.ts +2 -2
  253. package/build/src/transport/fetch-transport.js +52 -18
  254. package/build/src/transport/fetch-transport.js.map +1 -1
  255. package/build/src/transport/http-exporter-transport.d.ts +2 -2
  256. package/build/src/transport/http-exporter-transport.js +2 -17
  257. package/build/src/transport/http-exporter-transport.js.map +1 -1
  258. package/build/src/transport/http-transport-types.d.ts +1 -1
  259. package/build/src/transport/http-transport-types.js +1 -12
  260. package/build/src/transport/http-transport-types.js.map +1 -1
  261. package/build/src/transport/http-transport-utils.d.ts +6 -4
  262. package/build/src/transport/http-transport-utils.js +86 -56
  263. package/build/src/transport/http-transport-utils.js.map +1 -1
  264. package/build/src/transport/node-http-transport-types.d.ts +2 -2
  265. package/build/src/transport/node-http-transport-types.js +1 -12
  266. package/build/src/transport/node-http-transport-types.js.map +1 -1
  267. package/build/src/types.js +1 -12
  268. package/build/src/types.js.map +1 -1
  269. package/build/src/util.js +1 -12
  270. package/build/src/util.js.map +1 -1
  271. package/build/src/version.d.ts +1 -1
  272. package/build/src/version.js +2 -13
  273. package/build/src/version.js.map +1 -1
  274. package/package.json +6 -6
  275. package/build/esm/transport/send-beacon-transport.d.ts +0 -12
  276. package/build/esm/transport/send-beacon-transport.js +0 -47
  277. package/build/esm/transport/send-beacon-transport.js.map +0 -1
  278. package/build/esnext/transport/send-beacon-transport.d.ts +0 -12
  279. package/build/esnext/transport/send-beacon-transport.js +0 -47
  280. package/build/esnext/transport/send-beacon-transport.js.map +0 -1
  281. package/build/src/transport/send-beacon-transport.d.ts +0 -12
  282. package/build/src/transport/send-beacon-transport.js +0 -51
  283. package/build/src/transport/send-beacon-transport.js.map +0 -1
@@ -1,17 +1,6 @@
1
1
  /*
2
2
  * Copyright The OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
3
+ * SPDX-License-Identifier: Apache-2.0
15
4
  */
16
5
  export {};
17
6
  //# sourceMappingURL=export-response.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"export-response.js","sourceRoot":"","sources":["../../src/export-response.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\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
+ {"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,4 +1,4 @@
1
- import { ExportResponse } from './export-response';
1
+ import type { ExportResponse } from './export-response';
2
2
  export interface IExporterTransport {
3
3
  send(data: Uint8Array, timeoutMillis: number): Promise<ExportResponse>;
4
4
  shutdown(): void;
@@ -1,17 +1,6 @@
1
1
  /*
2
2
  * Copyright The OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
3
+ * SPDX-License-Identifier: Apache-2.0
15
4
  */
16
5
  export {};
17
6
  //# sourceMappingURL=exporter-transport.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"exporter-transport.js","sourceRoot":"","sources":["../../src/exporter-transport.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 { ExportResponse } from './export-response';\n\nexport interface IExporterTransport {\n send(data: Uint8Array, timeoutMillis: number): Promise<ExportResponse>;\n shutdown(): void;\n}\n"]}
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,3 +1,6 @@
1
+ /**
2
+ * @deprecated Use `createOtlpFetchExportDelegate` instead.
3
+ */
1
4
  export { createOtlpSendBeaconExportDelegate } from './otlp-browser-http-export-delegate';
2
5
  export { convertLegacyBrowserHttpOptions } from './configuration/convert-legacy-browser-http-options';
3
6
  export { createLegacyOtlpBrowserExportDelegate } from './configuration/create-legacy-browser-delegate';
@@ -1,17 +1,9 @@
1
1
  /*
2
2
  * Copyright The OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ /**
6
+ * @deprecated Use `createOtlpFetchExportDelegate` instead.
15
7
  */
16
8
  export { createOtlpSendBeaconExportDelegate } from './otlp-browser-http-export-delegate';
17
9
  export { convertLegacyBrowserHttpOptions } from './configuration/convert-legacy-browser-http-options';
@@ -1 +1 @@
1
- {"version":3,"file":"index-browser-http.js","sourceRoot":"","sources":["../../src/index-browser-http.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,kCAAkC,EAAE,MAAM,qCAAqC,CAAC;AAEzF,OAAO,EAAE,+BAA+B,EAAE,MAAM,qDAAqD,CAAC;AACtG,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC","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 { createOtlpSendBeaconExportDelegate } 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"]}
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,EAAE,qCAAqC,EAAE,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 { createLegacyOtlpBrowserExportDelegate } from './configuration/create-legacy-browser-delegate';\n"]}
@@ -1,17 +1,6 @@
1
1
  /*
2
2
  * Copyright The OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
3
+ * SPDX-License-Identifier: Apache-2.0
15
4
  */
16
5
  export { httpAgentFactoryFromOptions } from './configuration/otlp-node-http-configuration';
17
6
  export { createOtlpHttpExportDelegate } from './otlp-http-export-delegate';
@@ -1 +1 @@
1
- {"version":3,"file":"index-node-http.js","sourceRoot":"","sources":["../../src/index-node-http.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AAC3F,OAAO,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,EAAE,qCAAqC,EAAE,MAAM,0CAA0C,CAAC;AACjG,OAAO,EAAE,wBAAwB,EAAE,MAAM,kDAAkD,CAAC","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 { httpAgentFactoryFromOptions } from './configuration/otlp-node-http-configuration';\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
+ {"version":3,"file":"index-node-http.js","sourceRoot":"","sources":["../../src/index-node-http.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AAC3F,OAAO,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,EAAE,qCAAqC,EAAE,MAAM,0CAA0C,CAAC;AACjG,OAAO,EAAE,wBAAwB,EAAE,MAAM,kDAAkD,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport { httpAgentFactoryFromOptions } from './configuration/otlp-node-http-configuration';\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,17 +1,6 @@
1
1
  /*
2
2
  * Copyright The OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
3
+ * SPDX-License-Identifier: Apache-2.0
15
4
  */
16
5
  export { OTLPExporterBase } from './OTLPExporterBase';
17
6
  export { OTLPExporterError } from './types';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAW5C,OAAO,EACL,wCAAwC,EACxC,8BAA8B,GAC/B,MAAM,sCAAsC,CAAC;AAG9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAIjF,OAAO,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAC","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 type {\n ExportResponse,\n ExportResponseFailure,\n ExportResponseSuccess,\n ExportResponseRetryable,\n} from './export-response';\n\nexport type { IExporterTransport } from './exporter-transport';\n\nexport {\n mergeOtlpSharedConfigurationWithDefaults,\n getSharedConfigurationDefaults,\n} from './configuration/shared-configuration';\nexport type { OtlpSharedConfiguration } from './configuration/shared-configuration';\n\nexport { CompressionAlgorithm } from './configuration/legacy-node-configuration';\nexport type { OTLPExporterNodeConfigBase } from './configuration/legacy-node-configuration';\nexport type { OTLPExporterConfigBase } from './configuration/legacy-base-configuration';\nexport type { IOtlpExportDelegate } from './otlp-export-delegate';\nexport { createOtlpNetworkExportDelegate } from './otlp-network-export-delegate';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAW5C,OAAO,EACL,wCAAwC,EACxC,8BAA8B,GAC/B,MAAM,sCAAsC,CAAC;AAG9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAIjF,OAAO,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport { OTLPExporterBase } from './OTLPExporterBase';\nexport { OTLPExporterError } from './types';\n\nexport type {\n ExportResponse,\n ExportResponseFailure,\n ExportResponseSuccess,\n ExportResponseRetryable,\n} from './export-response';\n\nexport type { IExporterTransport } from './exporter-transport';\n\nexport {\n mergeOtlpSharedConfigurationWithDefaults,\n getSharedConfigurationDefaults,\n} from './configuration/shared-configuration';\nexport type { OtlpSharedConfiguration } from './configuration/shared-configuration';\n\nexport { CompressionAlgorithm } from './configuration/legacy-node-configuration';\nexport type { OTLPExporterNodeConfigBase } from './configuration/legacy-node-configuration';\nexport type { OTLPExporterConfigBase } from './configuration/legacy-base-configuration';\nexport type { IOtlpExportDelegate } from './otlp-export-delegate';\nexport { createOtlpNetworkExportDelegate } from './otlp-network-export-delegate';\n"]}
@@ -1,17 +1,6 @@
1
1
  /*
2
2
  * Copyright The OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
3
+ * SPDX-License-Identifier: Apache-2.0
15
4
  */
16
5
  export function isExportHTTPErrorRetryable(statusCode) {
17
6
  return (statusCode === 429 ||
@@ -1 +1 @@
1
- {"version":3,"file":"is-export-retryable.js","sourceRoot":"","sources":["../../src/is-export-retryable.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,UAAU,0BAA0B,CAAC,UAAkB;IAC3D,OAAO,CACL,UAAU,KAAK,GAAG;QAClB,UAAU,KAAK,GAAG;QAClB,UAAU,KAAK,GAAG;QAClB,UAAU,KAAK,GAAG,CACnB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,sBAAsB,CACpC,UAAsC;IAEtC,IAAI,UAAU,IAAI,IAAI,EAAE;QACtB,OAAO,SAAS,CAAC;KAClB;IAED,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IAChD,IAAI,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE;QAC7B,OAAO,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KAC1C;IACD,mFAAmF;IACnF,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAE1D,IAAI,KAAK,IAAI,CAAC,EAAE;QACd,OAAO,KAAK,CAAC;KACd;IACD,OAAO,CAAC,CAAC;AACX,CAAC","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 function isExportHTTPErrorRetryable(statusCode: number): boolean {\n return (\n statusCode === 429 ||\n statusCode === 502 ||\n statusCode === 503 ||\n statusCode === 504\n );\n}\n\nexport function parseRetryAfterToMills(\n retryAfter?: string | undefined | null\n): number | undefined {\n if (retryAfter == null) {\n return undefined;\n }\n\n const seconds = Number.parseInt(retryAfter, 10);\n if (Number.isInteger(seconds)) {\n return seconds > 0 ? seconds * 1000 : -1;\n }\n // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After#directives\n const delay = new Date(retryAfter).getTime() - Date.now();\n\n if (delay >= 0) {\n return delay;\n }\n return 0;\n}\n"]}
1
+ {"version":3,"file":"is-export-retryable.js","sourceRoot":"","sources":["../../src/is-export-retryable.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,UAAU,0BAA0B,CAAC,UAAkB;IAC3D,OAAO,CACL,UAAU,KAAK,GAAG;QAClB,UAAU,KAAK,GAAG;QAClB,UAAU,KAAK,GAAG;QAClB,UAAU,KAAK,GAAG,CACnB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,sBAAsB,CACpC,UAAsC;IAEtC,IAAI,UAAU,IAAI,IAAI,EAAE;QACtB,OAAO,SAAS,CAAC;KAClB;IAED,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IAChD,IAAI,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE;QAC7B,OAAO,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KAC1C;IACD,mFAAmF;IACnF,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAE1D,IAAI,KAAK,IAAI,CAAC,EAAE;QACd,OAAO,KAAK,CAAC;KACd;IACD,OAAO,CAAC,CAAC;AACX,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport function isExportHTTPErrorRetryable(statusCode: number): boolean {\n return (\n statusCode === 429 ||\n statusCode === 502 ||\n statusCode === 503 ||\n statusCode === 504\n );\n}\n\nexport function parseRetryAfterToMills(\n retryAfter?: string | undefined | null\n): number | undefined {\n if (retryAfter == null) {\n return undefined;\n }\n\n const seconds = Number.parseInt(retryAfter, 10);\n if (Number.isInteger(seconds)) {\n return seconds > 0 ? seconds * 1000 : -1;\n }\n // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After#directives\n const delay = new Date(retryAfter).getTime() - Date.now();\n\n if (delay >= 0) {\n return delay;\n }\n return 0;\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { IOtlpResponseHandler } from './response-handler';
1
+ import type { IOtlpResponseHandler } from './response-handler';
2
2
  /**
3
3
  * Default response handler that logs a partial success to the console.
4
4
  */
@@ -1,17 +1,6 @@
1
1
  /*
2
2
  * Copyright The OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
3
+ * SPDX-License-Identifier: Apache-2.0
15
4
  */
16
5
  import { diag } from '@opentelemetry/api';
17
6
  function isPartialSuccessResponse(response) {
@@ -1 +1 @@
1
- {"version":3,"file":"logging-response-handler.js","sourceRoot":"","sources":["../../src/logging-response-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;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,MAAM,UAAU,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,IAAI,CAAC,IAAI,CACP,oCAAoC,EACpC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,cAAc,CAAC,CACxC,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC","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"]}
1
+ {"version":3,"file":"logging-response-handler.js","sourceRoot":"","sources":["../../src/logging-response-handler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;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,MAAM,UAAU,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,IAAI,CAAC,IAAI,CACP,oCAAoC,EACpC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,cAAc,CAAC,CACxC,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { diag } from '@opentelemetry/api';\nimport type { 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"]}
@@ -1,6 +1,9 @@
1
- import { OtlpHttpConfiguration } from './configuration/otlp-http-configuration';
2
- import { ISerializer } from '@opentelemetry/otlp-transformer';
3
- import { IOtlpExportDelegate } from './otlp-export-delegate';
1
+ import type { OtlpHttpConfiguration } from './configuration/otlp-http-configuration';
2
+ import type { ISerializer } from '@opentelemetry/otlp-transformer';
3
+ import type { IOtlpExportDelegate } from './otlp-export-delegate';
4
4
  export declare function createOtlpFetchExportDelegate<Internal, Response>(options: OtlpHttpConfiguration, serializer: ISerializer<Internal, Response>): IOtlpExportDelegate<Internal>;
5
+ /**
6
+ * @deprecated Use {@link createOtlpFetchExportDelegate} instead. Modern browsers use `fetch` with `keepAlive: true` when `sendBeacon` is used. Use a `fetch` polyfill that mimics this behavior to keep using `sendBeacon`.
7
+ */
5
8
  export declare function createOtlpSendBeaconExportDelegate<Internal, Response>(options: OtlpHttpConfiguration, serializer: ISerializer<Internal, Response>): IOtlpExportDelegate<Internal>;
6
9
  //# sourceMappingURL=otlp-browser-http-export-delegate.d.ts.map
@@ -1,5 +1,4 @@
1
1
  import { createRetryingTransport } from './retrying-transport';
2
- import { createSendBeaconTransport } from './transport/send-beacon-transport';
3
2
  import { createOtlpNetworkExportDelegate } from './otlp-network-export-delegate';
4
3
  import { createFetchTransport } from './transport/fetch-transport';
5
4
  export function createOtlpFetchExportDelegate(options, serializer) {
@@ -7,12 +6,10 @@ export function createOtlpFetchExportDelegate(options, serializer) {
7
6
  transport: createFetchTransport(options),
8
7
  }));
9
8
  }
9
+ /**
10
+ * @deprecated Use {@link createOtlpFetchExportDelegate} instead. Modern browsers use `fetch` with `keepAlive: true` when `sendBeacon` is used. Use a `fetch` polyfill that mimics this behavior to keep using `sendBeacon`.
11
+ */
10
12
  export function createOtlpSendBeaconExportDelegate(options, serializer) {
11
- return createOtlpNetworkExportDelegate(options, serializer, createRetryingTransport({
12
- transport: createSendBeaconTransport({
13
- url: options.url,
14
- headers: options.headers,
15
- }),
16
- }));
13
+ return createOtlpFetchExportDelegate(options, serializer);
17
14
  }
18
15
  //# sourceMappingURL=otlp-browser-http-export-delegate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"otlp-browser-http-export-delegate.js","sourceRoot":"","sources":["../../src/otlp-browser-http-export-delegate.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAC;AACjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEnE,MAAM,UAAU,6BAA6B,CAC3C,OAA8B,EAC9B,UAA2C;IAE3C,OAAO,+BAA+B,CACpC,OAAO,EACP,UAAU,EACV,uBAAuB,CAAC;QACtB,SAAS,EAAE,oBAAoB,CAAC,OAAO,CAAC;KACzC,CAAC,CACH,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,kCAAkC,CAChD,OAA8B,EAC9B,UAA2C;IAE3C,OAAO,+BAA+B,CACpC,OAAO,EACP,UAAU,EACV,uBAAuB,CAAC;QACtB,SAAS,EAAE,yBAAyB,CAAC;YACnC,GAAG,EAAE,OAAO,CAAC,GAAG;YAChB,OAAO,EAAE,OAAO,CAAC,OAAO;SACzB,CAAC;KACH,CAAC,CACH,CAAC;AACJ,CAAC","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 { createSendBeaconTransport } from './transport/send-beacon-transport';\nimport { createOtlpNetworkExportDelegate } from './otlp-network-export-delegate';\nimport { createFetchTransport } from './transport/fetch-transport';\n\nexport function createOtlpFetchExportDelegate<Internal, Response>(\n options: OtlpHttpConfiguration,\n serializer: ISerializer<Internal, Response>\n): IOtlpExportDelegate<Internal> {\n return createOtlpNetworkExportDelegate(\n options,\n serializer,\n createRetryingTransport({\n transport: createFetchTransport(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 headers: options.headers,\n }),\n })\n );\n}\n"]}
1
+ {"version":3,"file":"otlp-browser-http-export-delegate.js","sourceRoot":"","sources":["../../src/otlp-browser-http-export-delegate.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAC;AACjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEnE,MAAM,UAAU,6BAA6B,CAC3C,OAA8B,EAC9B,UAA2C;IAE3C,OAAO,+BAA+B,CACpC,OAAO,EACP,UAAU,EACV,uBAAuB,CAAC;QACtB,SAAS,EAAE,oBAAoB,CAAC,OAAO,CAAC;KACzC,CAAC,CACH,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kCAAkC,CAChD,OAA8B,EAC9B,UAA2C;IAE3C,OAAO,6BAA6B,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;AAC5D,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport type { OtlpHttpConfiguration } from './configuration/otlp-http-configuration';\nimport type { ISerializer } from '@opentelemetry/otlp-transformer';\nimport type { IOtlpExportDelegate } from './otlp-export-delegate';\nimport { createRetryingTransport } from './retrying-transport';\nimport { createOtlpNetworkExportDelegate } from './otlp-network-export-delegate';\nimport { createFetchTransport } from './transport/fetch-transport';\n\nexport function createOtlpFetchExportDelegate<Internal, Response>(\n options: OtlpHttpConfiguration,\n serializer: ISerializer<Internal, Response>\n): IOtlpExportDelegate<Internal> {\n return createOtlpNetworkExportDelegate(\n options,\n serializer,\n createRetryingTransport({\n transport: createFetchTransport(options),\n })\n );\n}\n\n/**\n * @deprecated Use {@link createOtlpFetchExportDelegate} instead. Modern browsers use `fetch` with `keepAlive: true` when `sendBeacon` is used. Use a `fetch` polyfill that mimics this behavior to keep using `sendBeacon`.\n */\nexport function createOtlpSendBeaconExportDelegate<Internal, Response>(\n options: OtlpHttpConfiguration,\n serializer: ISerializer<Internal, Response>\n): IOtlpExportDelegate<Internal> {\n return createOtlpFetchExportDelegate(options, serializer);\n}\n"]}
@@ -1,7 +1,7 @@
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';
1
+ import type { ExportResult } from '@opentelemetry/core';
2
+ import type { IExporterTransport } from './exporter-transport';
3
+ import type { IExportPromiseHandler } from './bounded-queue-export-promise-handler';
4
+ import type { ISerializer } from '@opentelemetry/otlp-transformer';
5
5
  /**
6
6
  * Internally shared export logic for OTLP.
7
7
  */
@@ -1,17 +1,6 @@
1
1
  /*
2
2
  * Copyright The OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
3
+ * SPDX-License-Identifier: Apache-2.0
15
4
  */
16
5
  import { ExportResultCode } from '@opentelemetry/core';
17
6
  import { OTLPExporterError } from './types';
@@ -1 +1 @@
1
- {"version":3,"file":"otlp-export-delegate.js","sourceRoot":"","sources":["../../src/otlp-export-delegate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAgB,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAIrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,OAAO,EAAE,0CAA0C,EAAE,MAAM,4BAA4B,CAAC;AACxF,OAAO,EAAE,IAAI,EAAc,MAAM,oBAAoB,CAAC;AActD,MAAM,kBAAkB;IAGd,WAAW,CAAa;IACxB,UAAU,CAAqB;IAC/B,WAAW,CAAkC;IAC7C,gBAAgB,CAAiC;IACjD,aAAa,CAAwB;IACrC,QAAQ,CAAS;IAEzB,YACE,SAA6B,EAC7B,UAA2C,EAC3C,eAA+C,EAC/C,YAAmC,EACnC,OAAe;QAEf,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC;QACxC,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC;QAClC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,WAAW,GAAG,IAAI,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,sB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oBACb,IAAI,EAAE,gBAAgB,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,gBAAgB,CAAC,MAAM;oBAC7B,KAAK,EACH,QAAQ,CAAC,KAAK;wBACd,IAAI,iBAAiB,CAAC,qCAAqC,CAAC;iBAC/D,CAAC,CAAC;aACJ;iBAAM;gBACL,cAAc,CAAC;oBACb,IAAI,EAAE,gBAAgB,CAAC,MAAM;oBAC7B,KAAK,EAAE,IAAI,iBAAiB,CAAC,kCAAkC,CAAC;iBACjE,CAAC,CAAC;aACJ;QACH,CAAC,EACD,MAAM,CAAC,EAAE,CACP,cAAc,CAAC;YACb,IAAI,EAAE,gBAAgB,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,MAAM,UAAU,wBAAwB,CACtC,UAIC,EACD,QAA6B;IAE7B,OAAO,IAAI,kBAAkB,CAC3B,UAAU,CAAC,SAAS,EACpB,UAAU,CAAC,UAAU,EACrB,0CAA0C,EAAE,EAC5C,UAAU,CAAC,cAAc,EACzB,QAAQ,CAAC,OAAO,CACjB,CAAC;AACJ,CAAC","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 private _transport: IExporterTransport;\n private _serializer: ISerializer<Internal, Response>;\n private _responseHandler: IOtlpResponseHandler<Response>;\n private _promiseQueue: IExportPromiseHandler;\n private _timeout: number;\n\n constructor(\n transport: IExporterTransport,\n serializer: ISerializer<Internal, Response>,\n responseHandler: IOtlpResponseHandler<Response>,\n promiseQueue: IExportPromiseHandler,\n timeout: number\n ) {\n this._transport = transport;\n this._serializer = serializer;\n this._responseHandler = responseHandler;\n this._promiseQueue = promiseQueue;\n this._timeout = timeout;\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:\n response.error ??\n new OTLPExporterError('Export failed with retryable status'),\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"]}
1
+ {"version":3,"file":"otlp-export-delegate.js","sourceRoot":"","sources":["../../src/ot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;gBACL,cAAc,CAAC;oBACb,IAAI,EAAE,gBAAgB,CAAC,MAAM;oBAC7B,KAAK,EAAE,IAAI,iBAAiB,CAAC,kCAAkC,CAAC;iBACjE,CAAC,CAAC;aACJ;QACH,CAAC,EACD,MAAM,CAAC,EAAE,CACP,cAAc,CAAC;YACb,IAAI,EAAE,gBAAgB,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,MAAM,UAAU,wBAAwB,CACtC,UAIC,EACD,QAA6B;IAE7B,OAAO,IAAI,kBAAkB,CAC3B,UAAU,CAAC,SAAS,EACpB,UAAU,CAAC,UAAU,EACrB,0CAA0C,EAAE,EAC5C,UAAU,CAAC,cAAc,EACzB,QAAQ,CAAC,OAAO,CACjB,CAAC;AACJ,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { ExportResult } from '@opentelemetry/core';\nimport { ExportResultCode } from '@opentelemetry/core';\nimport type { IExporterTransport } from './exporter-transport';\nimport type { IExportPromiseHandler } from './bounded-queue-export-promise-handler';\nimport type { ISerializer } from '@opentelemetry/otlp-transformer';\nimport { OTLPExporterError } from './types';\nimport type { IOtlpResponseHandler } from './response-handler';\nimport { createLoggingPartialSuccessResponseHandler } from './logging-response-handler';\nimport type { DiagLogger } from '@opentelemetry/api';\nimport { diag } 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 private _transport: IExporterTransport;\n private _serializer: ISerializer<Internal, Response>;\n private _responseHandler: IOtlpResponseHandler<Response>;\n private _promiseQueue: IExportPromiseHandler;\n private _timeout: number;\n\n constructor(\n transport: IExporterTransport,\n serializer: ISerializer<Internal, Response>,\n responseHandler: IOtlpResponseHandler<Response>,\n promiseQueue: IExportPromiseHandler,\n timeout: number\n ) {\n this._transport = transport;\n this._serializer = serializer;\n this._responseHandler = responseHandler;\n this._promiseQueue = promiseQueue;\n this._timeout = timeout;\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:\n response.error ??\n new OTLPExporterError('Export failed with retryable status'),\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"]}
@@ -1,5 +1,5 @@
1
- import { IOtlpExportDelegate } from './otlp-export-delegate';
2
- import { ISerializer } from '@opentelemetry/otlp-transformer';
3
- import { OtlpNodeHttpConfiguration } from './configuration/otlp-node-http-configuration';
1
+ import type { IOtlpExportDelegate } from './otlp-export-delegate';
2
+ import type { ISerializer } from '@opentelemetry/otlp-transformer';
3
+ import type { OtlpNodeHttpConfiguration } from './configuration/otlp-node-http-configuration';
4
4
  export declare function createOtlpHttpExportDelegate<Internal, Response>(options: OtlpNodeHttpConfiguration, serializer: ISerializer<Internal, Response>): IOtlpExportDelegate<Internal>;
5
5
  //# sourceMappingURL=otlp-http-export-delegate.d.ts.map
@@ -1,19 +1,4 @@
1
- /*
2
- * Copyright The OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import { createOtlpExportDelegate, } from './otlp-export-delegate';
1
+ import { createOtlpExportDelegate } from './otlp-export-delegate';
17
2
  import { createHttpExporterTransport } from './transport/http-exporter-transport';
18
3
  import { createBoundedQueueExportPromiseHandler } from './bounded-queue-export-promise-handler';
19
4
  import { createRetryingTransport } from './retrying-transport';
@@ -1 +1 @@
1
- {"version":3,"file":"otlp-http-export-delegate.js","sourceRoot":"","sources":["../../src/otlp-http-export-delegate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EACL,wBAAwB,GAEzB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAClF,OAAO,EAAE,sCAAsC,EAAE,MAAM,wCAAwC,CAAC;AAChG,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAG/D,MAAM,UAAU,4BAA4B,CAC1C,OAAkC,EAClC,UAA2C;IAE3C,OAAO,wBAAwB,CAC7B;QACE,SAAS,EAAE,uBAAuB,CAAC;YACjC,SAAS,EAAE,2BAA2B,CAAC,OAAO,CAAC;SAChD,CAAC;QACF,UAAU,EAAE,UAAU;QACtB,cAAc,EAAE,sCAAsC,CAAC,OAAO,CAAC;KAChE,EACD,EAAE,OAAO,EAAE,OAAO,CAAC,aAAa,EAAE,CACnC,CAAC;AACJ,CAAC","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 { 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';\nimport { OtlpNodeHttpConfiguration } from './configuration/otlp-node-http-configuration';\n\nexport function createOtlpHttpExportDelegate<Internal, Response>(\n options: OtlpNodeHttpConfiguration,\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"]}
1
+ {"version":3,"file":"otlp-http-export-delegate.js","sourceRoot":"","sources":["../../src/otlp-http-export-delegate.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAElE,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAClF,OAAO,EAAE,sCAAsC,EAAE,MAAM,wCAAwC,CAAC;AAChG,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAG/D,MAAM,UAAU,4BAA4B,CAC1C,OAAkC,EAClC,UAA2C;IAE3C,OAAO,wBAAwB,CAC7B;QACE,SAAS,EAAE,uBAAuB,CAAC;YACjC,SAAS,EAAE,2BAA2B,CAAC,OAAO,CAAC;SAChD,CAAC;QACF,UAAU,EAAE,UAAU;QACtB,cAAc,EAAE,sCAAsC,CAAC,OAAO,CAAC;KAChE,EACD,EAAE,OAAO,EAAE,OAAO,CAAC,aAAa,EAAE,CACnC,CAAC;AACJ,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport type { IOtlpExportDelegate } from './otlp-export-delegate';\nimport { createOtlpExportDelegate } from './otlp-export-delegate';\nimport type { 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';\nimport type { OtlpNodeHttpConfiguration } from './configuration/otlp-node-http-configuration';\n\nexport function createOtlpHttpExportDelegate<Internal, Response>(\n options: OtlpNodeHttpConfiguration,\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"]}
@@ -1,6 +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';
1
+ import type { OtlpSharedConfiguration } from './configuration/shared-configuration';
2
+ import type { ISerializer } from '@opentelemetry/otlp-transformer';
3
+ import type { IExporterTransport } from './exporter-transport';
4
+ import type { IOtlpExportDelegate } from './otlp-export-delegate';
5
5
  export declare function createOtlpNetworkExportDelegate<Internal, Response>(options: OtlpSharedConfiguration, serializer: ISerializer<Internal, Response>, transport: IExporterTransport): IOtlpExportDelegate<Internal>;
6
6
  //# sourceMappingURL=otlp-network-export-delegate.d.ts.map
@@ -1,20 +1,9 @@
1
1
  /*
2
2
  * Copyright The OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
3
+ * SPDX-License-Identifier: Apache-2.0
15
4
  */
16
5
  import { createBoundedQueueExportPromiseHandler } from './bounded-queue-export-promise-handler';
17
- import { createOtlpExportDelegate, } from './otlp-export-delegate';
6
+ import { createOtlpExportDelegate } from './otlp-export-delegate';
18
7
  export function createOtlpNetworkExportDelegate(options, serializer, transport) {
19
8
  return createOtlpExportDelegate({
20
9
  transport: transport,
@@ -1 +1 @@
1
- {"version":3,"file":"otlp-network-export-delegate.js","sourceRoot":"","sources":["../../src/otlp-network-export-delegate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,sCAAsC,EAAE,MAAM,wCAAwC,CAAC;AAIhG,OAAO,EACL,wBAAwB,GAEzB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,UAAU,+BAA+B,CAC7C,OAAgC,EAChC,UAA2C,EAC3C,SAA6B;IAE7B,OAAO,wBAAwB,CAC7B;QACE,SAAS,EAAE,SAAS;QACpB,UAAU;QACV,cAAc,EAAE,sCAAsC,CAAC,OAAO,CAAC;KAChE,EACD,EAAE,OAAO,EAAE,OAAO,CAAC,aAAa,EAAE,CACnC,CAAC;AACJ,CAAC","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"]}
1
+ {"version":3,"file":"otlp-network-export-delegate.js","sourceRoot":"","sources":["../../src/otlp-network-export-delegate.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,sCAAsC,EAAE,MAAM,wCAAwC,CAAC;AAKhG,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAElE,MAAM,UAAU,+BAA+B,CAC7C,OAAgC,EAChC,UAA2C,EAC3C,SAA6B;IAE7B,OAAO,wBAAwB,CAC7B;QACE,SAAS,EAAE,SAAS;QACpB,UAAU;QACV,cAAc,EAAE,sCAAsC,CAAC,OAAO,CAAC;KAChE,EACD,EAAE,OAAO,EAAE,OAAO,CAAC,aAAa,EAAE,CACnC,CAAC;AACJ,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { createBoundedQueueExportPromiseHandler } from './bounded-queue-export-promise-handler';\nimport type { OtlpSharedConfiguration } from './configuration/shared-configuration';\nimport type { ISerializer } from '@opentelemetry/otlp-transformer';\nimport type { IExporterTransport } from './exporter-transport';\nimport type { IOtlpExportDelegate } from './otlp-export-delegate';\nimport { createOtlpExportDelegate } 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"]}
@@ -1,17 +1,6 @@
1
1
  /*
2
2
  * Copyright The OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
3
+ * SPDX-License-Identifier: Apache-2.0
15
4
  */
16
5
  export {};
17
6
  //# sourceMappingURL=response-handler.js.map
@@ -1 +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
+ {"version":3,"file":"response-handler.js","sourceRoot":"","sources":["../../src/response-handler.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\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
- import { IExporterTransport } from './exporter-transport';
1
+ import type { IExporterTransport } from './exporter-transport';
2
2
  /**
3
3
  * Creates an Exporter Transport that retries on 'retryable' response.
4
4
  */
@@ -1,17 +1,6 @@
1
1
  /*
2
2
  * Copyright The OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
3
+ * SPDX-License-Identifier: Apache-2.0
15
4
  */
16
5
  import { diag } from '@opentelemetry/api';
17
6
  const MAX_ATTEMPTS = 5;
@@ -1 +1 @@
1
- {"version":3,"file":"retrying-transport.js","sourceRoot":"","sources":["../../src/retrying-transport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,MAAM,YAAY,GAAG,CAAC,CAAC;AACvB,MAAM,eAAe,GAAG,IAAI,CAAC;AAC7B,MAAM,WAAW,GAAG,IAAI,CAAC;AACzB,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAC/B,MAAM,MAAM,GAAG,GAAG,CAAC;AAEnB;;GAEG;AACH,SAAS,SAAS;IAChB,OAAO,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,GAAG,MAAM,CAAC;AAC/C,CAAC;AAED,MAAM,iBAAiB;I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,CAAC,IAAI,CACP,qBAAqB,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,gCAAgC,IAAI,CAAC,KAAK,CACtF,sBAAsB,CACvB,2BAA2B,CAC7B,CAAC;gBACF,OAAO,MAAM,CAAC;aACf;YAED,IAAI,CAAC,OAAO,CAAC,8BAA8B,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;YAC1E,MAAM,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,sBAAsB,EAAE,aAAa,CAAC,CAAC;SACxE;QAED,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS,EAAE;YAC/B,IAAI,CAAC,OAAO,CACV,0BAA0B,YAAY,GAAG,QAAQ,kBAAkB,CACpE,CAAC;SACH;aAAM,IAAI,MAAM,CAAC,MAAM,KAAK,WAAW,EAAE;YACxC,IAAI,CAAC,IAAI,CACP,+CAA+C,YAAY,IAAI,CAChE,CAAC;SACH;aAAM;YACL,IAAI,CAAC,IAAI,CAAC,2CAA2C,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;SACtE;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;IACpC,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,uBAAuB,CAAC,OAGvC;IACC,OAAO,IAAI,iBAAiB,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClD,CAAC","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 { IExporterTransport } from './exporter-transport';\nimport { ExportResponse } from './export-response';\nimport { diag } from '@opentelemetry/api';\n\nconst MAX_ATTEMPTS = 5;\nconst INITIAL_BACKOFF = 1000;\nconst MAX_BACKOFF = 5000;\nconst BACKOFF_MULTIPLIER = 1.5;\nconst JITTER = 0.2;\n\n/**\n * Get a pseudo-random jitter that falls in the range of [-JITTER, +JITTER]\n */\nfunction getJitter() {\n return Math.random() * (2 * JITTER) - JITTER;\n}\n\nclass RetryingTransport implements IExporterTransport {\n private _transport: IExporterTransport;\n\n constructor(transport: IExporterTransport) {\n this._transport = transport;\n }\n\n private retry(\n data: Uint8Array,\n timeoutMillis: number,\n inMillis: number\n ): Promise<ExportResponse> {\n return new Promise((resolve, reject) => {\n setTimeout(() => {\n this._transport.send(data, timeoutMillis).then(resolve, reject);\n }, inMillis);\n });\n }\n\n async send(data: Uint8Array, timeoutMillis: number): Promise<ExportResponse> {\n let attempts = MAX_ATTEMPTS;\n let nextBackoff = INITIAL_BACKOFF;\n\n const deadline = Date.now() + timeoutMillis;\n let result = await this._transport.send(data, timeoutMillis);\n\n while (result.status === 'retryable' && attempts > 0) {\n attempts--;\n\n // use maximum of computed backoff and 0 to avoid negative timeouts\n const backoff = Math.max(\n Math.min(nextBackoff * (1 + getJitter()), MAX_BACKOFF),\n 0\n );\n nextBackoff = nextBackoff * BACKOFF_MULTIPLIER;\n const retryInMillis = result.retryInMillis ?? backoff;\n\n // return when expected retry time is after the export deadline.\n const remainingTimeoutMillis = deadline - Date.now();\n if (retryInMillis > remainingTimeoutMillis) {\n diag.info(\n `Export retry time ${Math.round(retryInMillis)}ms exceeds remaining timeout ${Math.round(\n remainingTimeoutMillis\n )}ms, not retrying further.`\n );\n return result;\n }\n\n diag.verbose(`Scheduling export retry in ${Math.round(retryInMillis)}ms`);\n result = await this.retry(data, remainingTimeoutMillis, retryInMillis);\n }\n\n if (result.status === 'success') {\n diag.verbose(\n `Export succeeded after ${MAX_ATTEMPTS - attempts} retry attempts.`\n );\n } else if (result.status === 'retryable') {\n diag.info(\n `Export failed after maximum retry attempts (${MAX_ATTEMPTS}).`\n );\n } else {\n diag.info(`Export failed with non-retryable error: ${result.error}`);\n }\n\n return result;\n }\n\n shutdown() {\n return this._transport.shutdown();\n }\n}\n\n/**\n * Creates an Exporter Transport that retries on 'retryable' response.\n */\nexport function createRetryingTransport(options: {\n // Underlying transport to wrap.\n transport: IExporterTransport;\n}): IExporterTransport {\n return new RetryingTransport(options.transport);\n}\n"]}
1
+ {"version":3,"file":"retrying-transport.js","sourceRoot":"","sources":["../../src/retrying-transport.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,MAAM,YAAY,GAAG,CAAC,CAAC;AACvB,MAAM,eAAe,GAAG,IAAI,CAAC;AAC7B,MAAM,WAAW,GAAG,IAAI,CAAC;AACzB,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAC/B,MAAM,MAAM,GAAG,GAAG,CAAC;AAEnB;;GAEG;AACH,SAAS,SAAS;IAChB,OAAO,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,GAAG,MAAM,CAAC;AAC/C,CAAC;AAED,MAAM,iBAAiB;IACb,UAAU,CAAqB;IAEvC,YAAY,SAA6B;QACvC,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;IAC9B,CAAC;IAEO,KAAK,CACX,IAAgB,EAChB,aAAqB,EACrB,QAAgB;QAEhB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,UAAU,CAAC,GAAG,EAAE;gBACd,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YAClE,CAAC,EAAE,QAAQ,CAAC,CAAC;QACf,CAAC,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,IAAI,CAA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Q,kBAAkB,CACpE,CAAC;SACH;aAAM,IAAI,MAAM,CAAC,MAAM,KAAK,WAAW,EAAE;YACxC,IAAI,CAAC,IAAI,CACP,+CAA+C,YAAY,IAAI,CAChE,CAAC;SACH;aAAM;YACL,IAAI,CAAC,IAAI,CAAC,2CAA2C,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;SACtE;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;IACpC,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,uBAAuB,CAAC,OAGvC;IACC,OAAO,IAAI,iBAAiB,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClD,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { IExporterTransport } from './exporter-transport';\nimport type { ExportResponse } from './export-response';\nimport { diag } from '@opentelemetry/api';\n\nconst MAX_ATTEMPTS = 5;\nconst INITIAL_BACKOFF = 1000;\nconst MAX_BACKOFF = 5000;\nconst BACKOFF_MULTIPLIER = 1.5;\nconst JITTER = 0.2;\n\n/**\n * Get a pseudo-random jitter that falls in the range of [-JITTER, +JITTER]\n */\nfunction getJitter() {\n return Math.random() * (2 * JITTER) - JITTER;\n}\n\nclass RetryingTransport implements IExporterTransport {\n private _transport: IExporterTransport;\n\n constructor(transport: IExporterTransport) {\n this._transport = transport;\n }\n\n private retry(\n data: Uint8Array,\n timeoutMillis: number,\n inMillis: number\n ): Promise<ExportResponse> {\n return new Promise((resolve, reject) => {\n setTimeout(() => {\n this._transport.send(data, timeoutMillis).then(resolve, reject);\n }, inMillis);\n });\n }\n\n async send(data: Uint8Array, timeoutMillis: number): Promise<ExportResponse> {\n let attempts = MAX_ATTEMPTS;\n let nextBackoff = INITIAL_BACKOFF;\n\n const deadline = Date.now() + timeoutMillis;\n let result = await this._transport.send(data, timeoutMillis);\n\n while (result.status === 'retryable' && attempts > 0) {\n attempts--;\n\n // use maximum of computed backoff and 0 to avoid negative timeouts\n const backoff = Math.max(\n Math.min(nextBackoff * (1 + getJitter()), MAX_BACKOFF),\n 0\n );\n nextBackoff = nextBackoff * BACKOFF_MULTIPLIER;\n const retryInMillis = result.retryInMillis ?? backoff;\n\n // return when expected retry time is after the export deadline.\n const remainingTimeoutMillis = deadline - Date.now();\n if (retryInMillis > remainingTimeoutMillis) {\n diag.info(\n `Export retry time ${Math.round(retryInMillis)}ms exceeds remaining timeout ${Math.round(\n remainingTimeoutMillis\n )}ms, not retrying further.`\n );\n return result;\n }\n\n diag.verbose(`Scheduling export retry in ${Math.round(retryInMillis)}ms`);\n result = await this.retry(data, remainingTimeoutMillis, retryInMillis);\n }\n\n if (result.status === 'success') {\n diag.verbose(\n `Export succeeded after ${MAX_ATTEMPTS - attempts} retry attempts.`\n );\n } else if (result.status === 'retryable') {\n diag.info(\n `Export failed after maximum retry attempts (${MAX_ATTEMPTS}).`\n );\n } else {\n diag.info(`Export failed with non-retryable error: ${result.error}`);\n }\n\n return result;\n }\n\n shutdown() {\n return this._transport.shutdown();\n }\n}\n\n/**\n * Creates an Exporter Transport that retries on 'retryable' response.\n */\nexport function createRetryingTransport(options: {\n // Underlying transport to wrap.\n transport: IExporterTransport;\n}): IExporterTransport {\n return new RetryingTransport(options.transport);\n}\n"]}
@@ -1,5 +1,5 @@
1
- import { IExporterTransport } from '../exporter-transport';
2
- import { HeadersFactory } from '../configuration/otlp-http-configuration';
1
+ import type { IExporterTransport } from '../exporter-transport';
2
+ import type { HeadersFactory } from '../configuration/otlp-http-configuration';
3
3
  export interface FetchTransportParameters {
4
4
  url: string;
5
5
  headers: HeadersFactory;