From 30c9b5641ee660fa7a3f46cebbb8b6f460b4d4b9 Mon Sep 17 00:00:00 2001 From: Markus Klose <markus.klose@student.reutlingen-university.de> Date: Tue, 29 Nov 2022 17:56:29 +0100 Subject: [PATCH] Comments --- index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index cf38599..f20c432 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); -- GitLab