express-prom-bundle
Advanced tools
Comparing version 1.2.1 to 1.2.2
{ | ||
"name": "express-prom-bundle", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "express middleware with popular prometheus metrics in one bundle", | ||
@@ -23,6 +23,6 @@ "main": "src/index.js", | ||
"devDependencies": { | ||
"coveralls": "^2.11.12", | ||
"eslint": "^3.11.0", | ||
"express": "^4.13.4", | ||
"istanbul": "^0.4.4", | ||
"coveralls": "^2.11.15", | ||
"eslint": "^3.11.1", | ||
"express": "^4.14.0", | ||
"istanbul": "^0.4.5", | ||
"jasme": "^5.2.0", | ||
@@ -29,0 +29,0 @@ "koa": "^1.2.4", |
@@ -54,6 +54,12 @@ "use strict"; | ||
// remove default metrics provided by prom-client | ||
// this is a really messy hack but needed for compatibility with v1 | ||
// will be completely removed in v2 | ||
if (!opts.keepDefaultMetrics) { | ||
const metrics = promClient.register.getMetricsAsJSON(); | ||
clearInterval(promClient.defaultMetrics()); | ||
promClient.register.clear(); | ||
metrics.forEach(metric => { | ||
if (!opts.prefix || metric.name.substr(0, opts.prefix.length) != opts.prefix) { | ||
promClient.register.removeSingleMetric(metric.name); | ||
} | ||
}); | ||
} | ||
@@ -60,0 +66,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
14356
197