mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-19 23:33:13 +09:00
Make metrics gathering timeout configurable
When reducing the collection interval in Prometheus it may be necessary to to reduce the metrics gathering timeout to ensure it's less than the interval. Add config options to adjust the timeouts used for metrics gathering so that these can be set accordingly.
This commit is contained in:
1 parent
699e3994df
commit
6eef4bd300
9 files changed
+63
-9
No files matched your search
@@ -190,8 +190,9 @@ async function getMetrics(req, res, next) {
|
||||
}
|
||||
|
||||
let requests = [];
|
||||
let timeout = masterConfig.get("master.metrics_timeout") * 1000;
|
||||
for (let slaveConnection of slaveConnections.values()) {
|
||||
requests.push(libHelpers.timeout(libLink.messages.getMetrics.send(slaveConnection), 8e3, null));
|
||||
requests.push(libHelpers.timeout(libLink.messages.getMetrics.send(slaveConnection), timeout, null));
|
||||
}
|
||||
|
||||
for await (let result of await libPrometheus.defaultRegistry.collect()) {
|
||||
|
||||
Reference in new issue
Block a user