mirror of
https://github.com/BreizhHardware/express-prom-bundle.git
synced 2026-01-18 16:27:28 +01:00
1.0 KiB
1.0 KiB
express prometheus bundle
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 1nodejs_memory_heap_total_bytesandnodejs_memory_heap_used_byteshttp_request_total: count of http requests labeled with status_code
Install
npm install express-prom-bundle
Usage
const
promBundle = require("express-prom-bundle"),
middleware = promBundle({/* options */ });
Options
- prefix: prefix added to every metric name
Example
"use strict";
const express = require("express"),
app = express(),
promBundle = require("express-prom-bundle");
app.use(promBundle({
prefix: "demo_app:something"
}));
app.get("/hello", (req, res) => res.send("ok"));
app.listen(3000);
