You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2018/09/04 13:41:15 UTC

[GitHub] wu-sheng closed pull request #1625: v6 startup successful.

wu-sheng closed pull request #1625: v6 startup successful.
URL: https://github.com/apache/incubator-skywalking/pull/1625
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/oap-server/server-alarm-plugin/src/main/java/org/apache/skywalking/oap/server/core/alarm/provider/AlarmModuleProvider.java b/oap-server/server-alarm-plugin/src/main/java/org/apache/skywalking/oap/server/core/alarm/provider/AlarmModuleProvider.java
index b7533bce2..3c228a52a 100644
--- a/oap-server/server-alarm-plugin/src/main/java/org/apache/skywalking/oap/server/core/alarm/provider/AlarmModuleProvider.java
+++ b/oap-server/server-alarm-plugin/src/main/java/org/apache/skywalking/oap/server/core/alarm/provider/AlarmModuleProvider.java
@@ -18,15 +18,10 @@
 
 package org.apache.skywalking.oap.server.core.alarm.provider;
 
-import java.io.FileNotFoundException;
-import java.io.Reader;
-import org.apache.skywalking.oap.server.core.alarm.AlarmModule;
-import org.apache.skywalking.oap.server.core.alarm.IndicatorNotify;
-import org.apache.skywalking.oap.server.library.module.ModuleConfig;
-import org.apache.skywalking.oap.server.library.module.ModuleDefine;
-import org.apache.skywalking.oap.server.library.module.ModuleProvider;
-import org.apache.skywalking.oap.server.library.module.ModuleStartException;
-import org.apache.skywalking.oap.server.library.module.ServiceNotProvidedException;
+import java.io.*;
+import org.apache.skywalking.oap.server.core.CoreModule;
+import org.apache.skywalking.oap.server.core.alarm.*;
+import org.apache.skywalking.oap.server.library.module.*;
 import org.apache.skywalking.oap.server.library.util.ResourceUtils;
 
 public class AlarmModuleProvider extends ModuleProvider {
@@ -43,26 +38,25 @@
     }
 
     @Override public void prepare() throws ServiceNotProvidedException, ModuleStartException {
-
-    }
-
-    @Override public void start() throws ServiceNotProvidedException, ModuleStartException {
         Reader applicationReader;
         try {
             applicationReader = ResourceUtils.read("alarm-settings.yml");
         } catch (FileNotFoundException e) {
-            throw new ModuleStartException("can't load alarm-settings.yml",e);
+            throw new ModuleStartException("can't load alarm-settings.yml", e);
         }
         RulesReader reader = new RulesReader(applicationReader);
         Rules rules = reader.readRules();
         this.registerServiceImplementation(IndicatorNotify.class, new NotifyHandler(rules));
     }
 
+    @Override public void start() throws ServiceNotProvidedException, ModuleStartException {
+    }
+
     @Override public void notifyAfterCompleted() throws ServiceNotProvidedException, ModuleStartException {
 
     }
 
     @Override public String[] requiredModules() {
-        return new String[0];
+        return new String[] {CoreModule.NAME};
     }
 }
diff --git a/oap-server/server-starter/src/main/resources/alarm-settings.yml b/oap-server/server-starter/src/main/resources/alarm-settings.yml
new file mode 100644
index 000000000..5ea4ff504
--- /dev/null
+++ b/oap-server/server-starter/src/main/resources/alarm-settings.yml
@@ -0,0 +1,44 @@
+# 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.
+
+rules:
+  # Rule unique name, must be ended with `_rule`.
+  endpoint_percent_rule:
+    # Indicator value need to be long, double or int
+    indicator-name: endpoint_percent
+    threshold: 75
+    op: <
+    # The length of time to evaluate the metric
+    period: 10
+    # How many times after the metric match the condition, will trigger alarm
+    count: 3
+    # How many times of checks, the alarm keeps silence after alarm triggered, default as same as period.
+    silence-period: 10
+  service_percent_rule:
+    indicator-name: service_percent
+    # [Optional] Default, match all services in this indicator
+    include-names:
+      - service_a
+      - service_b
+    threshold: 85
+    op: <
+    period: 10
+    count: 4
+
+#webhooks:
+#  - http://127.0.0.1/notify/
+#  - http://127.0.0.1/go-wechat/
+


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services