diff options
Diffstat (limited to 'apps/workers/metrics.ts')
| -rw-r--r-- | apps/workers/metrics.ts | 17 |
1 files changed, 17 insertions, 0 deletions
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); |
