UNIwise / socket.io-prometheus-metrics

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

Socket Connected metrics is incorrect #7

Closed ShubhangiSGaikwad closed 4 years ago

ShubhangiSGaikwad commented 4 years ago

Hello Team,

The nodejs application we are testing is recently deployed using PM2 with application load balancing over machine cores . Where in the application processes are increased from 1 to 8.(m/c with 8 core). In this case the Socket Connected metrics is incorrect in the Prometheus .It shows only one of the core instead of all the cores.

Please suggest the changes required to get all socket connected across all cores.

Thanks.

naueramant commented 4 years ago

Sounds like you might not aggregate the connections over all instances of the application.

This might be because you only scrape one of the instances; either because you directly target the instance ip or you scrape through the load balancer and only hit one instance. You have to scrape all instances and aggregate the result.

ShubhangiSGaikwad commented 4 years ago

Thanks Jonas for your quick response.

We are a newbie to PM2 and sockets , also there is no much logs available from PM2 . We found PID 0 to 7 getting created for 8 cores, and application listening at port 8088.(sockets)

Request to help me in this regards(Multi-process mode/cluster mode) what changes will help me aggregate the result, so we can monitor all socket connections across the 8 cores on a Single Machine.

Logs of PM2 : Listening on : 8088 Listening on : 8088 Listening on : 8088 Listening on : 8088 Listening on : 8088 Listening on : 8088 Listening on : 8088 Listening on : 8088

PM2 pids: Server-0.pid to Server-7.pid

In Prometheus.yml

naueramant commented 4 years ago

Sorry can't help. I have never used PM2 and this is out of scope for this issue since it is not related to the package.

If I was you I would read the Prometheus and PM2 documentation and make sure you understand what you are trying to do.

Good luck!