@opentelemetry/otlp-exporter-base 0.207.0 → 0.209.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 (154) hide show
  1. package/build/esm/OTLPExporterBase.d.ts +1 -1
  2. package/build/esm/OTLPExporterBase.js +2 -2
  3. package/build/esm/OTLPExporterBase.js.map +1 -1
  4. package/build/esm/configuration/convert-legacy-browser-http-options.js +2 -2
  5. package/build/esm/configuration/convert-legacy-browser-http-options.js.map +1 -1
  6. package/build/esm/configuration/convert-legacy-http-options.d.ts +4 -0
  7. package/build/esm/configuration/convert-legacy-http-options.js +23 -0
  8. package/build/esm/configuration/convert-legacy-http-options.js.map +1 -0
  9. package/build/esm/configuration/convert-legacy-node-http-options.js +2 -2
  10. package/build/esm/configuration/convert-legacy-node-http-options.js.map +1 -1
  11. package/build/esm/configuration/legacy-base-configuration.d.ts +26 -1
  12. package/build/esm/configuration/legacy-base-configuration.js.map +1 -1
  13. package/build/esm/configuration/otlp-http-configuration.d.ts +2 -1
  14. package/build/esm/configuration/otlp-http-configuration.js +9 -9
  15. package/build/esm/configuration/otlp-http-configuration.js.map +1 -1
  16. package/build/esm/configuration/shared-configuration.d.ts +2 -1
  17. package/build/esm/configuration/shared-configuration.js +1 -1
  18. package/build/esm/configuration/shared-configuration.js.map +1 -1
  19. package/build/esm/export-response.d.ts +1 -0
  20. package/build/esm/export-response.js.map +1 -1
  21. package/build/esm/is-export-retryable.d.ts +1 -1
  22. package/build/esm/is-export-retryable.js +5 -3
  23. package/build/esm/is-export-retryable.js.map +1 -1
  24. package/build/esm/otlp-browser-http-export-delegate.js +1 -1
  25. package/build/esm/otlp-browser-http-export-delegate.js.map +1 -1
  26. package/build/esm/otlp-export-delegate.js +9 -8
  27. package/build/esm/otlp-export-delegate.js.map +1 -1
  28. package/build/esm/retrying-transport.js +17 -5
  29. package/build/esm/retrying-transport.js.map +1 -1
  30. package/build/esm/transport/fetch-transport.d.ts +2 -1
  31. package/build/esm/transport/fetch-transport.js +13 -8
  32. package/build/esm/transport/fetch-transport.js.map +1 -1
  33. package/build/esm/transport/http-exporter-transport.js +5 -4
  34. package/build/esm/transport/http-exporter-transport.js.map +1 -1
  35. package/build/esm/transport/http-transport-types.d.ts +2 -1
  36. package/build/esm/transport/http-transport-types.js.map +1 -1
  37. package/build/esm/transport/http-transport-utils.d.ts +1 -2
  38. package/build/esm/transport/http-transport-utils.js +37 -14
  39. package/build/esm/transport/http-transport-utils.js.map +1 -1
  40. package/build/esm/transport/send-beacon-transport.d.ts +4 -2
  41. package/build/esm/transport/send-beacon-transport.js +5 -4
  42. package/build/esm/transport/send-beacon-transport.js.map +1 -1
  43. package/build/esm/transport/xhr-transport.d.ts +2 -1
  44. package/build/esm/transport/xhr-transport.js +11 -10
  45. package/build/esm/transport/xhr-transport.js.map +1 -1
  46. package/build/esm/util.d.ts +1 -1
  47. package/build/esm/util.js +10 -12
  48. package/build/esm/util.js.map +1 -1
  49. package/build/esm/version.d.ts +1 -1
  50. package/build/esm/version.js +1 -1
  51. package/build/esm/version.js.map +1 -1
  52. package/build/esnext/OTLPExporterBase.d.ts +1 -1
  53. package/build/esnext/OTLPExporterBase.js +2 -2
  54. package/build/esnext/OTLPExporterBase.js.map +1 -1
  55. package/build/esnext/configuration/convert-legacy-browser-http-options.js +2 -2
  56. package/build/esnext/configuration/convert-legacy-browser-http-options.js.map +1 -1
  57. package/build/esnext/configuration/convert-legacy-http-options.d.ts +4 -0
  58. package/build/esnext/configuration/convert-legacy-http-options.js +23 -0
  59. package/build/esnext/configuration/convert-legacy-http-options.js.map +1 -0
  60. package/build/esnext/configuration/convert-legacy-node-http-options.js +2 -2
  61. package/build/esnext/configuration/convert-legacy-node-http-options.js.map +1 -1
  62. package/build/esnext/configuration/legacy-base-configuration.d.ts +26 -1
  63. package/build/esnext/configuration/legacy-base-configuration.js.map +1 -1
  64. package/build/esnext/configuration/otlp-http-configuration.d.ts +2 -1
  65. package/build/esnext/configuration/otlp-http-configuration.js +9 -9
  66. package/build/esnext/configuration/otlp-http-configuration.js.map +1 -1
  67. package/build/esnext/configuration/shared-configuration.d.ts +2 -1
  68. package/build/esnext/configuration/shared-configuration.js +1 -1
  69. package/build/esnext/configuration/shared-configuration.js.map +1 -1
  70. package/build/esnext/export-response.d.ts +1 -0
  71. package/build/esnext/export-response.js.map +1 -1
  72. package/build/esnext/is-export-retryable.d.ts +1 -1
  73. package/build/esnext/is-export-retryable.js +5 -3
  74. package/build/esnext/is-export-retryable.js.map +1 -1
  75. package/build/esnext/otlp-browser-http-export-delegate.js +1 -1
  76. package/build/esnext/otlp-browser-http-export-delegate.js.map +1 -1
  77. package/build/esnext/otlp-export-delegate.js +9 -8
  78. package/build/esnext/otlp-export-delegate.js.map +1 -1
  79. package/build/esnext/retrying-transport.js +17 -5
  80. package/build/esnext/retrying-transport.js.map +1 -1
  81. package/build/esnext/transport/fetch-transport.d.ts +2 -1
  82. package/build/esnext/transport/fetch-transport.js +13 -8
  83. package/build/esnext/transport/fetch-transport.js.map +1 -1
  84. package/build/esnext/transport/http-exporter-transport.js +5 -4
  85. package/build/esnext/transport/http-exporter-transport.js.map +1 -1
  86. package/build/esnext/transport/http-transport-types.d.ts +2 -1
  87. package/build/esnext/transport/http-transport-types.js.map +1 -1
  88. package/build/esnext/transport/http-transport-utils.d.ts +1 -2
  89. package/build/esnext/transport/http-transport-utils.js +37 -14
  90. package/build/esnext/transport/http-transport-utils.js.map +1 -1
  91. package/build/esnext/transport/send-beacon-transport.d.ts +4 -2
  92. package/build/esnext/transport/send-beacon-transport.js +5 -4
  93. package/build/esnext/transport/send-beacon-transport.js.map +1 -1
  94. package/build/esnext/transport/xhr-transport.d.ts +2 -1
  95. package/build/esnext/transport/xhr-transport.js +11 -10
  96. package/build/esnext/transport/xhr-transport.js.map +1 -1
  97. package/build/esnext/util.d.ts +1 -1
  98. package/build/esnext/util.js +10 -12
  99. package/build/esnext/util.js.map +1 -1
  100. package/build/esnext/version.d.ts +1 -1
  101. package/build/esnext/version.js +1 -1
  102. package/build/esnext/version.js.map +1 -1
  103. package/build/src/OTLPExporterBase.d.ts +1 -1
  104. package/build/src/OTLPExporterBase.js +2 -2
  105. package/build/src/OTLPExporterBase.js.map +1 -1
  106. package/build/src/configuration/convert-legacy-browser-http-options.js +2 -2
  107. package/build/src/configuration/convert-legacy-browser-http-options.js.map +1 -1
  108. package/build/src/configuration/convert-legacy-http-options.d.ts +4 -0
  109. package/build/src/configuration/convert-legacy-http-options.js +27 -0
  110. package/build/src/configuration/convert-legacy-http-options.js.map +1 -0
  111. package/build/src/configuration/convert-legacy-node-http-options.js +2 -2
  112. package/build/src/configuration/convert-legacy-node-http-options.js.map +1 -1
  113. package/build/src/configuration/legacy-base-configuration.d.ts +26 -1
  114. package/build/src/configuration/legacy-base-configuration.js.map +1 -1
  115. package/build/src/configuration/otlp-http-configuration.d.ts +2 -1
  116. package/build/src/configuration/otlp-http-configuration.js +9 -9
  117. package/build/src/configuration/otlp-http-configuration.js.map +1 -1
  118. package/build/src/configuration/shared-configuration.d.ts +2 -1
  119. package/build/src/configuration/shared-configuration.js +1 -1
  120. package/build/src/configuration/shared-configuration.js.map +1 -1
  121. package/build/src/export-response.d.ts +1 -0
  122. package/build/src/export-response.js.map +1 -1
  123. package/build/src/is-export-retryable.d.ts +1 -1
  124. package/build/src/is-export-retryable.js +7 -5
  125. package/build/src/is-export-retryable.js.map +1 -1
  126. package/build/src/otlp-browser-http-export-delegate.js +1 -1
  127. package/build/src/otlp-browser-http-export-delegate.js.map +1 -1
  128. package/build/src/otlp-export-delegate.js +9 -8
  129. package/build/src/otlp-export-delegate.js.map +1 -1
  130. package/build/src/retrying-transport.js +17 -5
  131. package/build/src/retrying-transport.js.map +1 -1
  132. package/build/src/transport/fetch-transport.d.ts +2 -1
  133. package/build/src/transport/fetch-transport.js +12 -7
  134. package/build/src/transport/fetch-transport.js.map +1 -1
  135. package/build/src/transport/http-exporter-transport.js +5 -4
  136. package/build/src/transport/http-exporter-transport.js.map +1 -1
  137. package/build/src/transport/http-transport-types.d.ts +2 -1
  138. package/build/src/transport/http-transport-types.js.map +1 -1
  139. package/build/src/transport/http-transport-utils.d.ts +1 -2
  140. package/build/src/transport/http-transport-utils.js +36 -13
  141. package/build/src/transport/http-transport-utils.js.map +1 -1
  142. package/build/src/transport/send-beacon-transport.d.ts +4 -2
  143. package/build/src/transport/send-beacon-transport.js +5 -4
  144. package/build/src/transport/send-beacon-transport.js.map +1 -1
  145. package/build/src/transport/xhr-transport.d.ts +2 -1
  146. package/build/src/transport/xhr-transport.js +10 -9
  147. package/build/src/transport/xhr-transport.js.map +1 -1
  148. package/build/src/util.d.ts +1 -1
  149. package/build/src/util.js +10 -12
  150. package/build/src/util.js.map +1 -1
  151. package/build/src/version.d.ts +1 -1
  152. package/build/src/version.js +1 -1
  153. package/build/src/version.js.map +1 -1
  154. package/package.json +5 -5
