breizhhardware

breizhhardware/express-prom-bundle

express middleware with standard prometheus metrics in one bundle

JavaScript
0
0
MIT License

/:type) const route = req.route; if (route && route.path) { return route.path; } // default return promBundle.normalizePath(req, opts); }; ``` ## Usage with Koa ### Koa v1 ```javascript const promBundle = require("@breizhhardware/express-prom-bundle"); const koa = require("koa"); const app = koa(); const metricsMiddleware = promBundle({includeMethod: true}); app.use(metricsMiddleware); app.use(/* your middleware */); app.listen(3000); ``` ### Koa v2 ```javascript const promBundle = require("@breizhhardware/express-prom-bundle"); const koa = require("koa"); const app = new koa(); const metricsMiddleware = promBundle({includeMethod: true}); app.use(metricsMiddleware); app.use(/* your middleware */); app.listen(3000); ``` ## Multiple instances If you need to add the same metrics multiple times (e.g. for different apps or services), you have to use different registries: ```javascript const promBundle = require("@breizhhardware/express-prom-bundle"); const Registry = require("prom-client").Registry; const reg1 = new Registry(); const reg2 = new Registry

Total donated
Undistributed
Share with your subscribers:

Recipients

How the donated funds are distributed

Support the dependencies of breizhhardware/express-prom-bundle

Account's avatar
TypeScript definitions for express
Account's avatar
extracts and replaces values and IDs in URLs
Account's avatar
ESLint JavaScript language implementation
Account's avatar
concrete data type implementations
Account's avatar
simplistic node.js jasmine 3.x launcher
Account's avatar
Client for prometheus
Account's avatar
SuperAgent driven library for testing HTTP servers
Account's avatar
Converts a Koa app into a supertest compatible agent instance.
Account's avatar
TypeScript is a language for application scale JavaScript development
Account's avatar
the Istanbul command line interface

Top contributors

disjunction's profile
disjunction
170 contributions
BreizhHardware's profile
BreizhHardware
72 contributions
dependabot[bot]'s profile
dependabot[bot]
45 contributions
pvradarkp's profile
pvradarkp
12 contributions
raszi's profile
raszi
7 contributions
paulopaquielli's profile
paulopaquielli
7 contributions
ath88's profile
ath88
6 contributions
Cellaryllis's profile
Cellaryllis
2 contributions
caraboides's profile
caraboides
2 contributions
cliedeman's profile
cliedeman
2 contributions

Recent events

Kivach works on the Obyte network, and therefore you can track all donations.

No events yet