public void convertLabels()

in ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/model/prometheus/AlarmRuleData.java [204:239]


    public void convertLabels() {

        if (StringUtils.isBlank(labels)) {
            return;
        }

        JsonObject json = new Gson().fromJson(labels, JsonObject.class);

        this.setIncludeMethods(json.has("includeMethods") ? json.get("includeMethods").getAsString() : null);
        this.setExceptMethods(json.has("exceptMethods") ? json.get("exceptMethods").getAsString() : null);

        this.setIncludeErrorCodes(json.has("includeErrorCodes") ? json.get("includeErrorCodes").getAsString() : null);
        this.setExceptErrorCodes(json.has("exceptErrorCodes") ? json.get("exceptErrorCodes").getAsString() : null);

        this.setIncludeDubboServices(json.has("includeDubboServices") ? json.get("includeDubboServices").getAsString() : null);
        this.setExceptDubboServices(json.has("exceptDubboServices") ? json.get("exceptDubboServices").getAsString() : null);

        this.setTeslaGroup(json.has("teslaGroup") ? json.get("teslaGroup").getAsString() : null);

        this.setAlarmDetailUrl(json.has("alarmDetailUrl") ? json.get("alarmDetailUrl").getAsString() : null);

        this.setTeslaUrls(json.has("teslaUrls") ? json.get("teslaUrls").getAsString() : null);

        this.setBasicNum(json.has("basicNum") ? json.get("basicNum").getAsInt() : null);

        this.setExcludeTeslaUrls(json.has("excludeTeslaUrls") ? json.get("excludeTeslaUrls").getAsString() : null);

        this.setAlarmCallbackUrl(json.has("alarmCallbackUrl") ? json.get("alarmCallbackUrl").getAsString() : null);

        this.setTeslaPreviewEnv(json.has("teslaPreviewEnv") ? json.get("teslaPreviewEnv").getAsString() : null);

        this.setIncludeHttpDomains(json.has("includeHttpDomains") ? json.get("includeHttpDomains").getAsString() : null);

        this.setExceptHttpDomains(json.has("exceptHttpDomains") ? json.get("exceptHttpDomains").getAsString() : null);

    }