From 06a78bb6af43d7fe5717b1bb1948d5dbd9268af4 Mon Sep 17 00:00:00 2001 From: zeroqn Date: Wed, 28 Dec 2022 15:53:28 +0800 Subject: [PATCH] fix: no trace info in winston log (#593) --- packages/api-server/src/app/cluster.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/api-server/src/app/cluster.ts b/packages/api-server/src/app/cluster.ts index f343d644..1edbdd2a 100644 --- a/packages/api-server/src/app/cluster.ts +++ b/packages/api-server/src/app/cluster.ts @@ -1,3 +1,7 @@ +import { startOpentelemetry } from "../opentelemetry"; +// Start before logger +startOpentelemetry(); + import cluster from "cluster"; import { cpus } from "os"; import { envConfig } from "../base/env-config"; @@ -5,14 +9,11 @@ import { logger } from "../base/logger"; import { BlockEmitter } from "../block-emitter"; import { CKBPriceOracle } from "../price-oracle"; import { initSentry } from "../sentry"; -import { startOpentelemetry } from "../opentelemetry"; const numCPUs = cpus().length; const clusterCount = +(envConfig.clusterCount || 0); const numOfCluster = clusterCount || numCPUs; -startOpentelemetry(); - if (cluster.isMaster) { logger.info(`Master ${process.pid} is running`);