@@ -2,7 +2,6 @@
2
2
  /// <reference types="node" />
3
3
  import type * as http from 'http';
4
4
  import type * as https from 'https';
5
- import { HttpRequestParameters } from './http-transport-types';
6
5
  import { ExportResponse } from '../export-response';
7
6
  /**
8
7
  * Sends data using http
@@ -13,6 +12,6 @@ import { ExportResponse } from '../export-response';
13
12
  * @param onDone
14
13
  * @param timeoutMillis
15
14
  */
16
- export declare function sendWithHttp(request: typeof https.request | typeof http.request, params: HttpRequestParameters, agent: http.Agent | https.Agent, data: Uint8Array, onDone: (response: ExportResponse) => void, timeoutMillis: number): void;
15
+ export declare function sendWithHttp(request: typeof https.request | typeof http.request, url: string, headers: Record<string, string>, compression: 'gzip' | 'none', userAgent: string | undefined, agent: http.Agent | https.Agent, data: Uint8Array, onDone: (response: ExportResponse) => void, timeoutMillis: number): void;
17
16
  export declare function compressAndSend(req: http.ClientRequest, compression: 'gzip' | 'none', data: Uint8Array, onError: (error: Error) => void): void;
18
17
  //# sourceMappingURL=http-transport-utils.d.ts.map
@@ -16,11 +16,10 @@ const DEFAULT_USER_AGENT = `OTel-OTLP-Exporter-JavaScript/${version_1.VERSION}`;
16
16
  * @param onDone
