Skip to content

Commit

Permalink
Legg til API route for prometheus metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
androa committed Nov 28, 2024
1 parent 113c744 commit 29e0564
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .nais/nais.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions app/routes/api.internal.metrics.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { register } from "prom-client";

export async function loader() {
return new Response(await register.metrics(), {
headers: {
"Content-Type": register.contentType,
},
});
}

0 comments on commit 29e0564

Please sign in to comment.