class ClouderaManagerMgmtTelemetryService {

    @VisibleForTesting
    void enrichWithSdxData(String sdxContextName, String sdxCrn, Stack stack, WorkloadAnalytics workloadAnalytics,
            Map<String, String> telemetrySafetyValveMap) {
        sdxContextName = StringUtils.isNotEmpty(sdxContextName)
                ? sdxContextName : String.format("%s-%s", stack.getCluster().getName(), stack.getCluster().getId().toString());
        String sdxId = sdxCrn != null && Crn.fromString(sdxCrn) != null
                ? Crn.fromString(sdxCrn).getResource() : UUID.nameUUIDFromBytes(sdxContextName.getBytes()).toString();
        telemetrySafetyValveMap.put(DATABUS_HEADER_SDX_ID, sdxId);
        telemetrySafetyValveMap.put(DATABUS_HEADER_SDX_NAME, sdxContextName);
        if (workloadAnalytics.getAttributes() != null) {
            for (Map.Entry<String, Object> entry : workloadAnalytics.getAttributes().entrySet()) {
                telemetrySafetyValveMap.put(entry.getKey(), ObjectUtils.defaultIfNull(entry.getValue().toString(), ""));
            }
        }
    }

}