Skip to content

OpenPanel is an open-source web and product analytics platform, an open-source alternative to Mixpanel with optional self-hosting.

chore(worker): add prom-client `collectDefaultMetrics`

Carl-Gerhard Lindesvärdbc311e35f7a5
diff --git a/apps/worker/src/index.ts b/apps/worker/src/index.ts
index 48c78b856..e5d441f99 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();