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 16:45:24 UTC
[skywalking] branch master updated: Add alarm webhook document
(#2878)
This is an automated email from the ASF dual-hosted git repository.
wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking.git
The following commit(s) were added to refs/heads/master by this push:
new 10b050d Add alarm webhook document (#2878)
10b050d is described below
commit 10b050da226fa39ab64cc4a19ca36d24d25391bb
Author: 吴晟 Wu Sheng <wu...@foxmail.com>
AuthorDate: Sat Jun 15 00:45:17 2019 +0800
Add alarm webhook document (#2878)
* Update backend-alarm.md
* Update backend-alarm.md
---
docs/en/setup/backend/backend-alarm.md | 38 ++++++++++++++++++++++++++++------
1 file changed, 32 insertions(+), 6 deletions(-)
diff --git a/docs/en/setup/backend/backend-alarm.md b/docs/en/setup/backend/backend-alarm.md
index 053429d..7fc6459 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,44 @@ 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` with following key information.
+- **scopeId**. All scopes are defined in org.apache.skywalking.oap.server.core.source.DefaultScopeDefine.
+- **name**. Target scope entity name.
+- **id0**. The ID of scope entity, matched the name.
+- **id1**. Not used today.
+- **alarmMessage**. Alarm text message.
+- **startTime**. Alarm time measured in milliseconds, between the current time and midnight, January 1, 1970 UTC.
+
+Example as following
+```json
+[{
+ "scopeId": 1,
+ "name": "serviceA",
+ "id0": 12,
+ "id1": 0,
+ "alarmMessage": "alarmMessage xxxx",
+ "startTime": 1560524171000
+}, {
+ "scopeId": 1,
+ "name": "serviceB",
+ "id0": 23,
+ "id1": 0,
+ "alarmMessage": "alarmMessage yyy",
+ "startTime": 1560524171000
+}]
+```