use of com.sequenceiq.common.api.telemetry.response.MonitoringResponse in project cloudbreak by hortonworks.
the class TelemetryConverter method createMonitoringResponseFromSource.
private MonitoringResponse createMonitoringResponseFromSource(Monitoring monitoring) {
MonitoringResponse monitoringResponse = null;
if (monitoring != null) {
monitoringResponse = new MonitoringResponse();
monitoringResponse.setRemoteWriteUrl(monitoring.getRemoteWriteUrl());
}
return monitoringResponse;
}
use of com.sequenceiq.common.api.telemetry.response.MonitoringResponse in project cloudbreak by hortonworks.
the class TelemetryApiConverter method createMonitoringResponseFromSource.
private MonitoringResponse createMonitoringResponseFromSource(EnvironmentMonitoring monitoring) {
MonitoringResponse monitoringResponse = null;
if (monitoring != null) {
monitoringResponse = new MonitoringResponse();
monitoringResponse.setRemoteWriteUrl(monitoring.getRemoteWriteUrl());
}
return monitoringResponse;
}
use of com.sequenceiq.common.api.telemetry.response.MonitoringResponse in project cloudbreak by hortonworks.
the class StackRequestManifester method prepareTelemetryForStack.
private void prepareTelemetryForStack(StackV4Request stackV4Request, DetailedEnvironmentResponse environment, SdxCluster sdxCluster) {
TelemetryResponse envTelemetry = environment.getTelemetry();
if (envTelemetry != null && envTelemetry.getLogging() != null) {
TelemetryRequest telemetryRequest = new TelemetryRequest();
LoggingRequest loggingRequest = new LoggingRequest();
LoggingResponse envLogging = envTelemetry.getLogging();
loggingRequest.setS3(envLogging.getS3());
loggingRequest.setAdlsGen2(envLogging.getAdlsGen2());
loggingRequest.setGcs(envLogging.getGcs());
loggingRequest.setCloudwatch(envLogging.getCloudwatch());
loggingRequest.setStorageLocation(envLogging.getStorageLocation());
telemetryRequest.setLogging(loggingRequest);
MonitoringRequest monitoringRequest = new MonitoringRequest();
MonitoringResponse envMonitoring = envTelemetry.getMonitoring();
if (envMonitoring != null) {
monitoringRequest.setRemoteWriteUrl(envMonitoring.getRemoteWriteUrl());
}
telemetryRequest.setMonitoring(monitoringRequest);
if (envTelemetry.getFeatures() != null) {
FeaturesRequest featuresRequest = new FeaturesRequest();
featuresRequest.setClusterLogsCollection(envTelemetry.getFeatures().getClusterLogsCollection());
featuresRequest.setMonitoring(envTelemetry.getFeatures().getMonitoring());
if (envTelemetry.getFeatures().getCloudStorageLogging() != null) {
featuresRequest.setCloudStorageLogging(envTelemetry.getFeatures().getCloudStorageLogging());
} else {
featuresRequest.addCloudStorageLogging(true);
}
telemetryRequest.setFeatures(featuresRequest);
}
if (envTelemetry.getFluentAttributes() != null) {
Map<String, Object> fluentAttributes = envTelemetry.getFluentAttributes();
if (!fluentAttributes.containsKey(TelemetryClusterDetails.CLUSTER_CRN_KEY)) {
fluentAttributes.put(TelemetryClusterDetails.CLUSTER_CRN_KEY, sdxCluster.getCrn());
}
addAzureIdbrokerMsiToTelemetry(fluentAttributes, stackV4Request);
telemetryRequest.setFluentAttributes(fluentAttributes);
}
stackV4Request.setTelemetry(telemetryRequest);
}
}
use of com.sequenceiq.common.api.telemetry.response.MonitoringResponse in project cloudbreak by hortonworks.
the class TelemetryConverterTest method testConvertFromEnvAndSdxResponseWithMonitoring.
@Test
public void testConvertFromEnvAndSdxResponseWithMonitoring() {
// GIVEN
TelemetryResponse response = new TelemetryResponse();
FeaturesResponse featuresResponse = new FeaturesResponse();
featuresResponse.addMonitoring(true);
response.setFeatures(featuresResponse);
MonitoringResponse monitoringResponse = new MonitoringResponse();
monitoringResponse.setRemoteWriteUrl(MONITORING_REMOTE_WRITE_URL);
response.setMonitoring(monitoringResponse);
// WHEN
TelemetryRequest result = underTest.convert(response, null);
// THEN
assertTrue(result.getFeatures().getMonitoring().isEnabled());
assertEquals(MONITORING_REMOTE_WRITE_URL, result.getMonitoring().getRemoteWriteUrl());
}
use of com.sequenceiq.common.api.telemetry.response.MonitoringResponse in project cloudbreak by hortonworks.
the class TelemetryConverter method createMonitoringRequestFromResponse.
private MonitoringRequest createMonitoringRequestFromResponse(TelemetryResponse response) {
MonitoringRequest monitoringRequest = null;
if (response.getMonitoring() != null) {
LOGGER.debug("Setting monitoring response (telemetry) based on environment response");
MonitoringResponse monitoringResponse = response.getMonitoring();
monitoringRequest = new MonitoringRequest();
monitoringRequest.setRemoteWriteUrl(monitoringResponse.getRemoteWriteUrl());
}
return monitoringRequest;
}
Aggregations