Search in sources :

Example 1 with StackdriverStore

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);
}
Also used : MetricStores(com.netflix.spinnaker.halyard.config.model.v1.node.MetricStores) ServiceSettings(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.ServiceSettings) ArrayList(java.util.ArrayList) StackdriverStore(com.netflix.spinnaker.halyard.config.model.v1.metricStores.stackdriver.StackdriverStore) SpinnakerRuntimeSettings(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.SpinnakerRuntimeSettings) DatadogStore(com.netflix.spinnaker.halyard.config.model.v1.metricStores.datadog.DatadogStore) PrometheusStore(com.netflix.spinnaker.halyard.config.model.v1.metricStores.prometheus.PrometheusStore)

Aggregations

DatadogStore (com.netflix.spinnaker.halyard.config.model.v1.metricStores.datadog.DatadogStore)1 PrometheusStore (com.netflix.spinnaker.halyard.config.model.v1.metricStores.prometheus.PrometheusStore)1 StackdriverStore (com.netflix.spinnaker.halyard.config.model.v1.metricStores.stackdriver.StackdriverStore)1 MetricStores (com.netflix.spinnaker.halyard.config.model.v1.node.MetricStores)1 SpinnakerRuntimeSettings (com.netflix.spinnaker.halyard.deploy.spinnaker.v1.SpinnakerRuntimeSettings)1 ServiceSettings (com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.ServiceSettings)1 ArrayList (java.util.ArrayList)1