Skip to content

Commit

Permalink
fix(deps): use 1.x trace otlp http exporter (#2788)
Browse files Browse the repository at this point in the history
Co-authored-by: Gerhard Stöbich <[email protected]>
  • Loading branch information
dyladan and Flarna authored Feb 24, 2022
1 parent b8df001 commit def9ba3
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/exporter-trace-otlp-grpc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand All @@ -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;
}
Expand All @@ -110,7 +109,6 @@ export abstract class OTLPExporterNodeBase<
}

onShutdown(): void {
this._isShutdown = true;
if (this.serviceClient) {
this.serviceClient.close();
}
Expand Down
3 changes: 3 additions & 0 deletions packages/exporter-trace-otlp-http/src/OTLPExporterBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion packages/exporter-trace-otlp-proto/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand All @@ -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;
}
Expand Down

0 comments on commit def9ba3

Please sign in to comment.