express-prom-bundle
Advanced tools
Comparing version 1.1.4 to 1.1.5
{ | ||
"name": "express-prom-bundle", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"description": "express middleware with popular prometheus metrics in one bundle", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -23,5 +23,2 @@ [![build status](https://travis-ci.org/jochen-schweizer/express-prom-bundle.png)](https://travis-ci.org/jochen-schweizer/express-prom-bundle) [![Coverage Status](https://coveralls.io/repos/github/jochen-schweizer/express-prom-bundle/badge.svg?branch=master)](https://coveralls.io/github/jochen-schweizer/express-prom-bundle?branch=master) [![license](https://img.shields.io/github/license/mashape/apistatus.svg?maxAge=2592000)](https://www.tldrlegal.com/l/mit) | ||
You **MUST** call `app.use(metricsMiddleware)` before the `use`-ing your middleware, | ||
otherwise those won't count in `http_request_seconds` histogram | ||
```javascript | ||
@@ -39,2 +36,10 @@ const promBundle = require("express-prom-bundle"), | ||
**ALERT!** | ||
The order in wich the routes are registered is important, since | ||
**only the routes registered after the express-prom-bundle will be measured** | ||
You can use this to your advantage to bypass some of the routes. | ||
See the example below. | ||
## Options | ||
@@ -57,2 +62,7 @@ | ||
// calls to this route will not appear in metrics | ||
// because it's applied before promBundle | ||
app.get("/status", (req, res) => res.send("i am healthy")); | ||
app.use(promBundle({ | ||
@@ -62,2 +72,3 @@ prefix: "demo_app:something" | ||
// calls to this route will appear in metrics | ||
app.get("/hello", (req, res) => res.send("ok")); | ||
@@ -64,0 +75,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
9945
79