Skip to content

Commit 6b03f93

Browse files
committed
Fixed a bug in the prometheus.js route
1 parent b13f5d7 commit 6b03f93

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

server/routes/prometheus.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ app.get('/metrics', async (req, res) => {
3333
const latest = await testController.getLatest();
3434
if (!latest) return res.status(500).end('No test found');
3535

36+
if (latest.error || latest.ping === -1)
37+
return res.status(500).end('Error in the latest test');
38+
3639
pingGauge.set(latest.ping);
3740
downloadGauge.set(latest.download);
3841
uploadGauge.set(latest.upload);

0 commit comments

Comments
 (0)