hemera-prometheus

4.0.2 • Public • Published

Hemera-prometheus

Prometheus collector for Hemera

npm styled with prettier

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

Readme

Keywords

none

Package Sidebar

Install

npm i hemera-prometheus

Weekly Downloads

1

Version

4.0.2

License

MIT

Unpacked Size

4.03 kB

Total Files

5

Last publish

Collaborators

  • starptech