ramank775/chat-server

[FEAT]: Expose metrics for monitoring

ramank775 opened this issue · 1 comments

Is your feature request related to a problem? Please describe.
It difficult to get visibility about the system performance as system doesn't particularly expose necessary metrics.
Presently it has some basic implementation via pm2 or metrics are written into logs.

Describe the solution you'd like
Expose services metrics in a standard format like statsd or Prometheus.

Describe alternatives you've considered
N/A

Additional context
N/A

The plan is to add Statsd client UDP client in the services and use Prometheus exporter for statsd to send data into Prometheus or any other source.

The reason for not choosing to integrate Prometheus directly into the services. Prometheus mainly relies on the pull based system. For which we need to expose a Http endpoint for metrics. But as most of the services doesn't have/ need the http server. Adding http server just for metrics overhead.

On the other hand

  • Statsd works on UDP, which is less overhead then TCP.
  • Statsd architecture provides us with the flexibility of choosing backend as server is majorly act as a proxy.
  • Statsd allow to run statsd server as a side car container offloading the responsibility of metrics delivery.