fix(syncing-server): add opentelemetry sdk shutdown
This commit is contained in:
parent
69ce3eb2a8
commit
a0e523e64c
3 changed files with 13 additions and 0 deletions
|
@ -98,4 +98,8 @@ export class OpenTelemetrySDK implements OpenTelemetrySDKInterface {
|
|||
start(): void {
|
||||
this.sdk.start()
|
||||
}
|
||||
|
||||
async shutdown(): Promise<void> {
|
||||
await this.sdk.shutdown()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
export interface OpenTelemetrySDKInterface {
|
||||
start(): void
|
||||
shutdown(): Promise<void>
|
||||
}
|
||||
|
|
|
@ -146,6 +146,14 @@ void container.load().then((container) => {
|
|||
logger.info('gRPC server closed')
|
||||
}
|
||||
})
|
||||
sdk
|
||||
.shutdown()
|
||||
.then(() => {
|
||||
logger.info('OpenTelemetry SDK shut down')
|
||||
})
|
||||
.catch((error) => {
|
||||
logger.error(`Failed to shut down OpenTelemetry SDK: ${error.message}`)
|
||||
})
|
||||
})
|
||||
|
||||
logger.info(`Server started on port ${process.env.PORT}`)
|
||||
|
|
Loading…
Reference in a new issue