From 229b9908d21dc33c52dfdee420b0a6c14dc4477f Mon Sep 17 00:00:00 2001 From: Nicolas Date: Tue, 21 May 2024 18:52:46 -0700 Subject: [PATCH] Nick: only enable hyper dx in prod --- apps/api/src/index.ts | 4 +++- apps/api/src/services/queue-worker.ts | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/api/src/index.ts b/apps/api/src/index.ts index 2579d4e..326728e 100644 --- a/apps/api/src/index.ts +++ b/apps/api/src/index.ts @@ -50,7 +50,9 @@ const HOST = process.env.HOST ?? "localhost"; redisClient.connect(); // HyperDX OpenTelemetry -initSDK({ consoleCapture: true, additionalInstrumentations: []}); +if(process.env.ENV === 'production') { + initSDK({ consoleCapture: true, additionalInstrumentations: []}); +} export function startServer(port = DEFAULT_PORT) { diff --git a/apps/api/src/services/queue-worker.ts b/apps/api/src/services/queue-worker.ts index 065f6d7..6772c57 100644 --- a/apps/api/src/services/queue-worker.ts +++ b/apps/api/src/services/queue-worker.ts @@ -7,7 +7,9 @@ import { callWebhook } from "./webhook"; import { logJob } from "./logging/log_job"; import { initSDK } from '@hyperdx/node-opentelemetry'; -initSDK({ consoleCapture: true, additionalInstrumentations: []}); +if(process.env.ENV === 'production') { + initSDK({ consoleCapture: true, additionalInstrumentations: []}); +} getWebScraperQueue().process( Math.floor(Number(process.env.NUM_WORKERS_PER_QUEUE ?? 8)),