UNIwise / socket.io-prometheus-metrics

Socket.IO prometheus metrics exporter written in typescript
Apache License 2.0
36 stars 17 forks source link

Feature: prefix option / multiple sockets #12

Open DataTables opened 3 years ago

DataTables commented 3 years ago

In my app I have multiple sockets (one to the browser, one to an internal service and so on). This is a problem when using this client as prom-client gives the error: Error: A metric with the name socket_io_connected has already been registered.. That seems fair enough since I'm calling prometheus.metrics every time I create a new server, but it is using a single registry.

Being able to add a prefix (either replacing, or appending to the default socket_io_ would resolve this.

Thanks!

naueramant commented 3 years ago

That would be a nice little feature to have, i will take that into consideration.