4.0.2 • Published 5 years ago
hemera-prometheus v4.0.2
Hemera-prometheus
Prometheus collector for Hemera
This client will expose a public metric endpoint on localhost:3000/metrics
. You can expose more Counter
, Gauge
as http endpoint with one command hemera.exposeMetric('metricName')
. For more informations about the prometheus client look in the driver documentation.
Usage
const hemera = new Hemera(nats)
hemera.use(require('hemera-prometheus'))
hemera.ready(() => {
const c = new hemera.prom.Counter({
name: 'test_counter',
help: 'Example of a counter',
labelNames: ['code']
})
hemera.exposeMetric('test_counter') // localhost:3000/metrics/test_counter
c.inc()
setInterval(() => c.inc(), 10000)
})
Plugin decorators
- .prom
- .express