class ClusterMonitoringEngine {

    public void installAndStartMonitoring(Stack stack, Telemetry telemetry) throws CloudbreakException {
        if (telemetry != null && telemetry.isMonitoringFeatureEnabled()) {
            try {
                LOGGER.info("Install and start monitoring for CM server.");
                Set<InstanceMetaData> instanceMetaDataSet = stack.getNotDeletedInstanceMetaDataSet();
                List<GatewayConfig> gatewayConfigs = gatewayConfigService.getAllGatewayConfigs(stack);
                Set<Node> allNodes = instanceMetaDataSet.stream()
                        .map(im -> new Node(im.getPrivateIp(), im.getPublicIp(), im.getInstanceId(),
                                im.getInstanceGroup().getTemplate().getInstanceType(), im.getDiscoveryFQDN(), im.getInstanceGroup().getGroupName()))
                        .collect(Collectors.toSet());
                telemetryOrchestrator.installAndStartMonitoring(gatewayConfigs, allNodes, clusterDeletionBasedModel(stack.getId(), stack.getCluster().getId()));
            } catch (CloudbreakOrchestratorFailedException ex) {
                throw new CloudbreakException(ex);
            }
        }
    }

    public  ClusterMonitoringEngine(TelemetryOrchestrator telemetryOrchestrator, GatewayConfigService gatewayConfigService);

}