17
17
  * @param timeoutMillis
18
18
  */
19
- function sendWithHttp(request, params, agent, data, onDone, timeoutMillis) {
20
- const parsedUrl = new URL(params.url);
21
- const headers = { ...params.headers() };
22
- if (params.userAgent) {
23
- headers['User-Agent'] = `${params.userAgent} ${DEFAULT_USER_AGENT}`;
19
+ function sendWithHttp(request, url, headers, compression, userAgent, agent, data, onDone, timeoutMillis) {
20
+ const parsedUrl = new URL(url);
21
+ if (userAgent) {
22
+ headers['User-Agent'] = `${userAgent} ${DEFAULT_USER_AGENT}`;
24
23
  }
25
24
  else {
26
25
  headers['User-Agent'] = DEFAULT_USER_AGENT;
@@ -43,7 +42,7 @@ function sendWithHttp(request, params, agent, data, onDone, timeoutMillis) {
43
42
  data: Buffer.concat(responseData),
44
43
  });
45
44
  }
46
- else if (res.statusCode && (0, is_export_retryable_1.isExportRetryable)(res.statusCode)) {
45
+ else if (res.statusCode && (0, is_export_retryable_1.isExportHTTPErrorRetryable)(res.statusCode)) {
47
46
  onDone({
48
47
  status: 'retryable',
49
48
  retryInMillis: (0, is_export_retryable_1.parseRetryAfterToMills)(res.headers['retry-after']),
@@ -61,17 +60,25 @@ function sendWithHttp(request, params, agent, data, onDone, timeoutMillis) {
61
60
  req.setTimeout(timeoutMillis, () => {
62
61
  req.destroy();
63
62
  onDone({
64
- status: 'failure',
65
- error: new Error('Request Timeout'),
63
+ status: 'retryable',
64
+ error: new Error('Request timed out'),
66
65
  });
67
66
  });
68
67
  req.on('error', (error) => {
69
- onDone({
70
- status: 'failure',
71
- error,
72
- });
68
+ if (isHttpTransportNetworkErrorRetryable(error)) {
69
+ onDone({
70
+ status: 'retryable',
71
+ error,
72
+ });
73
+ }
74
+ else {
75
+ onDone({
76
+ status: 'failure',
77
+ error,
78
+ });
79
+ }
73
80
  });
74
- compressAndSend(req, params.compression, data, (error) => {
81
+ compressAndSend(req, compression, data, (error) => {
75
82
  onDone({
76
83
  status: 'failure',
77
84
  error,
@@ -97,4 +104,20 @@ function readableFromUint8Array(buff) {
97
104
  readable.push(null);
98
105
  return readable;
99
106
  }
107
+ function isHttpTransportNetworkErrorRetryable(error) {
108
+ const RETRYABLE_NETWORK_ERROR_CODES = new Set([
109
+ 'ECONNRESET',
110
+ 'ECONNREFUSED',
111
+ 'EPIPE',
112
+ 'ETIMEDOUT',
113
+ 'EAI_AGAIN',
114
+ 'ENOTFOUND',
115
+ 'ENETUNREACH',
116
+ 'EHOSTUNREACH',
117
+ ]);
118
+ if ('code' in error && typeof error.code === 'string') {
119
+ return RETRYABLE_NETWORK_ERROR_CODES.has(error.code);
120
+ }
121
+ return false;
122
+ }
100
123
  //# sourceMappingURL=http-transport-utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"http-transport-utils.js","sourceRoot":"","sources":["../../../src/transport/http-transport-utils.ts"],"names":[],"mappings":";;;AAiBA,6BAA6B;AAC7B,mCAAkC;AAGlC,gEAGgC;AAChC,oCAA6C;AAC7C,wCAAqC;AAErC,MAAM,kBAAkB,GAAG,iCAAiC,iBAAO,EAAE,CAAC;AAEtE;;;;;;;;GAQG;AACH,SAAgB,YAAY,CAC1B,OAAmD,EACnD,MAA6B,EAC7B,KAA+B,EAC/B,IAAgB,EAChB,MAA0C,EAC1C,aAAqB;IAErB,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAEtC,MAAM,OAAO,GAAG,EAAE,GAAG,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC;IACxC,IAAI,MAAM,CAAC,SAAS,EAAE;QACpB,OAAO,CAAC,YAAY,CAAC,GAAG,GAAG,MAAM,CAAC,SAAS,IAAI,kBAAkB,EAAE,CAAC;KACrE;SAAM;QACL,OAAO,CAAC,YAAY,CAAC,GAAG,kBAAkB,CAAC;KAC5C;IAED,MAAM,OAAO,GAA+C;QAC1D,QAAQ,EAAE,SAAS,CAAC,QAAQ;QAC5B,IAAI,EAAE,SAAS,C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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 type * as http from 'http';\nimport type * as https from 'https';\nimport * as zlib from 'zlib';\nimport { Readable } from 'stream';\nimport { HttpRequestParameters } from './http-transport-types';\nimport { ExportResponse } from '../export-response';\nimport {\n isExportRetryable,\n parseRetryAfterToMills,\n} from '../is-export-retryable';\nimport { OTLPExporterError } from '../types';\nimport { VERSION } from '../version';\n\nconst DEFAULT_USER_AGENT = `OTel-OTLP-Exporter-JavaScript/${VERSION}`;\n\n/**\n * Sends data using http\n * @param request\n * @param params\n * @param agent\n * @param data\n * @param onDone\n * @param timeoutMillis\n */\nexport function sendWithHttp(\n request: typeof https.request | typeof http.request,\n params: HttpRequestParameters,\n agent: http.Agent | https.Agent,\n data: Uint8Array,\n onDone: (response: ExportResponse) => void,\n timeoutMillis: number\n): void {\n const parsedUrl = new URL(params.url);\n\n const headers = { ...params.headers() };\n if (params.userAgent) {\n headers['User-Agent'] = `${params.userAgent} ${DEFAULT_USER_AGENT}`;\n } else {\n headers['User-Agent'] = DEFAULT_USER_AGENT;\n }\n\n const options: http.RequestOptions | https.RequestOptions = {\n hostname: parsedUrl.hostname,\n port: parsedUrl.port,\n path: parsedUrl.pathname,\n method: 'POST',\n headers,\n agent,\n };\n\n const req = request(options, (res: http.IncomingMessage) => {\n const responseData: Buffer[] = [];\n res.on('data', chunk => responseData.push(chunk));\n\n res.on('end', () => {\n if (res.statusCode && res.statusCode < 299) {\n onDone({\n status: 'success',\n data: Buffer.concat(responseData),\n });\n } else if (res.statusCode && isExportRetryable(res.statusCode)) {\n onDone({\n status: 'retryable',\n retryInMillis: parseRetryAfterToMills(res.headers['retry-after']),\n });\n } else {\n const error = new OTLPExporterError(\n res.statusMessage,\n res.statusCode,\n Buffer.concat(responseData).toString()\n );\n onDone({\n status: 'failure',\n error,\n });\n }\n });\n });\n\n req.setTimeout(timeoutMillis, () => {\n req.destroy();\n onDone({\n status: 'failure',\n error: new Error('Request Timeout'),\n });\n });\n\n req.on('error', (error: Error) => {\n onDone({\n status: 'failure',\n error,\n });\n });\n\n compressAndSend(req, params.compression, data, (error: Error) => {\n onDone({\n status: 'failure',\n error,\n });\n });\n}\n\nexport function compressAndSend(\n req: http.ClientRequest,\n compression: 'gzip' | 'none',\n data: Uint8Array,\n onError: (error: Error) => void\n) {\n let dataStream = readableFromUint8Array(data);\n\n if (compression === 'gzip') {\n req.setHeader('Content-Encoding', 'gzip');\n dataStream = dataStream\n .on('error', onError)\n .pipe(zlib.createGzip())\n .on('error', onError);\n }\n\n dataStream.pipe(req).on('error', onError);\n}\n\nfunction readableFromUint8Array(buff: string | Uint8Array): Readable {\n const readable = new Readable();\n readable.push(buff);\n readable.push(null);\n\n return readable;\n}\n"]}
1
+ {"version":3,"file":"http-transport-utils.js","sourceRoot":"","sources":["../../../src/transport/http-transport-utils.ts"],"names":[],"mappings":";;;AAiBA,6BAA6B;AAC7B,mCAAkC;AAElC,gEAGgC;AAChC,oCAA6C;AAC7C,wCAAqC;AAErC,MAAM,kBAAkB,GAAG,iCAAiC,iBAAO,EAAE,CAAC;AAEtE;;;;;;;;GAQG;AACH,SAAgB,YAAY,CAC1B,OAAmD,EACnD,GAAW,EACX,OAA+B,EAC/B,WAA4B,EAC5B,SAA6B,EAC7B,KAA+B,EAC/B,IAAgB,EAChB,MAA0C,EAC1C,aAAqB;IAErB,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;IAE/B,IAAI,SAAS,EAAE;QACb,OAAO,CAAC,YAAY,CAAC,GAAG,GAAG,SAAS,IAAI,kBAAkB,EAAE,CAAC;KAC9D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AAC;AAC5C,CAAC;AAjBD,0CAiBC;AAED,SAAS,sBAAsB,CAAC,IAAyB;IACvD,MAAM,QAAQ,GAAG,IAAI,iBAAQ,EAAE,CAAC;IAChC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACpB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEpB,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,SAAS,oCAAoC,CAAC,KAAY;IACxD,MAAM,6BAA6B,GAAG,IAAI,GAAG,CAAC;QAC5C,YAAY;QACZ,cAAc;QACd,OAAO;QACP,WAAW;QACX,WAAW;QACX,WAAW;QACX,aAAa;QACb,cAAc;KACf,CAAC,CAAC;IAEH,IAAI,MAAM,IAAI,KAAK,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE;QACrD,OAAO,6BAA6B,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;KACtD;IAED,OAAO,KAAK,CAAC;AACf,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 type * as http from 'http';\nimport type * as https from 'https';\nimport * as zlib from 'zlib';\nimport { Readable } from 'stream';\nimport { ExportResponse } from '../export-response';\nimport {\n isExportHTTPErrorRetryable,\n parseRetryAfterToMills,\n} from '../is-export-retryable';\nimport { OTLPExporterError } from '../types';\nimport { VERSION } from '../version';\n\nconst DEFAULT_USER_AGENT = `OTel-OTLP-Exporter-JavaScript/${VERSION}`;\n\n/**\n * Sends data using http\n * @param request\n * @param params\n * @param agent\n * @param data\n * @param onDone\n * @param timeoutMillis\n */\nexport function sendWithHttp(\n request: typeof https.request | typeof http.request,\n url: string,\n headers: Record<string, string>,\n compression: 'gzip' | 'none',\n userAgent: string | undefined,\n agent: http.Agent | https.Agent,\n data: Uint8Array,\n onDone: (response: ExportResponse) => void,\n timeoutMillis: number\n): void {\n const parsedUrl = new URL(url);\n\n if (userAgent) {\n headers['User-Agent'] = `${userAgent} ${DEFAULT_USER_AGENT}`;\n } else {\n headers['User-Agent'] = DEFAULT_USER_AGENT;\n }\n\n const options: http.RequestOptions | https.RequestOptions = {\n hostname: parsedUrl.hostname,\n port: parsedUrl.port,\n path: parsedUrl.pathname,\n method: 'POST',\n headers,\n agent,\n };\n\n const req = request(options, (res: http.IncomingMessage) => {\n const responseData: Buffer[] = [];\n res.on('data', chunk => responseData.push(chunk));\n\n res.on('end', () => {\n if (res.statusCode && res.statusCode < 299) {\n onDone({\n status: 'success',\n data: Buffer.concat(responseData),\n });\n } else if (res.statusCode && isExportHTTPErrorRetryable(res.statusCode)) {\n onDone({\n status: 'retryable',\n retryInMillis: parseRetryAfterToMills(res.headers['retry-after']),\n });\n } else {\n const error = new OTLPExporterError(\n res.statusMessage,\n res.statusCode,\n Buffer.concat(responseData).toString()\n );\n onDone({\n status: 'failure',\n error,\n });\n }\n });\n });\n\n req.setTimeout(timeoutMillis, () => {\n req.destroy();\n onDone({\n status: 'retryable',\n error: new Error('Request timed out'),\n });\n });\n\n req.on('error', (error: Error) => {\n if (isHttpTransportNetworkErrorRetryable(error)) {\n onDone({\n status: 'retryable',\n error,\n });\n } else {\n onDone({\n status: 'failure',\n error,\n });\n }\n });\n\n compressAndSend(req, compression, data, (error: Error) => {\n onDone({\n status: 'failure',\n error,\n });\n });\n}\n\nexport function compressAndSend(\n req: http.ClientRequest,\n compression: 'gzip' | 'none',\n data: Uint8Array,\n onError: (error: Error) => void\n) {\n let dataStream = readableFromUint8Array(data);\n\n if (compression === 'gzip') {\n req.setHeader('Content-Encoding', 'gzip');\n dataStream = dataStream\n .on('error', onError)\n .pipe(zlib.createGzip())\n .on('error', onError);\n }\n\n dataStream.pipe(req).on('error', onError);\n}\n\nfunction readableFromUint8Array(buff: string | Uint8Array): Readable {\n const readable = new Readable();\n readable.push(buff);\n readable.push(null);\n\n return readable;\n}\n\nfunction isHttpTransportNetworkErrorRetryable(error: Error): boolean {\n const RETRYABLE_NETWORK_ERROR_CODES = new Set([\n 'ECONNRESET',\n 'ECONNREFUSED',\n 'EPIPE',\n 'ETIMEDOUT',\n 'EAI_AGAIN',\n 'ENOTFOUND',\n 'ENETUNREACH',\n 'EHOSTUNREACH',\n ]);\n\n if ('code' in error && typeof error.code === 'string') {\n return RETRYABLE_NETWORK_ERROR_CODES.has(error.code);\n }\n\n return false;\n}\n"]}
@@ -1,10 +1,12 @@
1
1
  import { IExporterTransport } from '../exporter-transport';
2
+ import { HeadersFactory } from '../configuration/otlp-http-configuration';
2
3
  export interface SendBeaconParameters {
3
4
  url: string;
4
5
  /**
5
- * for instance 'application/x-protobuf'
6
+ * Only `Content-Type` will be used, sendBeacon does not support custom headers
7
+ * https://developer.mozilla.org/en-US/docs/Web/API/Navigator/sendBeacon
6
8
  */
7
- blobType: string;
9
+ headers: HeadersFactory;
8
10
  }
9
11
  export declare function createSendBeaconTransport(parameters: SendBeaconParameters): IExporterTransport;
10
12
  //# sourceMappingURL=send-beacon-transport.d.ts.map
@@ -19,12 +19,13 @@ exports.createSendBeaconTransport = void 0;
19
19
  const api_1 = require("@opentelemetry/api");
20
20
  class SendBeaconTransport {
21
21
  _params;
22
- constructor(_params) {
23
- this._params = _params;
22
+ constructor(params) {
23
+ this._params = params;
24
24
  }
25
- send(data) {
25
+ async send(data) {
26
+ const blobType = (await this._params.headers())['Content-Type'];
26
27
  return new Promise(resolve => {
27
- if (navigator.sendBeacon(this._params.url, new Blob([data], { type: this._params.blobType }))) {
28
+ if (navigator.sendBeacon(this._params.url, new Blob([data], { type: blobType }))) {
28
29
  // no way to signal retry, treat everything as success
29
30
  api_1.diag.debug('SendBeacon success');
30
31
  resolve({
@@ -1 +1 @@
1
- {"version":3,"file":"send-beacon-transport.js","sourceRoot":"","sources":["../../../src/transport/send-beacon-transport.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAIH,4CAA0C;AAU1C,MAAM,mBAAmB;IACH;IAApB,YAAoB,OAA6B;QAA7B,YAAO,GAAP,OAAO,CAAsB;IAAG,CAAC;IACrD,IAAI,CAAC,IAAgB;QACnB,OAAO,IAAI,OAAO,CAAiB,OAAO,CAAC,EAAE;YAC3C,IACE,SAAS,CAAC,UAAU,CAClB,IAAI,CAAC,OAAO,CAAC,GAAG,EAChB,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAClD,EACD;gBACA,sDAAsD;gBACtD,UAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;gBACjC,OAAO,CAAC;oBACN,MAAM,EAAE,SAAS;iBAClB,CAAC,CAAC;aACJ;iBAAM;gBACL,OAAO,CAAC;oBACN,MAAM,EAAE,SAAS;oBACjB,KAAK,EAAE,IAAI,KAAK,CAAC,mBAAmB,CAAC;iBACtC,CAAC,CAAC;aACJ;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED,QAAQ;QACN,2CAA2C;IAC7C,CAAC;CACF;AAED,SAAgB,yBAAyB,CACvC,UAAgC;IAEhC,OAAO,IAAI,mBAAmB,CAAC,UAAU,CAAC,CAAC;AAC7C,CAAC;AAJD,8DAIC","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\nexport interface SendBeaconParameters {\n url: string;\n /**\n * for instance 'application/x-protobuf'\n */\n blobType: string;\n}\n\nclass SendBeaconTransport implements IExporterTransport {\n constructor(private _params: SendBeaconParameters) {}\n send(data: Uint8Array): Promise<ExportResponse> {\n return new Promise<ExportResponse>(resolve => {\n if (\n navigator.sendBeacon(\n this._params.url,\n new Blob([data], { type: this._params.blobType })\n )\n ) {\n // no way to signal retry, treat everything as success\n diag.debug('SendBeacon success');\n resolve({\n status: 'success',\n });\n } else {\n resolve({\n status: 'failure',\n error: new Error('SendBeacon failed'),\n });\n }\n });\n }\n\n shutdown(): void {\n // Intentionally left empty, nothing to do.\n }\n}\n\nexport function createSendBeaconTransport(\n parameters: SendBeaconParameters\n): IExporterTransport {\n return new SendBeaconTransport(parameters);\n}\n"]}
1
+ {"version":3,"file":"send-beacon-transport.js","sourceRoot":"","sources":["../../../src/transport/send-beacon-transport.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAIH,4CAA0C;AAY1C,MAAM,mBAAmB;IACf,OAAO,CAAuB;IACtC,YAAY,MAA4B;QACtC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,IAAgB;QACzB,MAAM,QAAQ,GAAG,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,cAAc,CAAC,CAAC;QAChE,OAAO,IAAI,OAAO,CAAiB,OAAO,CAAC,EAAE;YAC3C,IACE,SAAS,CAAC,UAAU,CAClB,IAAI,CAAC,OAAO,CAAC,GAAG,EAChB,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CACrC,EACD;gBACA,sDAAsD;gBACtD,UAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;gBACjC,OAAO,CAAC;oBACN,MAAM,EAAE,SAAS;iBAClB,CAAC,CAAC;aACJ;iBAAM;gBACL,OAAO,CAAC;oBACN,MAAM,EAAE,SAAS;oBACjB,KAAK,EAAE,IAAI,KAAK,CAAC,mBAAmB,CAAC;iBACtC,CAAC,CAAC;aACJ;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED,QAAQ;QACN,2CAA2C;IAC7C,CAAC;CACF;AAED,SAAgB,yBAAyB,CACvC,UAAgC;IAEhC,OAAO,IAAI,mBAAmB,CAAC,UAAU,CAAC,CAAC;AAC7C,CAAC;AAJD,8DAIC","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';\nimport { HeadersFactory } from '../configuration/otlp-http-configuration';\n\nexport interface SendBeaconParameters {\n url: string;\n /**\n * Only `Content-Type` will be used, sendBeacon does not support custom headers\n * https://developer.mozilla.org/en-US/docs/Web/API/Navigator/sendBeacon\n */\n headers: HeadersFactory;\n}\n\nclass SendBeaconTransport implements IExporterTransport {\n private _params: SendBeaconParameters;\n constructor(params: SendBeaconParameters) {\n this._params = params;\n }\n\n async send(data: Uint8Array): Promise<ExportResponse> {\n const blobType = (await this._params.headers())['Content-Type'];\n return new Promise<ExportResponse>(resolve => {\n if (\n navigator.sendBeacon(\n this._params.url,\n new Blob([data], { type: blobType })\n )\n ) {\n // no way to signal retry, treat everything as success\n diag.debug('SendBeacon success');\n resolve({\n status: 'success',\n });\n } else {\n resolve({\n status: 'failure',\n error: new Error('SendBeacon failed'),\n });\n }\n });\n }\n\n shutdown(): void {\n // Intentionally left empty, nothing to do.\n }\n}\n\nexport function createSendBeaconTransport(\n parameters: SendBeaconParameters\n): IExporterTransport {\n return new SendBeaconTransport(parameters);\n}\n"]}
@@ -1,11 +1,12 @@
1
1
  import { IExporterTransport } from '../exporter-transport';
2
+ import { HeadersFactory } from '../configuration/otlp-http-configuration';
2
3
  /**
3
4
  * @deprecated favor the fetch transport
4
5
  * @see {@link createFetchTransport}
5
6
  */
6
7
  export interface XhrRequestParameters {
7
8
  url: string;
8
- headers: () => Record<string, string>;
9
+ headers: HeadersFactory;
9
10
  }
10
11
  /**
11
12
  * @deprecated use {@link createFetchTransport} instead
@@ -20,21 +20,21 @@ const api_1 = require("@opentelemetry/api");
20
20
  const is_export_retryable_1 = require("../is-export-retryable");
21
21
  class XhrTransport {
22
22
  _parameters;
23
- constructor(_parameters) {
24
- this._parameters = _parameters;
23
+ constructor(parameters) {
24
+ this._parameters = parameters;
25
25
  }
26
- send(data, timeoutMillis) {
27
- return new Promise(resolve => {
26
+ async send(data, timeoutMillis) {
27
+ const headers = await this._parameters.headers();
28
+ const response = await new Promise(resolve => {
28
29
  const xhr = new XMLHttpRequest();
29
30
  xhr.timeout = timeoutMillis;
30
31
  xhr.open('POST', this._parameters.url);
31
- const headers = this._parameters.headers();
32
32
  Object.entries(headers).forEach(([k, v]) => {
33
33
  xhr.setRequestHeader(k, v);
34
34
  });
35
35
  xhr.ontimeout = _ => {
36
36
  resolve({
37
- status: 'failure',
37
+ status: 'retryable',
38
38
  error: new Error('XHR request timed out'),
39
39
  });
40
40
  };
@@ -45,7 +45,7 @@ class XhrTransport {
45
45
  status: 'success',
46
46
  });
47
47
  }
48
- else if (xhr.status && (0, is_export_retryable_1.isExportRetryable)(xhr.status)) {
48
+ else if (xhr.status && (0, is_export_retryable_1.isExportHTTPErrorRetryable)(xhr.status)) {
49
49
  resolve({
50
50
  status: 'retryable',
51
51
  retryInMillis: (0, is_export_retryable_1.parseRetryAfterToMills)(xhr.getResponseHeader('Retry-After')),
@@ -66,12 +66,13 @@ class XhrTransport {
66
66
  };
67
67
  xhr.onerror = () => {
68
68
  resolve({
69
- status: 'failure',
70
- error: new Error('XHR request errored'),
69
+ status: 'retryable',
70
+ error: new Error('XHR request encountered a network error'),
71
71
  });
72
72
  };
73
73
  xhr.send(data);
74
74
  });
75
+ return response;
75
76
  }
76
77
  shutdown() {
77
78
  // Intentionally left empty, nothing to do.
@@ -1 +1 @@
1
- {"version":3,"file":"xhr-transport.js","sourceRoot":"","sources":["../../../src/transport/xhr-transport.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAIH,4CAA0C;AAC1C,gEAGgC;AAahC,MAAM,YAAY;IACI;IAApB,YAAoB,WAAiC;QAAjC,gBAAW,GAAX,WAAW,CAAsB;IAAG,CAAC;IAEzD,IAAI,CAAC,IAAgB,EAAE,aAAqB;QAC1C,OAAO,IAAI,OAAO,CAAiB,OAAO,CAAC,EAAE;YAC3C,MAAM,GAAG,GAAG,IAAI,cAAc,EAAE,CAAC;YACjC,GAAG,CAAC,OAAO,GAAG,aAAa,CAAC;YAC5B,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;YACvC,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;YAC3C,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE;gBACzC,GAAG,CAAC,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YAC7B,CAAC,CAAC,CAAC;YAEH,GAAG,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE;gBAClB,OAAO,CAAC;oBACN,MAAM,EAAE,SAAS;oBACjB,KAAK,EA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;;;;GAKG;AACH,SAAgB,kBAAkB,CAChC,UAAgC;IAEhC,OAAO,IAAI,YAAY,CAAC,UAAU,CAAC,CAAC;AACtC,CAAC;AAJD,gDAIC","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';\nimport {\n isExportRetryable,\n parseRetryAfterToMills,\n} from '../is-export-retryable';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { createFetchTransport } from './fetch-transport';\n\n/**\n * @deprecated favor the fetch transport\n * @see {@link createFetchTransport}\n */\nexport interface XhrRequestParameters {\n url: string;\n headers: () => Record<string, string>;\n}\n\nclass XhrTransport implements IExporterTransport {\n constructor(private _parameters: XhrRequestParameters) {}\n\n send(data: Uint8Array, timeoutMillis: number): Promise<ExportResponse> {\n return new Promise<ExportResponse>(resolve => {\n const xhr = new XMLHttpRequest();\n xhr.timeout = timeoutMillis;\n xhr.open('POST', this._parameters.url);\n const headers = this._parameters.headers();\n Object.entries(headers).forEach(([k, v]) => {\n xhr.setRequestHeader(k, v);\n });\n\n xhr.ontimeout = _ => {\n resolve({\n status: 'failure',\n error: new Error('XHR request timed out'),\n });\n };\n\n xhr.onreadystatechange = () => {\n if (xhr.status >= 200 && xhr.status <= 299) {\n diag.debug('XHR success');\n resolve({\n status: 'success',\n });\n } else if (xhr.status && isExportRetryable(xhr.status)) {\n resolve({\n status: 'retryable',\n retryInMillis: parseRetryAfterToMills(\n xhr.getResponseHeader('Retry-After')\n ),\n });\n } else if (xhr.status !== 0) {\n resolve({\n status: 'failure',\n error: new Error('XHR request failed with non-retryable status'),\n });\n }\n };\n\n xhr.onabort = () => {\n resolve({\n status: 'failure',\n error: new Error('XHR request aborted'),\n });\n };\n xhr.onerror = () => {\n resolve({\n status: 'failure',\n error: new Error('XHR request errored'),\n });\n };\n\n xhr.send(data);\n });\n }\n\n shutdown() {\n // Intentionally left empty, nothing to do.\n }\n}\n\n/**\n * @deprecated use {@link createFetchTransport} instead\n *\n * Creates an exporter transport that uses XHR to send the data\n * @param parameters applied to each request made by transport\n */\nexport function createXhrTransport(\n parameters: XhrRequestParameters\n): IExporterTransport {\n return new XhrTransport(parameters);\n}\n"]}
1
+ {"version":3,"file":"xhr-transport.js","sourceRoot":"","sources":["../../../src/transport/xhr-transport.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAIH,4CAA0C;AAC1C,gEAGgC;AAchC,MAAM,YAAY;IACR,WAAW,CAAuB;IAE1C,YAAY,UAAgC;QAC1C,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAChC,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,IAAgB,EAAE,aAAqB;QAChD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;QACjD,MAAM,QAAQ,GAAG,MAAM,IAAI,OAAO,CAAiB,OAAO,CAAC,EAAE;YAC3D,MAAM,GAAG,GAAG,IAAI,cAAc,EAAE,CAAC;YACjC,GAAG,CAAC,OAAO,GAAG,aAAa,CAAC;YAC5B,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;YACvC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE;gBACzC,GAAG,CAAC,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YAC7B,CAAC,C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,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjB,CAAC,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,QAAQ;QACN,2CAA2C;IAC7C,CAAC;CACF;AAED;;;;;GAKG;AACH,SAAgB,kBAAkB,CAChC,UAAgC;IAEhC,OAAO,IAAI,YAAY,CAAC,UAAU,CAAC,CAAC;AACtC,CAAC;AAJD,gDAIC","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';\nimport {\n isExportHTTPErrorRetryable,\n parseRetryAfterToMills,\n} from '../is-export-retryable';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { createFetchTransport } from './fetch-transport';\nimport { HeadersFactory } from '../configuration/otlp-http-configuration';\n\n/**\n * @deprecated favor the fetch transport\n * @see {@link createFetchTransport}\n */\nexport interface XhrRequestParameters {\n url: string;\n headers: HeadersFactory;\n}\n\nclass XhrTransport implements IExporterTransport {\n private _parameters: XhrRequestParameters;\n\n constructor(parameters: XhrRequestParameters) {\n this._parameters = parameters;\n }\n\n async send(data: Uint8Array, timeoutMillis: number): Promise<ExportResponse> {\n const headers = await this._parameters.headers();\n const response = await new Promise<ExportResponse>(resolve => {\n const xhr = new XMLHttpRequest();\n xhr.timeout = timeoutMillis;\n xhr.open('POST', this._parameters.url);\n Object.entries(headers).forEach(([k, v]) => {\n xhr.setRequestHeader(k, v);\n });\n\n xhr.ontimeout = _ => {\n resolve({\n status: 'retryable',\n error: new Error('XHR request timed out'),\n });\n };\n\n xhr.onreadystatechange = () => {\n if (xhr.status >= 200 && xhr.status <= 299) {\n diag.debug('XHR success');\n resolve({\n status: 'success',\n });\n } else if (xhr.status && isExportHTTPErrorRetryable(xhr.status)) {\n resolve({\n status: 'retryable',\n retryInMillis: parseRetryAfterToMills(\n xhr.getResponseHeader('Retry-After')\n ),\n });\n } else if (xhr.status !== 0) {\n resolve({\n status: 'failure',\n error: new Error('XHR request failed with non-retryable status'),\n });\n }\n };\n\n xhr.onabort = () => {\n resolve({\n status: 'failure',\n error: new Error('XHR request aborted'),\n });\n };\n xhr.onerror = () => {\n resolve({\n status: 'retryable',\n error: new Error('XHR request encountered a network error'),\n });\n };\n\n xhr.send(data);\n });\n\n return response;\n }\n\n shutdown() {\n // Intentionally left empty, nothing to do.\n }\n}\n\n/**\n * @deprecated use {@link createFetchTransport} instead\n *\n * Creates an exporter transport that uses XHR to send the data\n * @param parameters applied to each request made by transport\n */\nexport function createXhrTransport(\n parameters: XhrRequestParameters\n): IExporterTransport {\n return new XhrTransport(parameters);\n}\n"]}
@@ -2,5 +2,5 @@
2
2
  * Parses headers from config leaving only those that have defined values
3
3
  * @param partialHeaders
4
4
  */
5
- export declare function validateAndNormalizeHeaders(partialHeaders: (() => Record<string, string>) | undefined): () => Record<string, string>;
5
+ export declare function validateAndNormalizeHeaders(partialHeaders: Record<string, string> | undefined): Record<string, string>;
6
6
  //# sourceMappingURL=util.d.ts.map
package/build/src/util.js CHANGED
@@ -22,18 +22,16 @@ const api_1 = require("@opentelemetry/api");
22
22
  * @param partialHeaders
23
23
  */
24
24
  function validateAndNormalizeHeaders(partialHeaders) {
25
- return () => {
26
- const headers = {};
27
- Object.entries(partialHeaders?.() ?? {}).forEach(([key, value]) => {
28
- if (typeof value !== 'undefined') {
29
- headers[key] = String(value);
30
- }
31
- else {
32
- api_1.diag.warn(`Header "${key}" has invalid value (${value}) and will be ignored`);
33
- }
34
- });
35
- return headers;
36
- };
25
+ const headers = {};
26
+ Object.entries(partialHeaders ?? {}).forEach(([key, value]) => {
27
+ if (typeof value !== 'undefined') {
28
+ headers[key] = String(value);
29
+ }
30
+ else {
31
+ api_1.diag.warn(`Header "${key}" has invalid value (${value}) and will be ignored`);
32
+ }
33
+ });
34
+ return headers;
37
35
  }
38
36
  exports.validateAndNormalizeHeaders = validateAndNormalizeHeaders;
39
37
  //# sourceMappingURL=util.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/util.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4CAA0C;AAE1C;;;GAGG;AACH,SAAgB,2BAA2B,CACzC,cAA0D;IAE1D,OAAO,GAAG,EAAE;QACV,MAAM,OAAO,GAA2B,EAAE,CAAC;QAC3C,MAAM,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;YAChE,IAAI,OAAO,KAAK,KAAK,WAAW,EAAE;gBAChC,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;aAC9B;iBAAM;gBACL,UAAI,CAAC,IAAI,CACP,WAAW,GAAG,wBAAwB,KAAK,uBAAuB,CACnE,CAAC;aACH;QACH,CAAC,CAAC,CAAC;QACH,OAAO,OAAO,CAAC;IACjB,CAAC,CAAC;AACJ,CAAC;AAhBD,kEAgBC","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 { diag } from '@opentelemetry/api';\n\n/**\n * Parses headers from config leaving only those that have defined values\n * @param partialHeaders\n */\nexport function validateAndNormalizeHeaders(\n partialHeaders: (() => Record<string, string>) | undefined\n): () => Record<string, string> {\n return () => {\n const headers: Record<string, string> = {};\n Object.entries(partialHeaders?.() ?? {}).forEach(([key, value]) => {\n if (typeof value !== 'undefined') {\n headers[key] = String(value);\n } else {\n diag.warn(\n `Header \"${key}\" has invalid value (${value}) and will be ignored`\n );\n }\n });\n return headers;\n };\n}\n"]}
1
+ {"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/util.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4CAA0C;AAE1C;;;GAGG;AACH,SAAgB,2BAA2B,CACzC,cAAkD;IAElD,MAAM,OAAO,GAA2B,EAAE,CAAC;IAC3C,MAAM,CAAC,OAAO,CAAC,cAAc,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QAC5D,IAAI,OAAO,KAAK,KAAK,WAAW,EAAE;YAChC,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;SAC9B;aAAM;YACL,UAAI,CAAC,IAAI,CACP,WAAW,GAAG,wBAAwB,KAAK,uBAAuB,CACnE,CAAC;SACH;IACH,CAAC,CAAC,CAAC;IACH,OAAO,OAAO,CAAC;AACjB,CAAC;AAdD,kEAcC","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 { diag } from '@opentelemetry/api';\n\n/**\n * Parses headers from config leaving only those that have defined values\n * @param partialHeaders\n */\nexport function validateAndNormalizeHeaders(\n partialHeaders: Record<string, string> | undefined\n): Record<string, string> {\n const headers: Record<string, string> = {};\n Object.entries(partialHeaders ?? {}).forEach(([key, value]) => {\n if (typeof value !== 'undefined') {\n headers[key] = String(value);\n } else {\n diag.warn(\n `Header \"${key}\" has invalid value (${value}) and will be ignored`\n );\n }\n });\n return headers;\n}\n"]}
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.207.0";
1
+ export declare const VERSION = "0.209.0";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -17,5 +17,5 @@
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.VERSION = void 0;
19
19
  // this is autogenerated file, see scripts/version-update.js
20
- exports.VERSION = '0.207.0';
20
+ exports.VERSION = '0.209.0';
21
21
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4DAA4D;AAC/C,QAAA,OAAO,GAAG,SAAS,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\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '0.207.0';\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4DAA4D;AAC/C,QAAA,OAAO,GAAG,SAAS,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\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '0.209.0';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentelemetry/otlp-exporter-base",
3
- "version": "0.207.0",
3
+ "version": "0.209.0",
4
4
  "description": "OpenTelemetry OTLP Exporter base (for internal use only)",
5
5
  "main": "build/src/index.js",
6
6
  "module": "build/esm/index.js",
@@ -74,8 +74,8 @@
74
74
  "access": "public"
75
75
  },
76
76
  "dependencies": {
77
- "@opentelemetry/core": "2.2.0",
78
- "@opentelemetry/otlp-transformer": "0.207.0"
77
+ "@opentelemetry/core": "2.3.0",
78
+ "@opentelemetry/otlp-transformer": "0.209.0"
79
79
  },
80
80
  "devDependencies": {
81
81
  "@babel/core": "7.27.1",
@@ -91,7 +91,7 @@
91
91
  "karma-mocha": "2.0.1",
92
92
  "karma-spec-reporter": "0.0.36",
93
93
  "karma-webpack": "5.0.1",
94
- "mocha": "11.7.4",
94
+ "mocha": "11.7.5",
95
95
  "nyc": "17.1.0",
96
96
  "sinon": "18.0.1",
97
97
  "ts-loader": "9.5.4",
@@ -104,5 +104,5 @@
104
104
  },
105
105
  "homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/otlp-exporter-base",
106
106
  "sideEffects": false,
107
- "gitHead": "fb6476d8243ac8dcaaea74130b9c50c43938275c"
107
+ "gitHead": "228cb920bbededf4f3fd6355e88409e84bfd87b6"
108
108
  }