aboutsummaryrefslogtreecommitdiffstats
path: root/packages/api/routes/metrics.ts
blob: 90eff5b975eb17eb9885a5e572f5c816266ba1ab (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// 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,
});

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

export default app;