|
| 1 | +diff --git a/build/esm/transport/http-exporter-transport.js b/build/esm/transport/http-exporter-transport.js |
| 2 | +index ef266685d979dc9112b3d5aa4c39b580be0cf1aa..47f7cfaa2f347f22c284fdae61250fe413aba5fc 100644 |
| 3 | +--- a/build/esm/transport/http-exporter-transport.js |
| 4 | ++++ b/build/esm/transport/http-exporter-transport.js |
| 5 | +@@ -13,75 +13,49 @@ |
| 6 | + * See the License for the specific language governing permissions and |
| 7 | + * limitations under the License. |
| 8 | + */ |
| 9 | +-var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { |
| 10 | +- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } |
| 11 | +- return new (P || (P = Promise))(function (resolve, reject) { |
| 12 | +- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } |
| 13 | +- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } |
| 14 | +- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } |
| 15 | +- step((generator = generator.apply(thisArg, _arguments || [])).next()); |
| 16 | +- }); |
| 17 | +-}; |
| 18 | +-var __generator = (this && this.__generator) || function (thisArg, body) { |
| 19 | +- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; |
| 20 | +- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; |
| 21 | +- function verb(n) { return function (v) { return step([n, v]); }; } |
| 22 | +- function step(op) { |
| 23 | +- if (f) throw new TypeError("Generator is already executing."); |
| 24 | +- while (_) try { |
| 25 | +- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; |
| 26 | +- if (y = 0, t) op = [op[0] & 2, t.value]; |
| 27 | +- switch (op[0]) { |
| 28 | +- case 0: case 1: t = op; break; |
| 29 | +- case 4: _.label++; return { value: op[1], done: false }; |
| 30 | +- case 5: _.label++; y = op[1]; op = [0]; continue; |
| 31 | +- case 7: op = _.ops.pop(); _.trys.pop(); continue; |
| 32 | +- default: |
| 33 | +- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } |
| 34 | +- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } |
| 35 | +- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } |
| 36 | +- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } |
| 37 | +- if (t[2]) _.ops.pop(); |
| 38 | +- _.trys.pop(); continue; |
| 39 | +- } |
| 40 | +- op = body.call(thisArg, _); |
| 41 | +- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } |
| 42 | +- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; |
| 43 | +- } |
| 44 | +-}; |
| 45 | +-var HttpExporterTransport = /** @class */ (function () { |
| 46 | +- function HttpExporterTransport(_parameters) { |
| 47 | +- this._parameters = _parameters; |
| 48 | +- this._send = null; |
| 49 | +- this._agent = null; |
| 50 | ++class HttpExporterTransport { |
| 51 | ++ constructor(_parameters) { |
| 52 | ++ this._parameters = _parameters; |
| 53 | ++ this._send = null; |
| 54 | ++ this._agent = null; |
| 55 | ++ } |
| 56 | ++ async send(data, timeoutMillis) { |
| 57 | ++ if (this._send == null) { |
| 58 | ++ // Lazy require to ensure that http/https is not required before instrumentations can wrap it. |
| 59 | ++ const { |
| 60 | ++ sendWithHttp, |
| 61 | ++ createHttpAgent, |
| 62 | ++ // eslint-disable-next-line @typescript-eslint/no-var-requires |
| 63 | ++ } = await import("./http-transport-utils"); |
| 64 | ++ this._agent = createHttpAgent( |
| 65 | ++ this._parameters.url, |
| 66 | ++ this._parameters.agentOptions |
| 67 | ++ ); |
| 68 | ++ this._send = sendWithHttp; |
| 69 | + } |
| 70 | +- HttpExporterTransport.prototype.send = function (data, timeoutMillis) { |
| 71 | +- return __awaiter(this, void 0, void 0, function () { |
| 72 | +- var _a, sendWithHttp, createHttpAgent; |
| 73 | +- var _this = this; |
| 74 | +- return __generator(this, function (_b) { |
| 75 | +- if (this._send == null) { |
| 76 | +- _a = require('./http-transport-utils'), sendWithHttp = _a.sendWithHttp, createHttpAgent = _a.createHttpAgent; |
| 77 | +- this._agent = createHttpAgent(this._parameters.url, this._parameters.agentOptions); |
| 78 | +- this._send = sendWithHttp; |
| 79 | +- } |
| 80 | +- return [2 /*return*/, new Promise(function (resolve) { |
| 81 | +- var _a; |
| 82 | +- // this will always be defined |
| 83 | +- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion |
| 84 | +- (_a = _this._send) === null || _a === void 0 ? void 0 : _a.call(_this, _this._parameters, _this._agent, data, function (result) { |
| 85 | +- resolve(result); |
| 86 | +- }, timeoutMillis); |
| 87 | +- })]; |
| 88 | +- }); |
| 89 | +- }); |
| 90 | +- }; |
| 91 | +- HttpExporterTransport.prototype.shutdown = function () { |
| 92 | +- // intentionally left empty, nothing to do. |
| 93 | +- }; |
| 94 | +- return HttpExporterTransport; |
| 95 | +-}()); |
| 96 | ++ return new Promise((resolve) => { |
| 97 | ++ var _a; |
| 98 | ++ // this will always be defined |
| 99 | ++ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion |
| 100 | ++ (_a = this._send) === null || _a === void 0 |
| 101 | ++ ? void 0 |
| 102 | ++ : _a.call( |
| 103 | ++ this, |
| 104 | ++ this._parameters, |
| 105 | ++ this._agent, |
| 106 | ++ data, |
| 107 | ++ (result) => { |
| 108 | ++ resolve(result); |
| 109 | ++ }, |
| 110 | ++ timeoutMillis |
| 111 | ++ ); |
| 112 | ++ }); |
| 113 | ++ } |
| 114 | ++ shutdown() { |
| 115 | ++ // intentionally left empty, nothing to do. |
| 116 | ++ } |
| 117 | ++} |
| 118 | + export function createHttpExporterTransport(parameters) { |
| 119 | +- return new HttpExporterTransport(parameters); |
| 120 | ++ return new HttpExporterTransport(parameters); |
| 121 | + } |
| 122 | + //# sourceMappingURL=http-exporter-transport.js.map |
| 123 | +\ No newline at end of file |
| 124 | +diff --git a/build/esnext/transport/http-exporter-transport.js b/build/esnext/transport/http-exporter-transport.js |
| 125 | +index e6b76f301baeb19f507b6072c0598e1d98ceebbb..32a62444cf4ef7ab2346df5b0ac2fb079c6b4268 100644 |
| 126 | +--- a/build/esnext/transport/http-exporter-transport.js |
| 127 | ++++ b/build/esnext/transport/http-exporter-transport.js |
| 128 | +@@ -24,7 +24,7 @@ class HttpExporterTransport { |
| 129 | + // Lazy require to ensure that http/https is not required before instrumentations can wrap it. |
| 130 | + const { sendWithHttp, createHttpAgent, |
| 131 | + // eslint-disable-next-line @typescript-eslint/no-var-requires |
| 132 | +- } = require('./http-transport-utils'); |
| 133 | ++ } = await import('./http-transport-utils'); |
| 134 | + this._agent = createHttpAgent(this._parameters.url, this._parameters.agentOptions); |
| 135 | + this._send = sendWithHttp; |
| 136 | + } |
0 commit comments