|
| 1 | +diff --git a/build/esnext/transport/http-exporter-transport.js b/build/esnext/transport/http-exporter-transport.js |
| 2 | +index 7977489487a2236fbd0e4c2273ef53fd3c7b93a8..edec72e84b575cb07ea3e4710f9bcb61f3915805 100644 |
| 3 | +--- a/build/esnext/transport/http-exporter-transport.js |
| 4 | ++++ b/build/esnext/transport/http-exporter-transport.js |
| 5 | +@@ -20,7 +20,7 @@ class HttpExporterTransport { |
| 6 | + this._parameters = _parameters; |
| 7 | + } |
| 8 | + async send(data, timeoutMillis) { |
| 9 | +- const { agent, send } = this._loadUtils(); |
| 10 | ++ const { agent, send } = await this._loadUtils(); |
| 11 | + return new Promise(resolve => { |
| 12 | + send(this._parameters, agent, data, result => { |
| 13 | + resolve(result); |
| 14 | +@@ -30,13 +30,11 @@ class HttpExporterTransport { |
| 15 | + shutdown() { |
| 16 | + // intentionally left empty, nothing to do. |
| 17 | + } |
| 18 | +- _loadUtils() { |
| 19 | ++ async _loadUtils() { |
| 20 | + let utils = this._utils; |
| 21 | + if (utils === null) { |
| 22 | + // Lazy require to ensure that http/https is not required before instrumentations can wrap it. |
| 23 | +- const { sendWithHttp, createHttpAgent, |
| 24 | +- // eslint-disable-next-line @typescript-eslint/no-var-requires |
| 25 | +- } = require('./http-transport-utils'); |
| 26 | ++ const { sendWithHttp, createHttpAgent } = await import('./http-transport-utils'); |
| 27 | + utils = this._utils = { |
| 28 | + agent: createHttpAgent(this._parameters.url, this._parameters.agentOptions), |
| 29 | + send: sendWithHttp, |
| 30 | +diff --git a/package.json b/package.json |
| 31 | +index d00689f7f0eb517923fe6f6f9e8b6b624d5936ca..c60c871496c8823ee1c3d0ba62a11553eb35822b 100644 |
| 32 | +--- a/package.json |
| 33 | ++++ b/package.json |
| 34 | +@@ -3,24 +3,24 @@ |
| 35 | + "version": "0.200.0", |
| 36 | + "description": "OpenTelemetry OTLP Exporter base (for internal use only)", |
| 37 | + "main": "build/src/index.js", |
| 38 | +- "module": "build/esm/index.js", |
| 39 | ++ "module": "build/esnext/index.js", |
| 40 | + "esnext": "build/esnext/index.js", |
| 41 | + "types": "build/src/index.d.ts", |
| 42 | + "exports": { |
| 43 | + ".": { |
| 44 | +- "module": "./build/esm/index.js", |
| 45 | ++ "module": "./build/esnext/index.js", |
| 46 | + "esnext": "./build/esnext/index.js", |
| 47 | + "types": "./build/src/index.d.ts", |
| 48 | + "default": "./build/src/index.js" |
| 49 | + }, |
| 50 | + "./node-http": { |
| 51 | +- "module": "./build/esm/index-node-http.js", |
| 52 | ++ "module": "./build/esnext/index-node-http.js", |
| 53 | + "esnext": "./build/esnext/index-node-http.js", |
| 54 | + "types": "./build/src/index-node-http.d.ts", |
| 55 | + "default": "./build/src/index-node-http.js" |
| 56 | + }, |
| 57 | + "./browser-http": { |
| 58 | +- "module": "./build/esm/index-browser-http.js", |
| 59 | ++ "module": "./build/esnext/index-browser-http.js", |
| 60 | + "esnext": "./build/esnext/index-browser-http.js", |
| 61 | + "types": "./build/src/index-browser-http.d.ts", |
| 62 | + "default": "./build/src/index-browser-http.js" |
0 commit comments