alarm-settings.yml 3.6 KB
Newer Older
1 2 3 4 5 6
# 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
wu-sheng's avatar
wu-sheng 已提交
7 8 9 10 11 12 13 14 15 16 17 18
#
#     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:
19 20
    # Metrics value need to be long, double or int
    metrics-name: endpoint_percent
wu-sheng's avatar
wu-sheng 已提交
21 22
    threshold: 75
    op: <
23
    # The length of time to evaluate the metrics
wu-sheng's avatar
wu-sheng 已提交
24
    period: 10
25
    # How many times after the metrics match the condition, will trigger alarm
wu-sheng's avatar
wu-sheng 已提交
26 27 28
    count: 3
    # How many times of checks, the alarm keeps silence after alarm triggered, default as same as period.
    silence-period: 10
29
    only-as-condition: false
wu-sheng's avatar
wu-sheng 已提交
30
    message: Successful rate of endpoint {name} is lower than 75%
31

wu-sheng's avatar
wu-sheng 已提交
32
  service_percent_rule:
33 34
    metrics-name: service_percent
    # [Optional] Default, match all services in this metrics
wu-sheng's avatar
wu-sheng 已提交
35 36 37
    include-names:
      - service_a
      - service_b
38 39
    exclude-names:
      - service_c
wu-sheng's avatar
wu-sheng 已提交
40 41 42 43
    threshold: 85
    op: <
    period: 10
    count: 4
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
    only-as-condition: false

  endpoint_percent_more_rule:
    # Metrics value need to be long, double or int
    metrics-name: endpoint_percent
    threshold: 60
    op: ">"
    # The length of time to evaluate the metrics
    period: 10
    # How many times after the metrics 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
    # Control if this rule is just as a composite rule condition. do not notification alone
    only-as-condition: false
    message: Successful rate of endpoint {name} is higher than 60%

composite-rules:
  comp1_rule:
    expression: endpoint_percent_more_rule && endpoint_percent_rule
    message: xxxxx
wu-sheng's avatar
wu-sheng 已提交
65 66 67 68 69

webhooks:
  - http://127.0.0.1/notify/
  - http://127.0.0.1/go-wechat/

J
Jared Tan 已提交
70 71 72 73
gRPCHook:
  target_host: 127.0.0.1
  target_port: 9888

X
xbkaishui 已提交
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
slackHooks:
  textTemplate: |-
    {
      "type": "section",
      "text": {
        "type": "mrkdwn",
        "text": ":alarm_clock: *Apache Skywalking Alarm* \n **%s**."
      }
    }
  webhooks:
    - https://hooks.slack.com/services/x/y/zssss

wechatHooks:
  textTemplate: |-
    {
      "msgtype": "text",
      "text": {
        "content": "Apache SkyWalking Alarm: \n %s."
      }
    }
  webhooks:
    - https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=dummy_key

dingtalkHooks:
  textTemplate: |-
    {
      "msgtype": "text",
      "text": {
        "content": "Apache SkyWalking Alarm: \n %s."
      }
    }
  webhooks:
    - url: https://oapi.dingtalk.com/robot/send?access_token=dummy_token
      secret: dummysecret
    - url: https://oapi.dingtalk.com/robot/send?access_token=dummy_token2
      secret:
H
HendSame 已提交
110 111 112 113 114 115 116 117 118 119 120 121 122 123

feishuHooks:
  textTemplate: |-
    {
      "msg_type": "text",
      "content": {
        "text": "Apache SkyWalking Alarm: \n %s."
      }
    }
  webhooks:
    - url: https://open.feishu.cn/open-apis/bot/v2/hook/dummy_token
      secret: dummysecret
    - url: https://open.feishu.cn/open-apis/bot/v2/hook/dummy_token2
      secret: