From 52d018c872d0db30c4d54d89fefa8543ee9ff93e Mon Sep 17 00:00:00 2001 From: MohamedBassem Date: Fri, 22 Aug 2025 20:09:52 +0300 Subject: feat: Export prometheus metrics from the workers --- apps/workers/metrics.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 apps/workers/metrics.ts (limited to 'apps/workers/metrics.ts') diff --git a/apps/workers/metrics.ts b/apps/workers/metrics.ts new file mode 100644 index 00000000..04eec1fb --- /dev/null +++ b/apps/workers/metrics.ts @@ -0,0 +1,17 @@ +import { prometheus } from "@hono/prometheus"; +import { Counter, Registry } from "prom-client"; + +const registry = new Registry(); + +export const { printMetrics } = prometheus({ + registry: registry, + prefix: "karakeep_", +}); + +export const workerStatsCounter = new Counter({ + name: "karakeep_worker_stats", + help: "Stats for each worker", + labelNames: ["worker_name", "status"], +}); + +registry.registerMetric(workerStatsCounter); -- cgit v1.2.3-70-g09d2