Search in sources :

Example 6 with MonitoringRequest

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;
}
Also used : MonitoringRequest(com.sequenceiq.common.api.telemetry.request.MonitoringRequest) MonitoringResponse(com.sequenceiq.common.api.telemetry.response.MonitoringResponse)

Example 7 with 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;
}
Also used : TelemetryRequest(com.sequenceiq.common.api.telemetry.request.TelemetryRequest) FeaturesResponse(com.sequenceiq.common.api.telemetry.response.FeaturesResponse) FeatureSetting(com.sequenceiq.common.api.type.FeatureSetting) LoggingRequest(com.sequenceiq.common.api.telemetry.request.LoggingRequest) MonitoringRequest(com.sequenceiq.common.api.telemetry.request.MonitoringRequest) FeaturesRequest(com.sequenceiq.common.api.telemetry.request.FeaturesRequest)

Example 8 with MonitoringRequest

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;
}
Also used : TelemetryRequest(com.sequenceiq.common.api.telemetry.request.TelemetryRequest) WorkloadAnalyticsRequest(com.sequenceiq.common.api.telemetry.request.WorkloadAnalyticsRequest) LoggingRequest(com.sequenceiq.common.api.telemetry.request.LoggingRequest) MonitoringRequest(com.sequenceiq.common.api.telemetry.request.MonitoringRequest) FeaturesRequest(com.sequenceiq.common.api.telemetry.request.FeaturesRequest)

Example 9 with MonitoringRequest

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;
}
Also used : MonitoringRequest(com.sequenceiq.common.api.telemetry.request.MonitoringRequest)

Aggregations

MonitoringRequest (com.sequenceiq.common.api.telemetry.request.MonitoringRequest)9 FeaturesRequest (com.sequenceiq.common.api.telemetry.request.FeaturesRequest)4 LoggingRequest (com.sequenceiq.common.api.telemetry.request.LoggingRequest)4 TelemetryRequest (com.sequenceiq.common.api.telemetry.request.TelemetryRequest)4 Monitoring (com.sequenceiq.common.api.telemetry.model.Monitoring)2 MonitoringResponse (com.sequenceiq.common.api.telemetry.response.MonitoringResponse)2 S3CloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters)1 Telemetry (com.sequenceiq.common.api.telemetry.model.Telemetry)1 WorkloadAnalyticsRequest (com.sequenceiq.common.api.telemetry.request.WorkloadAnalyticsRequest)1 FeaturesResponse (com.sequenceiq.common.api.telemetry.response.FeaturesResponse)1 LoggingResponse (com.sequenceiq.common.api.telemetry.response.LoggingResponse)1 TelemetryResponse (com.sequenceiq.common.api.telemetry.response.TelemetryResponse)1 FeatureSetting (com.sequenceiq.common.api.type.FeatureSetting)1 Test (org.junit.jupiter.api.Test)1