diff --git a/.nais/nais.yaml b/.nais/nais.yaml index 9586e339..82aefa93 100644 --- a/.nais/nais.yaml +++ b/.nais/nais.yaml @@ -22,6 +22,9 @@ spec: path: "{{base_path}}/api/internal/isReady" initialDelay: 5 timeout: 1 + prometheus: + enabled: true + path: "{{base_path}}/api/internal/metrics" replicas: min: 1 max: 2 diff --git a/app/routes/api.internal.metrics.ts b/app/routes/api.internal.metrics.ts new file mode 100644 index 00000000..53d8ff82 --- /dev/null +++ b/app/routes/api.internal.metrics.ts @@ -0,0 +1,9 @@ +import { register } from "prom-client"; + +export async function loader() { + return new Response(await register.metrics(), { + headers: { + "Content-Type": register.contentType, + }, + }); +}