Skip to content

Commit

Permalink
feat: Metrics port health endpoint (#1502)
Browse files Browse the repository at this point in the history
  • Loading branch information
DamianFigiel authored Jan 14, 2025
1 parent 3af1c49 commit ff3b49f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/prom-metrics/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ const server = http.createServer(async (req, res) => {
await throttledUpdateMetrics()
res.setHeader('Content-Type', register.contentType)
res.end(await register.metrics())
} else if (req.url === '/health') {
res.setHeader('Content-Type', 'application/json')
res.end(JSON.stringify({ status: 'ok' }))
} else {
res.writeHead(404)
res.end()
Expand Down

0 comments on commit ff3b49f

Please sign in to comment.