promking
Prometheus HTTP instrumentation for Express/Hapi. Attempts to mimic the official Prometheus Go client in terms of metrics.
Installation
npm install --save promking
Usage (express)
const promking = const expressApp = // Note: This should be done BEFORE other routes// Pass 'app' as middleware parameter to additionally expose Prometheus under 'app.locals'expressApp // Optional: Add custom Prometheus metricsconst counter = name: 'metric_name' help: 'metric_help' counter // Set up a metrics summary delivering server on given portconst summaryServer = promking
Usage (hapi)
const promking = const hapiApp = hapiApp const counter = name: 'metric_name' help: 'metric_help' counter // Set up a metrics summary delivering server on given portconst summaryServer = promking
License
MIT-licensed. See LICENSE.