diff --git a/index.js b/index.js index cf38599ccadfc5e0edf78b7a671022a863d009de..f20c432a33b532a57c2d0dc41ea4c35ae639254e 100644 --- a/index.js +++ b/index.js @@ -53,6 +53,10 @@ client.collectDefaultMetrics({register}); help: 'The total number of client connections' }); */ + +// Declaring custom metrics to monitor the chatserver +// These metrics will monitor the system during runtime +// Prometheus will scrape these metrics and provide them to Gafana const messageCounterIn = new client.Counter({ name: 'node_message_counter_in', help: 'Counts the amount of incoming messages from clients to server' @@ -116,7 +120,7 @@ const totalClientsInDB = new client.Gauge({ }); global.TOTALCLIENTSINDB = totalClientsInDB; - +// Register the metrics, to be collected in Prometheus database register.registerMetric(messageCounterIn); register.registerMetric(messageCounterOut); register.registerMetric(messageAll);