You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2019/06/14 14:59:51 UTC

[skywalking] 01/01: Update backend-alarm.md

This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch wu-sheng-patch-1
in repository https://gitbox.apache.org/repos/asf/skywalking.git

commit 8d258b92703cab5ee8e07e67b47c6746021acedf
Author: 吴晟 Wu Sheng <wu...@foxmail.com>
AuthorDate: Fri Jun 14 22:59:43 2019 +0800

    Update backend-alarm.md
---
 docs/en/setup/backend/backend-alarm.md | 30 ++++++++++++++++++++++++------
 1 file changed, 24 insertions(+), 6 deletions(-)

diff --git a/docs/en/setup/backend/backend-alarm.md b/docs/en/setup/backend/backend-alarm.md
index 053429d..18d7108 100644
--- a/docs/en/setup/backend/backend-alarm.md
+++ b/docs/en/setup/backend/backend-alarm.md
@@ -1,8 +1,8 @@
 # Alarm
 Alarm core is driven a collection of rules, which are defined in `config/alarm-settings.yml`.
 There are two parts in alarm rule definition.
-1. Alarm rules. They define how metrics alarm should be triggered, what conditions should be considered.
-1. Webhooks. The list of web service endpoint, which should be called after the alarm is triggered.
+1. [Alarm rules](#rules). They define how metrics alarm should be triggered, what conditions should be considered.
+1. [Webhooks](#webhook). The list of web service endpoint, which should be called after the alarm is triggered.
 
 ## Rules
 Alarm rule is constituted by following keys
@@ -49,18 +49,36 @@ rules:
     count: 4
 ```
 
-## Default alarm rules
+### Default alarm rules
 We provided a default `alarm-setting.yml` in our distribution only for convenience, which including following rules
 1. Service average response time over 1s in last 3 minutes.
 1. Service success rate lower than 80% in last 2 minutes.
 1. Service 90% response time is lower than 1000ms in last 3 minutes
 1. Service Instance average response time over 1s in last 2 minutes.
 1. Endpoint average response time over 1s in last 2 minutes.
- 
 
-
-## List of all potential metrics name
+### List of all potential metrics name
 The metrics names are defined in official [OAL scripts](../../guides/backend-oal-scripts.md), right now 
 metrics from **Service**, **Service Instance**, **Endpoint** scopes could be used in Alarm, we will extend in further versions. 
 
 Submit issue or pull request if you want to support any other scope in alarm.
+
+## Webhook
+Webhook requires the peer is a web container. The alarm message will send through HTTP post by `application/json` content type. The JSON format is based on `List<org.apache.skywalking.oap.server.core.alarm.AlarmMessage`, example as following
+```json
+[{
+	"scopeId": 1, // All scopes are defined in org.apache.skywalking.oap.server.core.source.DefaultScopeDefine
+  "name": "serviceA", // Target scope entity name
+	"id0": 12,  // The ID of scope entity
+	"id1": 0,  // Not used today
+	"alarmMessage": "alarmMessage xxxx",
+	"startTime": 1560524171000 // Alarm time measured in milliseconds, between the current time and midnight, January 1, 1970 UTC.
+}, {
+	"scopeId": 1,
+  "name": "serviceB",
+	"id0": 23,
+	"id1": 0,
+	"alarmMessage": "alarmMessage yyy",
+	"startTime": 1560524171000
+}]
+```