use of com.netflix.spinnaker.halyard.config.model.v1.metricStores.stackdriver.StackdriverStore in project halyard by spinnaker.
the class SpinnakerMonitoringDaemonProfileFactory method setProfile.
@Override
protected void setProfile(Profile profile, DeploymentConfiguration deploymentConfiguration, SpinnakerRuntimeSettings endpoints) {
SpinnakerRuntimeSettings.Services services = endpoints.getServices();
ServiceSettings monitoringService = services.getMonitoringDaemon();
MetricStores metricStores = deploymentConfiguration.getMetricStores();
List<String> enabledMetricStores = new ArrayList<>();
List<String> files = new ArrayList<>();
DatadogStore datadogStore = metricStores.getDatadog();
if (datadogStore.isEnabled()) {
enabledMetricStores.add("datadog");
}
PrometheusStore prometheusStore = metricStores.getPrometheus();
if (prometheusStore.isEnabled()) {
enabledMetricStores.add("prometheus");
}
StackdriverStore stackdriverStore = metricStores.getStackdriver();
if (stackdriverStore.isEnabled()) {
enabledMetricStores.add("stackdriver");
files.addAll(backupRequiredFiles(stackdriverStore, deploymentConfiguration.getName()));
}
profile.appendContents(yamlToString(metricStores));
Server server = new Server().setHost(monitoringService.getHost()).setPort(monitoringService.getPort());
ServerConfig serverConfig = new ServerConfig();
serverConfig.setServer(server);
profile.appendContents(yamlToString(serverConfig));
Monitor monitor = new Monitor().setPeriod(metricStores.getPeriod()).setMetricStore(enabledMetricStores);
MonitorConfig monitorConfig = new MonitorConfig();
monitorConfig.setMonitor(monitor);
profile.appendContents(yamlToString(monitorConfig));
profile.appendContents(profile.getBaseContents());
profile.setRequiredFiles(files);
}
Aggregations