aboutsummaryrefslogtreecommitdiffstats
path: root/packages/api/routes/metrics.ts
blob: 9d668afe9ad271c44ac596422e8f78af50457194 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Import stats to register Prometheus metrics
import "@karakeep/trpc/stats";

import { prometheus } from "@hono/prometheus";
import { Hono } from "hono";
import { register } from "prom-client";

import { prometheusAuthMiddleware } from "../middlewares/prometheusAuth";

export const { printMetrics, registerMetrics } = prometheus({
  registry: register,
  prefix: "karakeep_",
});

const app = new Hono().get("/", prometheusAuthMiddleware, printMetrics);

export default app;