Skip to content

Commit

Permalink
Merge pull request #319 from karpelcevs/master
Browse files Browse the repository at this point in the history
Fix metrics endpoint
  • Loading branch information
andris9 authored Nov 18, 2022
2 parents 77dbd0f + e2c0cf6 commit bda6891
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/api-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -684,10 +684,11 @@ class APIServer {
);
});

this.server.get('/metrics', (req, res, next) => {
promClient.register
this.server.get('/metrics', async (req, res, next) => {
res.setHeader('Content-Type', promClient.register.contentType);
await promClient.register
.metrics()
.then(metrics => res.end(metrics))
.then(metrics => res.send(metrics))
.catch(err => {
log.error('API', err);
try {
Expand Down

0 comments on commit bda6891

Please sign in to comment.