赞
踩
通过/apps/apache-skywalking-apm-bin/config/oal/core.oal 定义指标数据如何查询数据,
通过/apps/apache-skywalking-apm-bin/config/alarm-settings.yml定义告警规则.
对一定时间范围内的数据进行计算后告警.
config/oal/core.oal
https://github.com/apache/skywalking/blob/master/docs/en/setup/backend/backend-alarm.md
规则名 | 作用 |
---|---|
service_resp_time | 服务响应时间,反应服务的快慢 |
service_sla | 服务的http请求成功率SLA,比如99%服务可用率 |
service_cpm | 每分钟吞吐量,请求次数 |
service_apdex | 应用性能指数,0-1之间,1最好 |
service_percentile | 指定最近多少数据范围内的响应时间百分比,p99,p95,p50在内的数据统计结果 |
endpoint_relation_cpm | 端点的每分钟吞吐量 |
endpoint_relation_resp_time | 端点的响应时间 |
endpoint_relation_sla | 端点的http请求成功率SLA |
endpoint_relation_percentile | 端点的最近多少范围内的响应时间百分比. |
alarm-settings.yml
指标 | 含义 |
---|---|
rules: | 定义rule规则 |
service_resp_time_rule: | 唯一的规则名称,必须以_rule结尾 |
metrics-name: service_resp_time | 指标名称 |
op: “>” | 操作符,>,<,==,>=,<= |
threshold: 1000 | 指标阈值 |
period: 10 | 评估指标的间隔周期(10分钟) |
count: 3 | 匹配成功多少次发送告警 |
silence-period: 5 | 触发告警后的静默时间(分钟) |
message: Response time of service {name} is more than 1000ms in 3 minutes of last 10 minutes. | 告警信息 |
默认情况下alarm-setting.yml
在发行版中提供了默认值。它包括以下规则:
修改配置文件alarm-settings.yml
当对服务发起访问,就从钉钉告警
rules: service_cpm_rule: metrics-name: service_cpm op: ">" threshold: 1 period: 2 count: 1 silence-period: 2 message: 服务 {name} 访问次数大于1 dingtalkHooks: textTemplate: |- { "msgtype": "text", "text": { "content": "Apache SkyWalking Alarm: \n %s." } } webhooks: - url: https://oapi.dingtalk.com/robot/send?access_token=1179c64f197a5da70d4b393111dd47578e58f8112e22f3e00d6632591337c43a
当对应用发起访问,就会触发钉钉告警
在skywalking控制台中也能看到告警触发记录
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。