@synanetics/prometheus-reporter
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

@synanetics/prometheus-reporter

The current implementation of Moleculer's Prometheus metrics reporter currently only calls close on the internal http server when the stop method is called. This means that any connections with keep-alive set are not severed, preventing Moleculer from shutting down. This package extends the stop functionality to also call the closeAllConnections method on the http server, which will sever all connections and allow Moleculer to shut down fully.

Usage

In your moleculer.config.js file:

const { PrometheusReporter } = require('@synanetics/prometheus-reporter');
// or
import { PrometheusReporter } from '@synanetics/prometheus-reporter'

const config = {
  // ... other molculer config
  metrics: {
    enabled: enabled,
    reporter: [new PrometheusReporter({
      // HTTP port
      port: 3035,
      // ... other reporting options
    })],
  },
}

The updated prometheus reporter extends the built-in Prometheus reporter and accepts the same options.

Readme

Keywords

none

Package Sidebar

Install

npm i @synanetics/prometheus-reporter

Weekly Downloads

13

Version

1.0.0

License

MIT

Unpacked Size

5.3 kB

Total Files

16

Last publish

Collaborators

  • lewis-synanetics
  • oliverm-wethey
  • synrichardbrown
  • gregsynanetics
  • tom-synanetics
  • danielpeterbayley
  • leecampbellsynanetics
  • davidtolman
  • synsteve