Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/julien-r44/socket.io-prometheus
📡 Exposes metrics endpoint for Prometheus to collect data about Socket.io.
https://github.com/julien-r44/socket.io-prometheus
grafana metrics monitoring prometheus socket-io
Last synced: 3 months ago
JSON representation
📡 Exposes metrics endpoint for Prometheus to collect data about Socket.io.
- Host: GitHub
- URL: https://github.com/julien-r44/socket.io-prometheus
- Owner: Julien-R44
- License: mit
- Created: 2021-01-19T19:30:11.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-04-23T07:42:11.000Z (almost 3 years ago)
- Last Synced: 2024-10-22T07:42:42.987Z (3 months ago)
- Topics: grafana, metrics, monitoring, prometheus, socket-io
- Language: TypeScript
- Homepage:
- Size: 344 KB
- Stars: 5
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# 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](docs/dashboard.png)