mirror of
https://github.com/BreizhHardware/express-prom-bundle.git
synced 2026-03-18 21:30:38 +01:00
prepare for npm publish
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
docker-compose.yml
|
||||
test
|
||||
spec
|
||||
.travis.yml
|
||||
.eslintrc
|
||||
48
README.md
48
README.md
@@ -1,9 +1,49 @@
|
||||
[](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);
|
||||
```
|
||||
13
example.js
13
example.js
@@ -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);
|
||||
@@ -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"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user