Skip to content

Commit 4eaf4f5

Browse files
committed
core: allow read metrics as json for dashboard
1 parent bc1159e commit 4eaf4f5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/server/handler/misc.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ class MetricsHandler extends AuthHandler {
5858
notUsage = true;
5959

6060
async get() {
61+
if (this.request.json) {
62+
this.response.body = await registry.getMetricsAsJSON();
63+
return;
64+
}
6165
this.response.body = await registry.metrics();
6266
this.response.type = 'text/plain';
6367
}

0 commit comments

Comments
 (0)