use of com.sequenceiq.common.api.telemetry.request.MonitoringRequest 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;
}
use of com.sequenceiq.common.api.telemetry.request.MonitoringRequest in project cloudbreak by hortonworks.
the class TelemetryConverter method convert.
public TelemetryRequest convert(TelemetryResponse response, SdxClusterResponse sdxClusterResponse) {
LOGGER.debug("Creating telemetry request based on datalake and environment responses.");
TelemetryRequest telemetryRequest = new TelemetryRequest();
FeaturesRequest featuresRequest = new FeaturesRequest();
if (response != null) {
LoggingRequest loggingRequest = createLoggingRequestFromResponse(response);
telemetryRequest.setLogging(loggingRequest);
MonitoringRequest monitoringRequest = createMonitoringRequestFromResponse(response);
telemetryRequest.setMonitoring(monitoringRequest);
FeaturesResponse featuresResponse = response.getFeatures();
if (featuresResponse != null) {
LOGGER.debug("Setting cluster logs collection request (telemetry) based on environment response.");
featuresRequest.setClusterLogsCollection(featuresResponse.getClusterLogsCollection());
LOGGER.debug("Setting cluster monitoring request (telemetry) based on environment response.");
featuresRequest.setMonitoring(featuresResponse.getMonitoring());
LOGGER.debug("Setting cloud storage logging request (telemetry) based on environment response.");
if (featuresResponse.getCloudStorageLogging() != null) {
featuresRequest.setCloudStorageLogging(featuresResponse.getCloudStorageLogging());
} else {
featuresRequest.addCloudStorageLogging(true);
}
}
telemetryRequest.setFluentAttributes(response.getFluentAttributes());
}
telemetryRequest.setWorkloadAnalytics(createWorkloadAnalyticsRequest(response, sdxClusterResponse));
Optional<FeatureSetting> waFeature = createWorkloadAnalyticsFeature(telemetryRequest.getWorkloadAnalytics());
featuresRequest.setWorkloadAnalytics(waFeature.orElse(null));
telemetryRequest.setFeatures(featuresRequest);
return telemetryRequest;
}
use of com.sequenceiq.common.api.telemetry.request.MonitoringRequest in project cloudbreak by hortonworks.
the class TelemetryConverter method convertToRequest.
public TelemetryRequest convertToRequest(Telemetry telemetry) {
TelemetryRequest telemetryRequest = new TelemetryRequest();
if (telemetry != null) {
LoggingRequest loggingRequest = createLoggingRequestFromSource(telemetry);
MonitoringRequest monitoringRequest = createMonitoringRequestFromSource(telemetry);
WorkloadAnalyticsRequest waRequest = createWorkloadAnalyticsRequestFromSource(telemetry);
FeaturesRequest featuresRequest = createFeaturesRequestFromSource(telemetry);
telemetryRequest.setWorkloadAnalytics(waRequest);
telemetryRequest.setLogging(loggingRequest);
telemetryRequest.setMonitoring(monitoringRequest);
telemetryRequest.setFluentAttributes(telemetry.getFluentAttributes());
telemetryRequest.setFeatures(featuresRequest);
}
return telemetryRequest;
}
use of com.sequenceiq.common.api.telemetry.request.MonitoringRequest in project cloudbreak by hortonworks.
the class TelemetryApiConverter method createMonitoringRequestFromEnvSource.
private MonitoringRequest createMonitoringRequestFromEnvSource(EnvironmentMonitoring monitoring) {
MonitoringRequest monitoringRequest = null;
if (monitoring != null) {
monitoringRequest = new MonitoringRequest();
monitoringRequest.setRemoteWriteUrl(monitoring.getRemoteWriteUrl());
}
return monitoringRequest;
}
Aggregations