Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix empty metrics due to prom-client@13 #296

Merged
merged 1 commit into from
Jan 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/296.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a bug where /metrics would report empty values.
4 changes: 2 additions & 2 deletions src/components/prometheusmetrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down