diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/define/graph/AlarmGraphIdDefine.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/define/graph/AlarmGraphIdDefine.java index 9fd66e30c..91cafc79a 100644 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/define/graph/AlarmGraphIdDefine.java +++ b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/define/graph/AlarmGraphIdDefine.java @@ -27,4 +27,5 @@ public class AlarmGraphIdDefine { public static final int APPLICATION_METRIC_ALARM_GRAPH_ID = 502; public static final int SERVICE_REFERENCE_METRIC_ALARM_GRAPH_ID = 503; public static final int INSTANCE_REFERENCE_METRIC_ALARM_GRAPH_ID = 504; + public static final int APPLICATION_REFERENCE_METRIC_ALARM_GRAPH_ID = 505; } diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/define/graph/AlarmWorkerIdDefine.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/define/graph/AlarmWorkerIdDefine.java index ae65c0a10..20852150c 100644 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/define/graph/AlarmWorkerIdDefine.java +++ b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/define/graph/AlarmWorkerIdDefine.java @@ -56,4 +56,11 @@ public class AlarmWorkerIdDefine { public static final int INSTANCE_REFERENCE_METRIC_ALARM_PERSISTENCE_WORKER_ID = 543; public static final int INSTANCE_REFERENCE_METRIC_ALARM_LIST_PERSISTENCE_WORKER_ID = 544; public static final int INSTANCE_REFERENCE_METRIC_ALARM_TO_LIST_NODE_PROCESSOR_ID = 545; + + public static final int APPLICATION_REFERENCE_METRIC_ALARM_ASSERT_WORKER_ID = 550; + public static final int APPLICATION_REFERENCE_METRIC_TRANSFORM_GRAPH_BRIDGE_WORKER_ID = 551; + public static final int APPLICATION_REFERENCE_METRIC_ALARM_REMOTE_WORKER_ID = 552; + public static final int APPLICATION_REFERENCE_METRIC_ALARM_PERSISTENCE_WORKER_ID = 553; + public static final int APPLICATION_REFERENCE_METRIC_ALARM_LIST_PERSISTENCE_WORKER_ID = 554; + public static final int APPLICATION_REFERENCE_METRIC_ALARM_TO_LIST_NODE_PROCESSOR_ID = 555; } diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/AnalysisAlarmModuleProvider.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/AnalysisAlarmModuleProvider.java index edc2e159a..83cc30a6c 100644 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/AnalysisAlarmModuleProvider.java +++ b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/AnalysisAlarmModuleProvider.java @@ -21,6 +21,7 @@ package org.apache.skywalking.apm.collector.analysis.alarm.provider; import java.util.Properties; import org.apache.skywalking.apm.collector.analysis.alarm.define.AnalysisAlarmModule; import org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.application.ApplicationMetricAlarmGraph; +import org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.application.ApplicationReferenceMetricAlarmGraph; import org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.instance.InstanceMetricAlarmGraph; import org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.instance.InstanceReferenceMetricAlarmGraph; import org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.service.ServiceMetricAlarmGraph; @@ -68,6 +69,9 @@ public class AnalysisAlarmModuleProvider extends ModuleProvider { InstanceReferenceMetricAlarmGraph instanceReferenceMetricAlarmGraph = new InstanceReferenceMetricAlarmGraph(getManager(), workerCreateListener); instanceReferenceMetricAlarmGraph.create(); + + ApplicationReferenceMetricAlarmGraph applicationReferenceMetricAlarmGraph = new ApplicationReferenceMetricAlarmGraph(getManager(), workerCreateListener); + applicationReferenceMetricAlarmGraph.create(); } @Override public void notifyAfterCompleted() throws ServiceNotProvidedException { diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmAssertWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmAssertWorker.java new file mode 100644 index 000000000..cea3a4b3c --- /dev/null +++ b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmAssertWorker.java @@ -0,0 +1,85 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.application; + +import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine; +import org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.AlarmAssertWorker; +import org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.AlarmAssertWorkerProvider; +import org.apache.skywalking.apm.collector.configuration.ConfigurationModule; +import org.apache.skywalking.apm.collector.configuration.service.IApplicationReferenceAlarmRuleConfig; +import org.apache.skywalking.apm.collector.core.module.ModuleManager; +import org.apache.skywalking.apm.collector.core.util.Const; +import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarm; +import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetric; + +/** + * @author peng-yongsheng + */ +public class ApplicationReferenceMetricAlarmAssertWorker extends AlarmAssertWorker { + + private final IApplicationReferenceAlarmRuleConfig applicationReferenceAlarmRuleConfig; + + public ApplicationReferenceMetricAlarmAssertWorker(ModuleManager moduleManager) { + super(moduleManager); + this.applicationReferenceAlarmRuleConfig = moduleManager.find(ConfigurationModule.NAME).getService(IApplicationReferenceAlarmRuleConfig.class); + } + + @Override public int id() { + return AlarmWorkerIdDefine.APPLICATION_REFERENCE_METRIC_ALARM_ASSERT_WORKER_ID; + } + + @Override protected ApplicationReferenceAlarm newAlarmObject(String id, ApplicationReferenceMetric inputMetric) { + ApplicationReferenceAlarm applicationReferenceAlarm = new ApplicationReferenceAlarm(id + Const.ID_SPLIT + inputMetric.getFrontApplicationId() + Const.ID_SPLIT + inputMetric.getBehindApplicationId()); + applicationReferenceAlarm.setFrontApplicationId(inputMetric.getFrontApplicationId()); + applicationReferenceAlarm.setBehindApplicationId(inputMetric.getBehindApplicationId()); + return applicationReferenceAlarm; + } + + @Override protected Double calleeErrorRateThreshold() { + return applicationReferenceAlarmRuleConfig.calleeErrorRateThreshold(); + } + + @Override protected Double callerErrorRateThreshold() { + return applicationReferenceAlarmRuleConfig.callerErrorRateThreshold(); + } + + @Override protected Double calleeAverageResponseTimeThreshold() { + return applicationReferenceAlarmRuleConfig.calleeAverageResponseTimeThreshold(); + } + + @Override protected Double callerAverageResponseTimeThreshold() { + return applicationReferenceAlarmRuleConfig.callerAverageResponseTimeThreshold(); + } + + public static class Factory extends AlarmAssertWorkerProvider { + + public Factory(ModuleManager moduleManager) { + super(moduleManager); + } + + @Override public ApplicationReferenceMetricAlarmAssertWorker workerInstance(ModuleManager moduleManager) { + return new ApplicationReferenceMetricAlarmAssertWorker(moduleManager); + } + + @Override + public int queueSize() { + return 1024; + } + } +} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmGraph.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmGraph.java new file mode 100644 index 000000000..25bd40347 --- /dev/null +++ b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmGraph.java @@ -0,0 +1,80 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.application; + +import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmGraphIdDefine; +import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine; +import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricGraphIdDefine; +import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; +import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener; +import org.apache.skywalking.apm.collector.core.graph.Graph; +import org.apache.skywalking.apm.collector.core.graph.GraphManager; +import org.apache.skywalking.apm.collector.core.graph.Next; +import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; +import org.apache.skywalking.apm.collector.core.module.ModuleManager; +import org.apache.skywalking.apm.collector.remote.RemoteModule; +import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService; +import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarm; +import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetric; + +/** + * @author peng-yongsheng + */ +public class ApplicationReferenceMetricAlarmGraph { + + private final ModuleManager moduleManager; + private final WorkerCreateListener workerCreateListener; + + public ApplicationReferenceMetricAlarmGraph(ModuleManager moduleManager, + WorkerCreateListener workerCreateListener) { + this.moduleManager = moduleManager; + this.workerCreateListener = workerCreateListener; + } + + public void create() { + RemoteSenderService remoteSenderService = moduleManager.find(RemoteModule.NAME).getService(RemoteSenderService.class); + + Graph graph = GraphManager.INSTANCE.createIfAbsent(AlarmGraphIdDefine.APPLICATION_REFERENCE_METRIC_ALARM_GRAPH_ID, ApplicationReferenceMetric.class); + + graph.addNode(new ApplicationReferenceMetricAlarmAssertWorker.Factory(moduleManager).create(workerCreateListener)) + .addNext(new ApplicationReferenceMetricAlarmRemoteWorker.Factory(moduleManager, remoteSenderService, AlarmGraphIdDefine.APPLICATION_REFERENCE_METRIC_ALARM_GRAPH_ID).create(workerCreateListener)) + .addNext(new ApplicationReferenceMetricAlarmPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); + + graph.toFinder().findNode(AlarmWorkerIdDefine.APPLICATION_METRIC_ALARM_REMOTE_WORKER_ID, ApplicationReferenceAlarm.class) + .addNext(new ApplicationReferenceMetricAlarmToListNodeProcessor()) + .addNext(new ApplicationReferenceMetricAlarmListPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); + + link(graph); + } + + private void link(Graph graph) { + GraphManager.INSTANCE.findGraph(MetricGraphIdDefine.APPLICATION_REFERENCE_METRIC_GRAPH_ID, ApplicationReferenceMetric.class) + .toFinder().findNode(MetricWorkerIdDefine.INSTANCE_REFERENCE_METRIC_PERSISTENCE_WORKER_ID, ApplicationReferenceMetric.class) + .addNext(new NodeProcessor() { + @Override public int id() { + return AlarmWorkerIdDefine.APPLICATION_REFERENCE_METRIC_TRANSFORM_GRAPH_BRIDGE_WORKER_ID; + } + + @Override public void process(ApplicationReferenceMetric applicationReferenceMetric, + Next next) { + graph.start(applicationReferenceMetric); + } + }); + } +} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmListPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmListPersistenceWorker.java new file mode 100644 index 000000000..420018e47 --- /dev/null +++ b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmListPersistenceWorker.java @@ -0,0 +1,67 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.application; + +import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine; +import org.apache.skywalking.apm.collector.analysis.worker.model.impl.PersistenceWorker; +import org.apache.skywalking.apm.collector.analysis.worker.model.impl.PersistenceWorkerProvider; +import org.apache.skywalking.apm.collector.core.module.ModuleManager; +import org.apache.skywalking.apm.collector.storage.StorageModule; +import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; +import org.apache.skywalking.apm.collector.storage.dao.IApplicationReferenceAlarmListPersistenceDAO; +import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarmList; + +/** + * @author peng-yongsheng + */ +public class ApplicationReferenceMetricAlarmListPersistenceWorker extends PersistenceWorker { + + public ApplicationReferenceMetricAlarmListPersistenceWorker(ModuleManager moduleManager) { + super(moduleManager); + } + + @Override public int id() { + return AlarmWorkerIdDefine.APPLICATION_REFERENCE_METRIC_ALARM_LIST_PERSISTENCE_WORKER_ID; + } + + @Override protected boolean needMergeDBData() { + return true; + } + + @SuppressWarnings("unchecked") + @Override protected IPersistenceDAO persistenceDAO() { + return getModuleManager().find(StorageModule.NAME).getService(IApplicationReferenceAlarmListPersistenceDAO.class); + } + + public static class Factory extends PersistenceWorkerProvider { + public Factory(ModuleManager moduleManager) { + super(moduleManager); + } + + @Override + public ApplicationReferenceMetricAlarmListPersistenceWorker workerInstance(ModuleManager moduleManager) { + return new ApplicationReferenceMetricAlarmListPersistenceWorker(moduleManager); + } + + @Override + public int queueSize() { + return 1024; + } + } +} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmPersistenceWorker.java new file mode 100644 index 000000000..b35d802b8 --- /dev/null +++ b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmPersistenceWorker.java @@ -0,0 +1,66 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.application; + +import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine; +import org.apache.skywalking.apm.collector.analysis.worker.model.impl.PersistenceWorker; +import org.apache.skywalking.apm.collector.analysis.worker.model.impl.PersistenceWorkerProvider; +import org.apache.skywalking.apm.collector.core.module.ModuleManager; +import org.apache.skywalking.apm.collector.storage.StorageModule; +import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; +import org.apache.skywalking.apm.collector.storage.dao.IApplicationReferenceAlarmPersistenceDAO; +import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarm; + +/** + * @author peng-yongsheng + */ +public class ApplicationReferenceMetricAlarmPersistenceWorker extends PersistenceWorker { + + public ApplicationReferenceMetricAlarmPersistenceWorker(ModuleManager moduleManager) { + super(moduleManager); + } + + @Override public int id() { + return AlarmWorkerIdDefine.APPLICATION_REFERENCE_METRIC_ALARM_PERSISTENCE_WORKER_ID; + } + + @Override protected boolean needMergeDBData() { + return true; + } + + @SuppressWarnings("unchecked") + @Override protected IPersistenceDAO persistenceDAO() { + return getModuleManager().find(StorageModule.NAME).getService(IApplicationReferenceAlarmPersistenceDAO.class); + } + + public static class Factory extends PersistenceWorkerProvider { + public Factory(ModuleManager moduleManager) { + super(moduleManager); + } + + @Override public ApplicationReferenceMetricAlarmPersistenceWorker workerInstance(ModuleManager moduleManager) { + return new ApplicationReferenceMetricAlarmPersistenceWorker(moduleManager); + } + + @Override + public int queueSize() { + return 1024; + } + } +} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmRemoteWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmRemoteWorker.java new file mode 100644 index 000000000..f52cfc74a --- /dev/null +++ b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmRemoteWorker.java @@ -0,0 +1,61 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.application; + +import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine; +import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorker; +import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorkerProvider; +import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerException; +import org.apache.skywalking.apm.collector.core.module.ModuleManager; +import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService; +import org.apache.skywalking.apm.collector.remote.service.Selector; +import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarm; + +/** + * @author peng-yongsheng + */ +public class ApplicationReferenceMetricAlarmRemoteWorker extends AbstractRemoteWorker { + + public ApplicationReferenceMetricAlarmRemoteWorker(ModuleManager moduleManager) { + super(moduleManager); + } + + @Override public int id() { + return AlarmWorkerIdDefine.APPLICATION_REFERENCE_METRIC_ALARM_REMOTE_WORKER_ID; + } + + @Override public Selector selector() { + return Selector.HashCode; + } + + @Override protected void onWork(ApplicationReferenceAlarm message) throws WorkerException { + onNext(message); + } + + public static class Factory extends AbstractRemoteWorkerProvider { + + public Factory(ModuleManager moduleManager, RemoteSenderService remoteSenderService, int graphId) { + super(moduleManager, remoteSenderService, graphId); + } + + @Override public ApplicationReferenceMetricAlarmRemoteWorker workerInstance(ModuleManager moduleManager) { + return new ApplicationReferenceMetricAlarmRemoteWorker(moduleManager); + } + } +} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmToListNodeProcessor.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmToListNodeProcessor.java new file mode 100644 index 000000000..cea0d5918 --- /dev/null +++ b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmToListNodeProcessor.java @@ -0,0 +1,53 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.application; + +import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine; +import org.apache.skywalking.apm.collector.core.graph.Next; +import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; +import org.apache.skywalking.apm.collector.core.util.Const; +import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarm; +import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarmList; + +/** + * @author peng-yongsheng + */ +public class ApplicationReferenceMetricAlarmToListNodeProcessor implements NodeProcessor { + + @Override public int id() { + return AlarmWorkerIdDefine.APPLICATION_REFERENCE_METRIC_ALARM_TO_LIST_NODE_PROCESSOR_ID; + } + + @Override + public void process(ApplicationReferenceAlarm applicationReferenceAlarm, Next next) { + String id = applicationReferenceAlarm.getLastTimeBucket() + Const.ID_SPLIT + applicationReferenceAlarm.getSourceValue() + + Const.ID_SPLIT + applicationReferenceAlarm.getAlarmType() + + Const.ID_SPLIT + applicationReferenceAlarm.getFrontApplicationId() + + Const.ID_SPLIT + applicationReferenceAlarm.getBehindApplicationId(); + + ApplicationReferenceAlarmList applicationReferenceAlarmList = new ApplicationReferenceAlarmList(id); + applicationReferenceAlarmList.setFrontApplicationId(applicationReferenceAlarm.getFrontApplicationId()); + applicationReferenceAlarmList.setBehindApplicationId(applicationReferenceAlarm.getBehindApplicationId()); + applicationReferenceAlarmList.setSourceValue(applicationReferenceAlarm.getSourceValue()); + applicationReferenceAlarmList.setAlarmType(applicationReferenceAlarm.getAlarmType()); + applicationReferenceAlarmList.setTimeBucket(applicationReferenceAlarm.getLastTimeBucket()); + applicationReferenceAlarmList.setAlarmContent(applicationReferenceAlarm.getAlarmContent()); + next.execute(applicationReferenceAlarmList); + } +} diff --git a/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/ConfigurationModule.java b/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/ConfigurationModule.java index 3a9f12ade..2b9e50ccf 100644 --- a/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/ConfigurationModule.java +++ b/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/ConfigurationModule.java @@ -20,6 +20,7 @@ package org.apache.skywalking.apm.collector.configuration; import org.apache.skywalking.apm.collector.configuration.service.IApdexThresholdService; import org.apache.skywalking.apm.collector.configuration.service.IApplicationAlarmRuleConfig; +import org.apache.skywalking.apm.collector.configuration.service.IApplicationReferenceAlarmRuleConfig; import org.apache.skywalking.apm.collector.configuration.service.IInstanceAlarmRuleConfig; import org.apache.skywalking.apm.collector.configuration.service.IInstanceReferenceAlarmRuleConfig; import org.apache.skywalking.apm.collector.configuration.service.IServiceAlarmRuleConfig; @@ -41,6 +42,6 @@ public class ConfigurationModule extends Module { return new Class[] { IApdexThresholdService.class, IServiceAlarmRuleConfig.class, IInstanceAlarmRuleConfig.class, IApplicationAlarmRuleConfig.class, - IServiceReferenceAlarmRuleConfig.class, IInstanceReferenceAlarmRuleConfig.class}; + IServiceReferenceAlarmRuleConfig.class, IInstanceReferenceAlarmRuleConfig.class, IApplicationReferenceAlarmRuleConfig.class}; } } diff --git a/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/IApplicationReferenceAlarmRuleConfig.java b/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/IApplicationReferenceAlarmRuleConfig.java new file mode 100644 index 000000000..39596e4f1 --- /dev/null +++ b/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/IApplicationReferenceAlarmRuleConfig.java @@ -0,0 +1,34 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.apache.skywalking.apm.collector.configuration.service; + +import org.apache.skywalking.apm.collector.core.module.Service; + +/** + * @author peng-yongsheng + */ +public interface IApplicationReferenceAlarmRuleConfig extends Service { + double calleeErrorRateThreshold(); + + double calleeAverageResponseTimeThreshold(); + + double callerErrorRateThreshold(); + + double callerAverageResponseTimeThreshold(); +} diff --git a/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/ConfigurationModuleProvider.java b/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/ConfigurationModuleProvider.java index 22227b606..1a7847ecd 100644 --- a/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/ConfigurationModuleProvider.java +++ b/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/ConfigurationModuleProvider.java @@ -21,8 +21,10 @@ package org.apache.skywalking.apm.collector.configuration; import java.util.Properties; import org.apache.skywalking.apm.collector.configuration.service.ApdexThresholdService; import org.apache.skywalking.apm.collector.configuration.service.ApplicationAlarmRuleConfig; +import org.apache.skywalking.apm.collector.configuration.service.ApplicationReferenceAlarmRuleConfig; import org.apache.skywalking.apm.collector.configuration.service.IApdexThresholdService; import org.apache.skywalking.apm.collector.configuration.service.IApplicationAlarmRuleConfig; +import org.apache.skywalking.apm.collector.configuration.service.IApplicationReferenceAlarmRuleConfig; import org.apache.skywalking.apm.collector.configuration.service.IInstanceAlarmRuleConfig; import org.apache.skywalking.apm.collector.configuration.service.IInstanceReferenceAlarmRuleConfig; import org.apache.skywalking.apm.collector.configuration.service.IServiceAlarmRuleConfig; @@ -55,6 +57,7 @@ public class ConfigurationModuleProvider extends ModuleProvider { this.registerServiceImplementation(IApplicationAlarmRuleConfig.class, new ApplicationAlarmRuleConfig()); this.registerServiceImplementation(IServiceReferenceAlarmRuleConfig.class, new ServiceReferenceAlarmRuleConfig()); this.registerServiceImplementation(IInstanceReferenceAlarmRuleConfig.class, new InstanceReferenceAlarmRuleConfig()); + this.registerServiceImplementation(IApplicationReferenceAlarmRuleConfig.class, new ApplicationReferenceAlarmRuleConfig()); } @Override public void start(Properties config) throws ServiceNotProvidedException { diff --git a/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/ApplicationReferenceAlarmRuleConfig.java b/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/ApplicationReferenceAlarmRuleConfig.java new file mode 100644 index 000000000..30b301d86 --- /dev/null +++ b/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/ApplicationReferenceAlarmRuleConfig.java @@ -0,0 +1,41 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.apache.skywalking.apm.collector.configuration.service; + +/** + * @author peng-yongsheng + */ +public class ApplicationReferenceAlarmRuleConfig implements IApplicationReferenceAlarmRuleConfig { + + @Override public double calleeErrorRateThreshold() { + return 10.00; + } + + @Override public double calleeAverageResponseTimeThreshold() { + return 2000; + } + + @Override public double callerErrorRateThreshold() { + return 10.00; + } + + @Override public double callerAverageResponseTimeThreshold() { + return 3000; + } +} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/IApplicationReferenceAlarmListPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/IApplicationReferenceAlarmListPersistenceDAO.java new file mode 100644 index 000000000..a89be61ad --- /dev/null +++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/IApplicationReferenceAlarmListPersistenceDAO.java @@ -0,0 +1,28 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.apache.skywalking.apm.collector.storage.dao; + +import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; +import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarmList; + +/** + * @author peng-yongsheng + */ +public interface IApplicationReferenceAlarmListPersistenceDAO extends IPersistenceDAO { +} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/IApplicationReferenceAlarmPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/IApplicationReferenceAlarmPersistenceDAO.java new file mode 100644 index 000000000..9b052add3 --- /dev/null +++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/IApplicationReferenceAlarmPersistenceDAO.java @@ -0,0 +1,28 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.apache.skywalking.apm.collector.storage.dao; + +import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; +import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarm; + +/** + * @author peng-yongsheng + */ +public interface IApplicationReferenceAlarmPersistenceDAO extends IPersistenceDAO { +} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ApplicationReferenceAlarm.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ApplicationReferenceAlarm.java new file mode 100644 index 000000000..566f1aa7d --- /dev/null +++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ApplicationReferenceAlarm.java @@ -0,0 +1,112 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.apache.skywalking.apm.collector.storage.table.alarm; + +import org.apache.skywalking.apm.collector.core.data.Column; +import org.apache.skywalking.apm.collector.core.data.Data; +import org.apache.skywalking.apm.collector.core.data.operator.CoverOperation; +import org.apache.skywalking.apm.collector.core.data.operator.NonOperation; + +/** + * @author peng-yongsheng + */ +public class ApplicationReferenceAlarm extends Data implements Alarm { + + private static final Column[] STRING_COLUMNS = { + new Column(ApplicationReferenceAlarmTable.COLUMN_ID, new NonOperation()), + new Column(ApplicationReferenceAlarmTable.COLUMN_ALARM_CONTENT, new CoverOperation()), + }; + + private static final Column[] LONG_COLUMNS = { + new Column(ApplicationReferenceAlarmTable.COLUMN_LAST_TIME_BUCKET, new CoverOperation()), + }; + + private static final Column[] DOUBLE_COLUMNS = {}; + + private static final Column[] INTEGER_COLUMNS = { + new Column(ApplicationReferenceAlarmTable.COLUMN_ALARM_TYPE, new NonOperation()), + new Column(ApplicationReferenceAlarmTable.COLUMN_SOURCE_VALUE, new NonOperation()), + new Column(ApplicationReferenceAlarmTable.COLUMN_FRONT_APPLICATION_ID, new NonOperation()), + new Column(ApplicationReferenceAlarmTable.COLUMN_BEHIND_APPLICATION_ID, new NonOperation()), + }; + + private static final Column[] BOOLEAN_COLUMNS = {}; + + private static final Column[] BYTE_COLUMNS = {}; + + public ApplicationReferenceAlarm(String id) { + super(id, STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BOOLEAN_COLUMNS, BYTE_COLUMNS); + } + + @Override + public Integer getAlarmType() { + return getDataInteger(0); + } + + @Override + public void setAlarmType(Integer alarmType) { + setDataInteger(0, alarmType); + } + + @Override + public Integer getSourceValue() { + return getDataInteger(1); + } + + @Override + public void setSourceValue(Integer sourceValue) { + setDataInteger(1, sourceValue); + } + + public Integer getFrontApplicationId() { + return getDataInteger(2); + } + + public void setFrontApplicationId(Integer frontApplicationId) { + setDataInteger(2, frontApplicationId); + } + + public Integer getBehindApplicationId() { + return getDataInteger(3); + } + + public void setBehindApplicationId(Integer behindApplicationId) { + setDataInteger(3, behindApplicationId); + } + + @Override + public Long getLastTimeBucket() { + return getDataLong(0); + } + + @Override + public void setLastTimeBucket(Long lastTimeBucket) { + setDataLong(0, lastTimeBucket); + } + + @Override + public String getAlarmContent() { + return getDataString(1); + } + + @Override + public void setAlarmContent(String alarmContent) { + setDataString(1, alarmContent); + } +} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ApplicationReferenceAlarmList.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ApplicationReferenceAlarmList.java new file mode 100644 index 000000000..db47b8c90 --- /dev/null +++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ApplicationReferenceAlarmList.java @@ -0,0 +1,104 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.apache.skywalking.apm.collector.storage.table.alarm; + +import org.apache.skywalking.apm.collector.core.data.Column; +import org.apache.skywalking.apm.collector.core.data.Data; +import org.apache.skywalking.apm.collector.core.data.operator.CoverOperation; +import org.apache.skywalking.apm.collector.core.data.operator.NonOperation; + +/** + * @author peng-yongsheng + */ +public class ApplicationReferenceAlarmList extends Data { + + private static final Column[] STRING_COLUMNS = { + new Column(ApplicationReferenceAlarmListTable.COLUMN_ID, new NonOperation()), + new Column(ApplicationReferenceAlarmListTable.COLUMN_ALARM_CONTENT, new CoverOperation()), + }; + + private static final Column[] LONG_COLUMNS = { + new Column(ApplicationReferenceAlarmListTable.COLUMN_TIME_BUCKET, new NonOperation()), + }; + + private static final Column[] DOUBLE_COLUMNS = {}; + + private static final Column[] INTEGER_COLUMNS = { + new Column(ApplicationReferenceAlarmListTable.COLUMN_ALARM_TYPE, new NonOperation()), + new Column(ApplicationReferenceAlarmListTable.COLUMN_SOURCE_VALUE, new NonOperation()), + new Column(ApplicationReferenceAlarmListTable.COLUMN_FRONT_APPLICATION_ID, new NonOperation()), + new Column(ApplicationReferenceAlarmListTable.COLUMN_BEHIND_APPLICATION_ID, new NonOperation()), + }; + + private static final Column[] BOOLEAN_COLUMNS = {}; + + private static final Column[] BYTE_COLUMNS = {}; + + public ApplicationReferenceAlarmList(String id) { + super(id, STRING_COLUMNS, LONG_COLUMNS, DOUBLE_COLUMNS, INTEGER_COLUMNS, BOOLEAN_COLUMNS, BYTE_COLUMNS); + } + + public Integer getAlarmType() { + return getDataInteger(0); + } + + public void setAlarmType(Integer alarmType) { + setDataInteger(0, alarmType); + } + + public Integer getSourceValue() { + return getDataInteger(1); + } + + public void setSourceValue(Integer sourceValue) { + setDataInteger(1, sourceValue); + } + + public Integer getFrontApplicationId() { + return getDataInteger(2); + } + + public void setFrontApplicationId(Integer frontApplicationId) { + setDataInteger(2, frontApplicationId); + } + + public Integer getBehindApplicationId() { + return getDataInteger(3); + } + + public void setBehindApplicationId(Integer behindApplicationId) { + setDataInteger(3, behindApplicationId); + } + + public Long getTimeBucket() { + return getDataLong(0); + } + + public void setTimeBucket(Long timeBucket) { + setDataLong(0, timeBucket); + } + + public String getAlarmContent() { + return getDataString(1); + } + + public void setAlarmContent(String alarmContent) { + setDataString(1, alarmContent); + } +} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ApplicationReferenceAlarmListTable.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ApplicationReferenceAlarmListTable.java new file mode 100644 index 000000000..209c61d88 --- /dev/null +++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ApplicationReferenceAlarmListTable.java @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.apache.skywalking.apm.collector.storage.table.alarm; + +import org.apache.skywalking.apm.collector.storage.table.CommonMetricTable; + +/** + * @author peng-yongsheng + */ +public class ApplicationReferenceAlarmListTable extends CommonMetricTable { + public static final String TABLE = "application_reference_alarm_list"; + public static final String COLUMN_FRONT_APPLICATION_ID = "front_application_id"; + public static final String COLUMN_BEHIND_APPLICATION_ID = "behind_application_id"; + public static final String COLUMN_ALARM_TYPE = "alarm_type"; + public static final String COLUMN_ALARM_CONTENT = "alarm_content"; +} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ApplicationReferenceAlarmTable.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ApplicationReferenceAlarmTable.java new file mode 100644 index 000000000..8e1e98aec --- /dev/null +++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ApplicationReferenceAlarmTable.java @@ -0,0 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.apache.skywalking.apm.collector.storage.table.alarm; + +import org.apache.skywalking.apm.collector.storage.table.CommonMetricTable; + +/** + * @author peng-yongsheng + */ +public class ApplicationReferenceAlarmTable extends CommonMetricTable { + public static final String TABLE = "application_reference_alarm"; + public static final String COLUMN_FRONT_APPLICATION_ID = "front_application_id"; + public static final String COLUMN_BEHIND_APPLICATION_ID = "behind_application_id"; + public static final String COLUMN_ALARM_TYPE = "alarm_type"; + public static final String COLUMN_LAST_TIME_BUCKET = "last_time_bucket"; + public static final String COLUMN_ALARM_CONTENT = "alarm_content"; +}