Socket
Socket
Sign inDemoInstall

express-prom-bundle

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-prom-bundle - npm Package Compare versions

Comparing version 4.2.0 to 4.2.1

2

package.json
{
"name": "express-prom-bundle",
"version": "4.2.0",
"version": "4.2.1",
"description": "express middleware with popular prometheus metrics in one bundle",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -43,24 +43,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) [![NPM version](https://badge.fury.io/js/express-prom-bundle.png)](http://badge.fury.io/js/express-prom-bundle)

## Usage with Node Cluster
``` javascript
if (cluster.isMaster) {
const numCPUs = Math.max(2, os.cpus().length);
const workers: cluster.Worker[] = [];
for (let i=1; i < numCPUs; i++) {
const worker = forkWorker();
workers.push(worker);
}
const metricsApp = express();
metricsApp.use('/cluster_metrics', promBundle.clusterMetrics());
metricsApp.listen(9999);
console.log('metrics listening on 9999'); // call localhost:9999/cluster_metrics for aggregated metrics
} else {
const app = express();
app.use(promBundle({includeMethod: true});
app.use('/api', require('./api'));
app.listen(3000);
}
```
The code the master process runs will expose an API with a single endpoint `/cluster_metrics` which returns an aggregate of all metrics from all the workers.
## Options

@@ -67,0 +45,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc