diff --git a/changelog.d/296.bugfix b/changelog.d/296.bugfix new file mode 100644 index 00000000..6f3b9a65 --- /dev/null +++ b/changelog.d/296.bugfix @@ -0,0 +1 @@ +Fix a bug where /metrics would report empty values. \ No newline at end of file diff --git a/src/components/prometheusmetrics.ts b/src/components/prometheusmetrics.ts index eb28bad9..04f28744 100644 --- a/src/components/prometheusmetrics.ts +++ b/src/components/prometheusmetrics.ts @@ -380,11 +380,11 @@ export class PrometheusMetrics { // TODO: Ideally these metrics would be on a different port. // For now, leave this unauthenticated. checkToken: false, - handler: (_req: Request, res: Response) => { + handler: async (_req: Request, res: Response) => { this.refresh(); try { - const exposition = this.register.metrics(); + const exposition = await this.register.metrics(); res.set("Content-Type", "text/plain"); res.send(exposition);