prepare for npm publish

This commit is contained in:
Konstantin Pogorelov
2016-04-18 17:47:21 +02:00
parent 3ae9394154
commit 300f694926
4 changed files with 51 additions and 21 deletions

View File

@@ -1,4 +1,4 @@
docker-compose.yml
test
spec
.travis.yml
.eslintrc

View File

@@ -1,9 +1,49 @@
[![build status](https://api.travis-ci.org/disjunction/express-prom-bundle.png)](https://travis-ci.org/disjunction/express-prom-bundle)
# express prometheus bundle
A bundle of standard metrics for an express application.
express middleware with popular prometheus metrics in one bundle.
Internally it uses **prom-client**. See: https://github.com/siimon/prom-client
Included metrics:
* **up**: normally is just 1
* **nodejs_memory_heap_total_bytes** and **nodejs_memory_heap_used_bytes**
* **http_request_total**: count of http requests labeled with status_code
* `up`: normally is just 1
* `nodejs_memory_heap_total_bytes` and `nodejs_memory_heap_used_bytes`
* `http_request_total`: count of http requests labeled with status_code
## Install
```
npm install express-prom-bundle
```
## Usage
```javascript
const
promBundle = require("express-prom-bundle"),
middleware = promBundle({/* options */ });
```
## Options
* **prefix**: prefix added to every metric name
## Example
```javascript
"use strict";
const express = require("express"),
app = express(),
promBundle = require(".");
app.use(promBundle({
prefix: "demo_app:something"
}));
app.get("/hello", (req, res) => res.send("ok"));
app.listen(3000);
```

View File

@@ -1,13 +0,0 @@
"use strict";
const express = require("express"),
app = express(),
promBundle = require(".");
app.use(promBundle({
prefix: "demo_app:something"
}));
app.get("/hello", (req, res) => res.send("ok"));
app.listen(3000);

View File

@@ -3,9 +3,12 @@
"version": "1.0.0",
"description": "express middleware with popular prometheus metrics in one bundle",
"main": "src/index.js",
"directories": {
"test": "test"
},
"keywords": [
"prometheus",
"metrics",
"express",
"bundle"
],
"scripts": {
"test": "node_modules/jasme/run.js"
},