@synanetics/prometheus-reporter
v1.0.0
Published
Adapted Prometheus reporter for MoleculerJS
Downloads
149
Maintainers
Keywords
Readme
@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.