fix(deps): use 1.x trace otlp http exporter (#2788)

Co-authored-by: Gerhard Stöbich <deb2001-github@yahoo.de>
This commit is contained in:
Daniel Dyla 2022-02-24 13:56:08 -05:00 committed by GitHub
parent b8df001379
commit def9ba3ea5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 7 deletions

View File

@ -69,7 +69,7 @@
"@grpc/grpc-js": "^1.3.7", "@grpc/grpc-js": "^1.3.7",
"@grpc/proto-loader": "^0.6.4", "@grpc/proto-loader": "^0.6.4",
"@opentelemetry/core": "1.0.1", "@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/resources": "1.0.1",
"@opentelemetry/sdk-trace-base": "1.0.1" "@opentelemetry/sdk-trace-base": "1.0.1"
} }

View File

@ -75,7 +75,6 @@ export abstract class OTLPExporterNodeBase<
} }
onInit(config: OTLPExporterConfigNode): void { onInit(config: OTLPExporterConfigNode): void {
this._isShutdown = false;
// defer to next tick and lazy load to avoid loading grpc too early // defer to next tick and lazy load to avoid loading grpc too early
// and making this impossible to be instrumented // and making this impossible to be instrumented
setImmediate(() => { setImmediate(() => {
@ -90,7 +89,7 @@ export abstract class OTLPExporterNodeBase<
onSuccess: () => void, onSuccess: () => void,
onError: (error: otlpTypes.OTLPExporterError) => void onError: (error: otlpTypes.OTLPExporterError) => void
): void { ): void {
if (this._isShutdown) { if (this._shutdownOnce.isCalled) {
diag.debug('Shutdown already started. Cannot send objects'); diag.debug('Shutdown already started. Cannot send objects');
return; return;
} }
@ -110,7 +109,6 @@ export abstract class OTLPExporterNodeBase<
} }
onShutdown(): void { onShutdown(): void {
this._isShutdown = true;
if (this.serviceClient) { if (this.serviceClient) {
this.serviceClient.close(); this.serviceClient.close();
} }

View File

@ -109,6 +109,9 @@ export abstract class OTLPExporterBase<
return this._shutdownOnce.call(); return this._shutdownOnce.call();
} }
/**
* Called by _shutdownOnce with BindOnceFuture
*/
private _shutdown(): Promise<void> { private _shutdown(): Promise<void> {
diag.debug('shutdown started'); diag.debug('shutdown started');
this.onShutdown(); this.onShutdown();

View File

@ -68,7 +68,7 @@
"dependencies": { "dependencies": {
"@grpc/proto-loader": "^0.6.4", "@grpc/proto-loader": "^0.6.4",
"@opentelemetry/core": "1.0.1", "@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/resources": "1.0.1",
"@opentelemetry/sdk-trace-base": "1.0.1", "@opentelemetry/sdk-trace-base": "1.0.1",
"protobufjs": "^6.9.0" "protobufjs": "^6.9.0"

View File

@ -61,7 +61,6 @@ export abstract class OTLPExporterNodeBase<
} }
override onInit(config: OTLPExporterNodeConfigBase): void { override onInit(config: OTLPExporterNodeConfigBase): void {
this._isShutdown = false;
// defer to next tick and lazy load to avoid loading protobufjs too early // defer to next tick and lazy load to avoid loading protobufjs too early
// and making this impossible to be instrumented // and making this impossible to be instrumented
setImmediate(() => { setImmediate(() => {
@ -76,7 +75,7 @@ export abstract class OTLPExporterNodeBase<
onSuccess: () => void, onSuccess: () => void,
onError: (error: otlpTypes.OTLPExporterError) => void onError: (error: otlpTypes.OTLPExporterError) => void
): void { ): void {
if (this._isShutdown) { if (this._shutdownOnce.isCalled) {
diag.debug('Shutdown already started. Cannot send objects'); diag.debug('Shutdown already started. Cannot send objects');
return; return;
} }