1.0.3 • Published 3 years ago

socket.io-prometheus-v3 v1.0.3

Weekly downloads
8
License
ISC
Repository
github
Last release
3 years ago

socket.io-prometheus-v3

Exposes metrics endpoints for prometheus to collect data about socket.io v3.

Installation

$ npm i socket.io-prometheus-v3

Usage

const { PrometheusSocketIo } = require('socket.io-prometheus-v3')
const prometheus = PrometheusSocketIo.init({ 
    io, // io.Server
    collectDefaultMetrics: false // Collect some Node.js-specific metrics.
})

...

// Serve your metrics with express or whatever http server
app.get('/metrics', async (req, res) => {
    res.send(await prometheus.getMetrics())
}) 

Grafana

You can find a ready-to-use Grafana dashboard in "dashboards".

For it to be fully complete, you need to activate the collectDefaultMetrics property that retrieves the metrics from your Node.js application.

dashboard grafana

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago