We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2fe378b commit 7edbbcdCopy full SHA for 7edbbcd
src/index.ts
@@ -183,8 +183,15 @@ async function main (): Promise<void> {
183
184
const metricsServer = createServer((req, res) => {
185
if (req.url === argMetricsPath && req.method === 'GET') {
186
- res.writeHead(200, { 'Content-Type': 'text/plain' })
187
- void register.metrics().then((metrics) => res.end(metrics))
+ register.metrics()
+ .then((metrics) => {
188
+ res.writeHead(200, { 'Content-Type': 'text/plain' })
189
+ res.end(metrics)
190
+ }, (err) => {
191
+ console.error('could not read metrics', err)
192
+ res.writeHead(500, { 'Content-Type': 'text/plain' })
193
+ res.end('Internal Server Error')
194
+ })
195
} else {
196
res.writeHead(404, { 'Content-Type': 'text/plain' })
197
res.end('Not Found')
0 commit comments