https://github.com/apache/skywalking/blob/master/docs/en/setup/backend/backend-alarm.md
~$ vim /apps/apache-skywalking-apm-bin/config/oal/core.oal
service_resp_time # 服务的响应时间
service_sla # 服务http请求成功率SLV,比如99%
service_cpm # 表示每分钟吞吐量
service_percentile # 指定响应时间百分比,即p99,p95,p75,p50的数据统计结果
service_apdex # 应用性能指数、
// Endpoint scope metrics
endpoint_cpm # 端点每分钟吞吐量
endpoint_resp_time # 端点响应时间
endpoint_sla # 端点http请求成功率SLA,比如99%
endpoint_percentile # 端点的最近多少数据范围内的响应时间百分比,即p99,p95,p75统计结果
~$ vim /apps/apache-skywalking-apm-bin/config/alarm-settings.yml
rules: #定义rule规则
service_cpm_rule: #唯一的规则名称,必须以_rule结尾
# Metrics value need to be long, double or int
metrics-name: service_cpm #指标名称
op: ">" #操作符,>, >=, <, <=, ==
threshold: 1 #指标阈值
# The length of time to evaluate the metrics
period: 2 #评估指标的间隔周期
# How many times after the metrics match the condition, will trigger alarm
count: 1 #匹配成功多少次就会触发告警
# How many times of checks, the alarm keeps silence after alarm triggered, default as same as period.
#silence-period: 3
silence-period: 2 #触发告警后的静默时间
message: dubbo-provider service_cpm 大于1了 #告警信息
dingtalkHooks:
textTemplate: |-
{
"msgtype": "text",
"text": {
"content": "Apache SkyWalking Alarm: \n %s."
}
}
webhooks:
- url: https://oapi.dingtalk.com/robot/send?access_token=3f773a20ef885659112b0d49086ca60d575562a2b1f113fbe215703366bb66f9