UNIwise / socket.io-prometheus-metrics

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

Exporter doesn't decrement when connections are lost #1

Closed PaulFarver closed 5 years ago

PaulFarver commented 5 years ago

When a connection is lost without being properly terminated from the client, the exporter doesn't reflect that in it's "socket_io_connected" metric.

Incrementing and decrementing the gauge on "connect" and "disconnect" events causes the exporter to erroneously report more current connections.

Perhaps it would be better to rely on counting the clients connected to socketio, every time metrics are requested?