UNIwise / socket.io-prometheus-metrics

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

socket_io_connected is always 0 #6

Closed bklepar closed 4 years ago

bklepar commented 4 years ago

updates socket_io_connected when new socket connected or disconnected sample and simple fix for https://github.com/UNIwise/socket.io-prometheus-metrics/issues/5

naueramant commented 4 years ago

This is already done èvery time the metric is scraped? I can't see how this should fix it?

https://github.com/UNIwise/socket.io-prometheus-metrics/blob/cdc9bc7fd87620fbbefffe76420bafe313e0b136/index.ts#L85-L91

naueramant commented 4 years ago

Closed due to inactivity

bklepar commented 4 years ago

@naueramant thank you for review. indeed it works when own get used, but if we try to add those metrics to already existing prom client - it bypasses the get handler and metric is always zero. so fix allows this metric to work no matter how it is consumed.

naueramant commented 4 years ago

@naueramant thank you for review. indeed it works when own get used, but if we try to add those metrics to already existing prom client - it bypasses the get handler and metric is always zero. so fix allows this metric to work no matter how it is consumed.

A valid point! I will merge and maybe rework the code asap.