blob: aeb03c0335b94d3c0492622a6df0691b0ee14110 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
// Import stats to register Prometheus metrics
import "@karakeep/trpc/stats";
import { prometheus } from "@hono/prometheus";
import { Hono } from "hono";
import { bearerAuth } from "hono/bearer-auth";
import { register } from "prom-client";
import serverConfig from "@karakeep/shared/config";
export const { printMetrics, registerMetrics } = prometheus({
registry: register,
prefix: "karakeep_",
});
const app = new Hono().get(
"/",
bearerAuth({ token: serverConfig.prometheus.metricsToken }),
printMetrics,
);
export default app;
|