http-metrics-middleware
Advanced tools
Comparing version 1.1.0 to 1.1.1
24
index.js
@@ -147,4 +147,4 @@ const accepts = require('accepts'); | ||
if ( | ||
this.options.excludeRoutes && | ||
this.matchVsRegExps(req.originalUrl, this.options.excludeRoutes) | ||
this.options.excludeRoutes | ||
&& this.matchVsRegExps(req.originalUrl, this.options.excludeRoutes) | ||
) { | ||
@@ -164,6 +164,6 @@ return next(); | ||
if ( | ||
this.options.includePath && | ||
resp.req && | ||
resp.req.route && | ||
resp.req.route.path | ||
this.options.includePath | ||
&& resp.req | ||
&& resp.req.route | ||
&& resp.req.route.path | ||
) { | ||
@@ -176,4 +176,3 @@ labels.path = this.options.normalizePath(req, this.options); | ||
const duration = | ||
(parseFloat(end.toFixed(9)) - parseFloat(start.toFixed(9))) / 1000; | ||
const duration = (parseFloat(end.toFixed(9)) - parseFloat(start.toFixed(9))) / 1000; | ||
this.observeDurations(labels, duration); | ||
@@ -205,4 +204,4 @@ }); | ||
if ( | ||
Object.prototype.hasOwnProperty.call(params, param) && | ||
!this.options.paramIgnores.includes(param) | ||
Object.prototype.hasOwnProperty.call(params, param) | ||
&& !this.options.paramIgnores.includes(param) | ||
) { | ||
@@ -239,5 +238,4 @@ pathValue = this.replaceParam(params, param, pathValue); | ||
return regexps.some(regexp => | ||
(regexp instanceof RegExp && element.match(regexp)) || | ||
element === regexp); | ||
return regexps.some(regexp => (regexp instanceof RegExp && element.match(regexp)) | ||
|| element === regexp); | ||
} | ||
@@ -244,0 +242,0 @@ } |
{ | ||
"name": "http-metrics-middleware", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Express middleware for adding common prometheus metrics", | ||
@@ -30,17 +30,17 @@ "author": "QlikTech International AB", | ||
"accepts": "1.3.5", | ||
"express": "4.16.2", | ||
"lodash": "4.17.5", | ||
"express": "4.16.4", | ||
"lodash": "4.17.11", | ||
"on-finished": "2.3.0", | ||
"performance-now": "2.1.0", | ||
"prom-client": "11.0.0", | ||
"url-value-parser": "1.0.0" | ||
"prom-client": "11.1.3", | ||
"url-value-parser": "2.0.0" | ||
}, | ||
"devDependencies": { | ||
"after-work.js": "4.2.0", | ||
"codeclimate-test-reporter": "0.5.0", | ||
"eslint": "4.19.1", | ||
"eslint-config-airbnb-base": "12.1.0", | ||
"eslint-plugin-import": "2.10.0", | ||
"eslint-plugin-mocha": "5.0.0" | ||
"after-work.js": "4.3.2", | ||
"codeclimate-test-reporter": "0.5.1", | ||
"eslint": "5.9.0", | ||
"eslint-config-airbnb-base": "13.1.0", | ||
"eslint-plugin-import": "2.14.0", | ||
"eslint-plugin-mocha": "5.2.0" | ||
} | ||
} |
@@ -8,4 +8,2 @@ [![Build Status][circleci-image]][circleci-url] | ||
[](https://greenkeeper.io/) | ||
Express middleware with useful prometheus metrics. | ||
@@ -12,0 +10,0 @@ |
9
237
18300
150
+ Addedbody-parser@1.18.3(transitive)
+ Addedexpress@4.16.4(transitive)
+ Addedfinalhandler@1.1.1(transitive)
+ Addediconv-lite@0.4.23(transitive)
+ Addedlodash@4.17.11(transitive)
+ Addedprom-client@11.1.3(transitive)
+ Addedqs@6.5.2(transitive)
+ Addedraw-body@2.3.3(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsend@0.16.2(transitive)
+ Addedserve-static@1.13.2(transitive)
+ Addedstatuses@1.4.0(transitive)
+ Addedurl-value-parser@2.0.0(transitive)
- Removedbody-parser@1.18.2(transitive)
- Removeddepd@1.1.1(transitive)
- Removedexpress@4.16.2(transitive)
- Removedfinalhandler@1.1.0(transitive)
- Removedhttp-errors@1.6.2(transitive)
- Removediconv-lite@0.4.19(transitive)
- Removedlodash@4.17.5(transitive)
- Removedprom-client@11.0.0(transitive)
- Removedqs@6.5.1(transitive)
- Removedraw-body@2.3.2(transitive)
- Removedsafe-buffer@5.1.1(transitive)
- Removedsend@0.16.1(transitive)
- Removedserve-static@1.13.1(transitive)
- Removedsetprototypeof@1.0.3(transitive)
- Removedstatuses@1.3.11.5.0(transitive)
- Removedurl-value-parser@1.0.0(transitive)
Updatedexpress@4.16.4
Updatedlodash@4.17.11
Updatedprom-client@11.1.3
Updatedurl-value-parser@2.0.0