Skip to content

Commit

Permalink
ADD: Prometheus/Grafana auto restart (#2146)
Browse files Browse the repository at this point in the history
restarts prometheus/grafana on edit node page changes if installed
  • Loading branch information
PatrickRL authored Dec 17, 2024
1 parent 154e90c commit 4c29986
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions launcher/src/backend/ServiceManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -1815,6 +1815,25 @@ export class ServiceManager {
await this.nodeConnection.nodeUpdates.restartServices(after - before);
}
}
let services = await this.readServiceConfigurations();
let prometheusServiceID;
let grafanaServiceID;
services.forEach((service) => {
if (service.service == "PrometheusService") {
prometheusServiceID = service.id;
}
if (service.service == "GrafanaService") {
grafanaServiceID = service.id;
}
});
if (prometheusServiceID != null) {
await this.manageServiceState(prometheusServiceID, "stopped");
await this.manageServiceState(prometheusServiceID, "started");
}
if (grafanaServiceID != null) {
await this.manageServiceState(grafanaServiceID, "stopped");
await this.manageServiceState(grafanaServiceID, "started");
}
}

async exportSingleSetup(setupId) {
Expand Down

0 comments on commit 4c29986

Please sign in to comment.