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/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"
}

View File

@ -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();
}

View File

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

View File

@ -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"

View File

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