From bc311e35f7a548da36c7fe28963978ab3ac268ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carl-Gerhard=20Lindesva=CC=88rd?= Date: Sat, 22 Feb 2025 12:14:59 +0100 Subject: [PATCH] chore(worker): add prom-client `collectDefaultMetrics` --- apps/worker/src/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/worker/src/index.ts b/apps/worker/src/index.ts index 48c78b85..e5d441f9 100644 --- a/apps/worker/src/index.ts +++ b/apps/worker/src/index.ts @@ -10,6 +10,7 @@ import { notificationQueue, sessionsQueue, } from '@openpanel/queue'; +import client from 'prom-client'; import sourceMapSupport from 'source-map-support'; import { bootCron } from './boot-cron'; @@ -20,6 +21,9 @@ import { logger } from './utils/logger'; sourceMapSupport.install(); async function start() { + const collectDefaultMetrics = client.collectDefaultMetrics; + collectDefaultMetrics({ register }); + const PORT = Number.parseInt(process.env.WORKER_PORT || '3000', 10); const app = express();