mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-19 23:33:13 +09:00
Added pushgateway for prometheus statistics
This commit is contained in:
1 parent
2855268e34
commit
3f4309fab0
2 files changed
+6
-1
No files matched your search
@@ -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));
|
||||
|
||||
Reference in new issue
Block a user