Skip to content

Commit

Permalink
Fix /metrics to return JSON instead of plain text
Browse files Browse the repository at this point in the history
  • Loading branch information
0237h committed Aug 20, 2024
1 parent cddab66 commit fbfe2bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ async function AntelopeTokenAPI() {

app.get(
"/metrics",
async (_) => new Response(await prometheus.registry.metrics(), { headers: { "Content-Type": prometheus.registry.contentType } })
async (ctx: Context) => ctx.json<EndpointReturnTypes<"/metrics">, 200>(await prometheus.registry.getMetricsAsJSON())
);

// --------------------------
Expand Down

0 comments on commit fbfe2bc

Please sign in to comment.