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; }