socketcluster icon indicating copy to clipboard operation
socketcluster copied to clipboard

Metrics exporter for prometheus

Open botzill opened this issue 6 years ago • 5 comments

Hi.

I was wondering if you plan to add some kind of metrics for the SC? At the moment not sure what kind of metrics you can export, but I think may be useful to know the current state of the cluster.

Thx.

botzill avatar Jun 15 '19 14:06 botzill

Yes please!

Nuxij avatar Mar 31 '21 05:03 Nuxij

I don't think that's the purpose of the framework. You could implement this yourself using middleware. I put a quick example below:

agServer.setMiddleware(agServer.MIDDLEWARE_INBOUND, async (middlewareStream) => {
  for await (let action of middlewareStream) {
    console.log(action.data)
    // All the metrics logic
    action.allow()
  }
});

More on middleware here

maarteNNNN avatar Mar 31 '21 11:03 maarteNNNN

I'm a bit surprised there's no prometheus exporter for this project, especially since it provides a k8s installation out of the box.

guanzo avatar Apr 07 '21 04:04 guanzo

I highly recommend using Rancher (https://rancher.com/) with Kubernetes. The Rancher control panel comes with Kubernetes and Grafana (https://grafana.com/) which provides detailed real-time metrics about the state of the cluster (CPU usage, memory, hard drive etc...). It's all free and open source.

The Rancher control panel allows any SC service to be scaled up or down at the click of a button.

jondubois avatar Apr 07 '21 12:04 jondubois

That said, it someone wants to add support for some other cluster monitoring software, then feel free to raise an issue with a description of the proposed solution.

jondubois avatar Apr 07 '21 12:04 jondubois