@opentelemetry/exporter-collector
Advanced tools
Comparing version 0.24.1-alpha.14 to 0.24.1-alpha.15
@@ -72,24 +72,17 @@ /* | ||
var body = JSON.stringify(serviceRequest); | ||
var promise = new Promise(function (resolve) { | ||
var _onSuccess = function () { | ||
onSuccess(); | ||
_onFinish(); | ||
}; | ||
var _onError = function (error) { | ||
onError(error); | ||
_onFinish(); | ||
}; | ||
var _onFinish = function () { | ||
resolve(); | ||
var index = _this._sendingPromises.indexOf(promise); | ||
_this._sendingPromises.splice(index, 1); | ||
}; | ||
var promise = new Promise(function (resolve, reject) { | ||
if (_this._useXHR) { | ||
sendWithXhr(body, _this.url, _this._headers, _onSuccess, _onError); | ||
sendWithXhr(body, _this.url, _this._headers, resolve, reject); | ||
} | ||
else { | ||
sendWithBeacon(body, _this.url, { type: 'application/json' }, _onSuccess, _onError); | ||
sendWithBeacon(body, _this.url, { type: 'application/json' }, resolve, reject); | ||
} | ||
}); | ||
}) | ||
.then(onSuccess, onError); | ||
this._sendingPromises.push(promise); | ||
var popPromise = function () { | ||
var index = _this._sendingPromises.indexOf(promise); | ||
_this._sendingPromises.splice(index, 1); | ||
}; | ||
promise.then(popPromise, popPromise); | ||
}; | ||
@@ -96,0 +89,0 @@ return CollectorExporterBrowserBase; |
@@ -64,19 +64,12 @@ /* | ||
var serviceRequest = this.convert(objects); | ||
var promise = new Promise(function (resolve) { | ||
var _onSuccess = function () { | ||
onSuccess(); | ||
_onFinish(); | ||
}; | ||
var _onError = function (error) { | ||
onError(error); | ||
_onFinish(); | ||
}; | ||
var _onFinish = function () { | ||
resolve(); | ||
var index = _this._sendingPromises.indexOf(promise); | ||
_this._sendingPromises.splice(index, 1); | ||
}; | ||
sendWithHttp(_this, JSON.stringify(serviceRequest), 'application/json', _onSuccess, _onError); | ||
}); | ||
var promise = new Promise(function (resolve, reject) { | ||
sendWithHttp(_this, JSON.stringify(serviceRequest), 'application/json', resolve, reject); | ||
}) | ||
.then(onSuccess, onError); | ||
this._sendingPromises.push(promise); | ||
var popPromise = function () { | ||
var index = _this._sendingPromises.indexOf(promise); | ||
_this._sendingPromises.splice(index, 1); | ||
}; | ||
promise.then(popPromise, popPromise); | ||
}; | ||
@@ -83,0 +76,0 @@ CollectorExporterNodeBase.prototype.onShutdown = function () { }; |
@@ -56,24 +56,17 @@ "use strict"; | ||
const body = JSON.stringify(serviceRequest); | ||
const promise = new Promise(resolve => { | ||
const _onSuccess = () => { | ||
onSuccess(); | ||
_onFinish(); | ||
}; | ||
const _onError = (error) => { | ||
onError(error); | ||
_onFinish(); | ||
}; | ||
const _onFinish = () => { | ||
resolve(); | ||
const index = this._sendingPromises.indexOf(promise); | ||
this._sendingPromises.splice(index, 1); | ||
}; | ||
const promise = new Promise((resolve, reject) => { | ||
if (this._useXHR) { | ||
util_2.sendWithXhr(body, this.url, this._headers, _onSuccess, _onError); | ||
util_2.sendWithXhr(body, this.url, this._headers, resolve, reject); | ||
} | ||
else { | ||
util_2.sendWithBeacon(body, this.url, { type: 'application/json' }, _onSuccess, _onError); | ||
util_2.sendWithBeacon(body, this.url, { type: 'application/json' }, resolve, reject); | ||
} | ||
}); | ||
}) | ||
.then(onSuccess, onError); | ||
this._sendingPromises.push(promise); | ||
const popPromise = () => { | ||
const index = this._sendingPromises.indexOf(promise); | ||
this._sendingPromises.splice(index, 1); | ||
}; | ||
promise.then(popPromise, popPromise); | ||
} | ||
@@ -80,0 +73,0 @@ } |
@@ -48,19 +48,12 @@ "use strict"; | ||
const serviceRequest = this.convert(objects); | ||
const promise = new Promise(resolve => { | ||
const _onSuccess = () => { | ||
onSuccess(); | ||
_onFinish(); | ||
}; | ||
const _onError = (error) => { | ||
onError(error); | ||
_onFinish(); | ||
}; | ||
const _onFinish = () => { | ||
resolve(); | ||
const index = this._sendingPromises.indexOf(promise); | ||
this._sendingPromises.splice(index, 1); | ||
}; | ||
util_2.sendWithHttp(this, JSON.stringify(serviceRequest), 'application/json', _onSuccess, _onError); | ||
}); | ||
const promise = new Promise((resolve, reject) => { | ||
util_2.sendWithHttp(this, JSON.stringify(serviceRequest), 'application/json', resolve, reject); | ||
}) | ||
.then(onSuccess, onError); | ||
this._sendingPromises.push(promise); | ||
const popPromise = () => { | ||
const index = this._sendingPromises.indexOf(promise); | ||
this._sendingPromises.splice(index, 1); | ||
}; | ||
promise.then(popPromise, popPromise); | ||
} | ||
@@ -67,0 +60,0 @@ onShutdown() { } |
{ | ||
"name": "@opentelemetry/exporter-collector", | ||
"version": "0.24.1-alpha.14+4553b29d", | ||
"version": "0.24.1-alpha.15+90ea0fed", | ||
"description": "OpenTelemetry Collector Exporter allows user to send collected traces to the OpenTelemetry Collector", | ||
@@ -88,8 +88,8 @@ "main": "build/src/index.js", | ||
"@opentelemetry/api-metrics": "^0.24.0", | ||
"@opentelemetry/core": "^0.24.1-alpha.14+4553b29d", | ||
"@opentelemetry/resources": "^0.24.1-alpha.14+4553b29d", | ||
"@opentelemetry/sdk-metrics-base": "^0.24.1-alpha.14+4553b29d", | ||
"@opentelemetry/sdk-trace-base": "^0.24.1-alpha.14+4553b29d" | ||
"@opentelemetry/core": "^0.24.0", | ||
"@opentelemetry/resources": "^0.24.0", | ||
"@opentelemetry/sdk-metrics-base": "^0.24.0", | ||
"@opentelemetry/sdk-trace-base": "^0.24.0" | ||
}, | ||
"gitHead": "4553b29d4a04b5b7e4bf87cad64dc2fc8c740d8e" | ||
"gitHead": "90ea0fed52f406005550862f9b645803f89e36a9" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
247874
4003
+ Added@opentelemetry/core@0.24.0(transitive)
+ Added@opentelemetry/resources@0.24.0(transitive)
- Removed@opentelemetry/core@0.24.1-alpha.31(transitive)
- Removed@opentelemetry/resources@0.24.1-alpha.31(transitive)
- Removed@opentelemetry/sdk-metrics-base@0.24.1-alpha.20(transitive)
- Removed@opentelemetry/sdk-trace-base@0.24.1-alpha.20(transitive)
- Removed@opentelemetry/semantic-conventions@0.24.1-alpha.31(transitive)
- Removedlodash.merge@4.6.2(transitive)
Updated@opentelemetry/core@^0.24.0