diff --git a/packages/opentelemetry-exporter-collector-grpc/src/CollectorExporterNodeBase.ts b/packages/opentelemetry-exporter-collector-grpc/src/CollectorExporterNodeBase.ts index d27bf879f59..ad146d85d67 100644 --- a/packages/opentelemetry-exporter-collector-grpc/src/CollectorExporterNodeBase.ts +++ b/packages/opentelemetry-exporter-collector-grpc/src/CollectorExporterNodeBase.ts @@ -64,10 +64,11 @@ export abstract class CollectorExporterNodeBase< const promise = new Promise((resolve, reject) => { this._send(this, objects, resolve, reject); }) - .then(onSuccess, onError); + .then(onSuccess, onError) + .catch(diag.debug); this._sendingPromises.push(promise); - promise.finally(() => { + promise.then(() => { const index = this._sendingPromises.indexOf(promise); this._sendingPromises.splice(index, 1); }); diff --git a/packages/opentelemetry-exporter-collector-proto/src/CollectorExporterNodeBase.ts b/packages/opentelemetry-exporter-collector-proto/src/CollectorExporterNodeBase.ts index fcd2c7c94c7..ceb3b680b47 100644 --- a/packages/opentelemetry-exporter-collector-proto/src/CollectorExporterNodeBase.ts +++ b/packages/opentelemetry-exporter-collector-proto/src/CollectorExporterNodeBase.ts @@ -50,10 +50,11 @@ export abstract class CollectorExporterNodeBase< const promise = new Promise((resolve, reject) => { this._send(this, objects, this.compression, resolve, reject); }) - .then(onSuccess, onError); + .then(onSuccess, onError) + .catch(diag.debug); this._sendingPromises.push(promise); - promise.finally(() => { + promise.then(() => { const index = this._sendingPromises.indexOf(promise); this._sendingPromises.splice(index, 1); }); diff --git a/packages/opentelemetry-exporter-collector/src/platform/browser/CollectorExporterBrowserBase.ts b/packages/opentelemetry-exporter-collector/src/platform/browser/CollectorExporterBrowserBase.ts index 2448fe322e3..cd0b76efd6b 100644 --- a/packages/opentelemetry-exporter-collector/src/platform/browser/CollectorExporterBrowserBase.ts +++ b/packages/opentelemetry-exporter-collector/src/platform/browser/CollectorExporterBrowserBase.ts @@ -83,10 +83,11 @@ export abstract class CollectorExporterBrowserBase< sendWithBeacon(body, this.url, resolve, reject); } }) - .then(onSuccess, onError); + .then(onSuccess, onError) + .catch(diag.debug); this._sendingPromises.push(promise); - promise.finally(() => { + promise.then(() => { const index = this._sendingPromises.indexOf(promise); this._sendingPromises.splice(index, 1); }); diff --git a/packages/opentelemetry-exporter-collector/src/platform/node/CollectorExporterNodeBase.ts b/packages/opentelemetry-exporter-collector/src/platform/node/CollectorExporterNodeBase.ts index 4b98681e94a..039fbcf4e44 100644 --- a/packages/opentelemetry-exporter-collector/src/platform/node/CollectorExporterNodeBase.ts +++ b/packages/opentelemetry-exporter-collector/src/platform/node/CollectorExporterNodeBase.ts @@ -79,10 +79,11 @@ export abstract class CollectorExporterNodeBase< reject ); }) - .then(onSuccess, onError); + .then(onSuccess, onError) + .catch(diag.debug); this._sendingPromises.push(promise); - promise.finally(() => { + promise.then(() => { const index = this._sendingPromises.indexOf(promise); this._sendingPromises.splice(index, 1); }); diff --git a/packages/opentelemetry-exporter-zipkin/src/zipkin.ts b/packages/opentelemetry-exporter-zipkin/src/zipkin.ts index f57ea08061c..306fc4c172b 100644 --- a/packages/opentelemetry-exporter-zipkin/src/zipkin.ts +++ b/packages/opentelemetry-exporter-zipkin/src/zipkin.ts @@ -85,10 +85,12 @@ export class ZipkinExporter implements SpanExporter { resolve(); resultCallback(result); }); - }); + }) + .catch(diag.debug); + this._sendingPromises.push(promise); - promise.finally(() => { + promise.then(() => { const index = this._sendingPromises.indexOf(promise); this._sendingPromises.splice(index, 1); });