From def9ba3ea59d29b66085f0532ca62ecd85671cca Mon Sep 17 00:00:00 2001 From: Daniel Dyla Date: Thu, 24 Feb 2022 13:56:08 -0500 Subject: [PATCH] fix(deps): use 1.x trace otlp http exporter (#2788) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Gerhard Stöbich --- packages/exporter-trace-otlp-grpc/package.json | 2 +- packages/exporter-trace-otlp-grpc/src/OTLPExporterNodeBase.ts | 4 +--- packages/exporter-trace-otlp-http/src/OTLPExporterBase.ts | 3 +++ packages/exporter-trace-otlp-proto/package.json | 2 +- .../exporter-trace-otlp-proto/src/OTLPExporterNodeBase.ts | 3 +-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/exporter-trace-otlp-grpc/package.json b/packages/exporter-trace-otlp-grpc/package.json index dba48e1593..d089e1d441 100644 --- a/packages/exporter-trace-otlp-grpc/package.json +++ b/packages/exporter-trace-otlp-grpc/package.json @@ -69,7 +69,7 @@ "@grpc/grpc-js": "^1.3.7", "@grpc/proto-loader": "^0.6.4", "@opentelemetry/core": "1.0.1", - "@opentelemetry/exporter-trace-otlp-http": "0.27.0", + "@opentelemetry/exporter-trace-otlp-http": "1.0.1", "@opentelemetry/resources": "1.0.1", "@opentelemetry/sdk-trace-base": "1.0.1" } diff --git a/packages/exporter-trace-otlp-grpc/src/OTLPExporterNodeBase.ts b/packages/exporter-trace-otlp-grpc/src/OTLPExporterNodeBase.ts index a992a4f259..28da1ae341 100644 --- a/packages/exporter-trace-otlp-grpc/src/OTLPExporterNodeBase.ts +++ b/packages/exporter-trace-otlp-grpc/src/OTLPExporterNodeBase.ts @@ -75,7 +75,6 @@ export abstract class OTLPExporterNodeBase< } onInit(config: OTLPExporterConfigNode): void { - this._isShutdown = false; // defer to next tick and lazy load to avoid loading grpc too early // and making this impossible to be instrumented setImmediate(() => { @@ -90,7 +89,7 @@ export abstract class OTLPExporterNodeBase< onSuccess: () => void, onError: (error: otlpTypes.OTLPExporterError) => void ): void { - if (this._isShutdown) { + if (this._shutdownOnce.isCalled) { diag.debug('Shutdown already started. Cannot send objects'); return; } @@ -110,7 +109,6 @@ export abstract class OTLPExporterNodeBase< } onShutdown(): void { - this._isShutdown = true; if (this.serviceClient) { this.serviceClient.close(); } diff --git a/packages/exporter-trace-otlp-http/src/OTLPExporterBase.ts b/packages/exporter-trace-otlp-http/src/OTLPExporterBase.ts index 2dc095bcc5..1679aae11e 100644 --- a/packages/exporter-trace-otlp-http/src/OTLPExporterBase.ts +++ b/packages/exporter-trace-otlp-http/src/OTLPExporterBase.ts @@ -109,6 +109,9 @@ export abstract class OTLPExporterBase< return this._shutdownOnce.call(); } + /** + * Called by _shutdownOnce with BindOnceFuture + */ private _shutdown(): Promise { diag.debug('shutdown started'); this.onShutdown(); diff --git a/packages/exporter-trace-otlp-proto/package.json b/packages/exporter-trace-otlp-proto/package.json index 7e3a58e522..926ff494ad 100644 --- a/packages/exporter-trace-otlp-proto/package.json +++ b/packages/exporter-trace-otlp-proto/package.json @@ -68,7 +68,7 @@ "dependencies": { "@grpc/proto-loader": "^0.6.4", "@opentelemetry/core": "1.0.1", - "@opentelemetry/exporter-trace-otlp-http": "0.27.0", + "@opentelemetry/exporter-trace-otlp-http": "1.0.1", "@opentelemetry/resources": "1.0.1", "@opentelemetry/sdk-trace-base": "1.0.1", "protobufjs": "^6.9.0" diff --git a/packages/exporter-trace-otlp-proto/src/OTLPExporterNodeBase.ts b/packages/exporter-trace-otlp-proto/src/OTLPExporterNodeBase.ts index 19ddc423bf..eb9d6b766c 100644 --- a/packages/exporter-trace-otlp-proto/src/OTLPExporterNodeBase.ts +++ b/packages/exporter-trace-otlp-proto/src/OTLPExporterNodeBase.ts @@ -61,7 +61,6 @@ export abstract class OTLPExporterNodeBase< } override onInit(config: OTLPExporterNodeConfigBase): void { - this._isShutdown = false; // defer to next tick and lazy load to avoid loading protobufjs too early // and making this impossible to be instrumented setImmediate(() => { @@ -76,7 +75,7 @@ export abstract class OTLPExporterNodeBase< onSuccess: () => void, onError: (error: otlpTypes.OTLPExporterError) => void ): void { - if (this._isShutdown) { + if (this._shutdownOnce.isCalled) { diag.debug('Shutdown already started. Cannot send objects'); return; }