express-prom-bundle
Advanced tools
Comparing version 6.3.2 to 6.3.3
{ | ||
"name": "express-prom-bundle", | ||
"version": "6.3.2", | ||
"version": "6.3.3", | ||
"description": "express middleware with popular prometheus metrics in one bundle", | ||
@@ -19,3 +19,3 @@ "main": "src/index.js", | ||
"scripts": { | ||
"test": "node_modules/jasme/run.js", | ||
"test": "NODE_ENV=test node_modules/jasme/run.js", | ||
"lint": "eslint src", | ||
@@ -22,0 +22,0 @@ "coverage": "make coverage", |
@@ -143,3 +143,6 @@ const onFinished = require('on-finished'); | ||
const metricsMiddleware = function(req, res, next) { | ||
res.writeHead(200, {'Content-Type': 'text/plain'}); | ||
const sendSuccesss = (output) => { | ||
res.writeHead(200, {'Content-Type': 'text/plain'}); | ||
res.end(output); | ||
}; | ||
@@ -150,7 +153,7 @@ const metricsResponse = opts.promRegistry.metrics(); | ||
metricsResponse | ||
.then(output => res.end(output)) | ||
.then(output => sendSuccesss(output)) | ||
.catch(err => next(err)); | ||
} else { | ||
// compatibility fallback for previous versions of prom-client@<=12 | ||
res.end(metricsResponse); | ||
sendSuccesss(metricsResponse); | ||
} | ||
@@ -166,3 +169,3 @@ }; | ||
if (opts.autoregister && path.match(metricsMatch)) { | ||
return metricsMiddleware(req, res); | ||
return metricsMiddleware(req, res, next); | ||
} | ||
@@ -169,0 +172,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22278
269