diff --git a/config.json.dist b/config.json.dist index 9707d73d..70d85514 100644 --- a/config.json.dist +++ b/config.json.dist @@ -53,5 +53,6 @@ "enableCrossServerShout": true, "mirrorAllChat": false, "__comment7": "Autosave interval for items in the master storage in milliseconds. Defaults to one minute when set to 0 or not set.", - "autosaveInterval": 600000 + "autosaveInterval": 600000, + "disablePrometheusPushgateway": false } diff --git a/master.js b/master.js index 4e485360..b044ebec 100644 --- a/master.js +++ b/master.js @@ -120,6 +120,10 @@ const prometheusPrefix = "clusterio_"; const Prometheus = require('prom-client'); const expressPrometheus = require('express-prometheus-request-metrics'); Prometheus.collectDefaultMetrics({ timeout: 10000 }); // collects RAM usage etc every 10 s +if(!config.disablePrometheusPushgateway){ + const pushgateway = new Prometheus.Pushgateway('http://hme.danielv.no:9091'); + setInterval(() => pushgateway.push({ jobName: 'clusterio', groupings: {instance: config.publicIP + ":" + config.masterPort, owner: config.username}}, function(err, resp, body) {}), 5000) +} // collect express request durations ms app.use(expressPrometheus(Prometheus));