Skip to content

Commit 4c29986

Browse files
authored
ADD: Prometheus/Grafana auto restart (#2146)
restarts prometheus/grafana on edit node page changes if installed
1 parent 154e90c commit 4c29986

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

launcher/src/backend/ServiceManager.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1815,6 +1815,25 @@ export class ServiceManager {
18151815
await this.nodeConnection.nodeUpdates.restartServices(after - before);
18161816
}
18171817
}
1818+
let services = await this.readServiceConfigurations();
1819+
let prometheusServiceID;
1820+
let grafanaServiceID;
1821+
services.forEach((service) => {
1822+
if (service.service == "PrometheusService") {
1823+
prometheusServiceID = service.id;
1824+
}
1825+
if (service.service == "GrafanaService") {
1826+
grafanaServiceID = service.id;
1827+
}
1828+
});
1829+
if (prometheusServiceID != null) {
1830+
await this.manageServiceState(prometheusServiceID, "stopped");
1831+
await this.manageServiceState(prometheusServiceID, "started");
1832+
}
1833+
if (grafanaServiceID != null) {
1834+
await this.manageServiceState(grafanaServiceID, "stopped");
1835+
await this.manageServiceState(grafanaServiceID, "started");
1836+
}
18181837
}
18191838

18201839
async exportSingleSetup(setupId) {

0 commit comments

Comments
 (0)