实现skywalking 实现钉钉告警

告警指标

  官网告警规则示例

  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.8是0.x

  service_percentile:   #指定最近多少数据范围内的响应时间百分比,即p99, p95, p90, p75, p50在内的数据统计结果

  endpoint_relation_cpm      #端点的每分钟的吞吐量

  endpoint_relation_resp_time   #端点的响应时间

  endpoint_relation_sla     #端点的http请求成功率SLA,比如99%等。

  endpoint_relation_percentile    #端点的最近多少数据范围内的响应时间百分比,即p99、p95、p90、p75、p50在内的数据统计结果

 

更多指标与规则:

  https://github.com/apache/skywalking/blob/master/docs/en/setup/backend/backend-alarm.md#list-of-all-%20potential-metrics-name

 

  skywalking本地查询语句配置文件路径

root@skywalking:/usr/local/apache-skywalking-apm-bin-es7# ll config/oal/core.oal

 

  告警规则文件

root@skywalking:/usr/local/apache-skywalking-apm-bin-es7# ll config/alarm-settings.yml
-rw-rw-r-- 1 1001 1002 3298 Jun 7 2021 config/alarm-settings.yml

 

 

规则示例

  告警规则文件

root@skywalking:/usr/local/apache-skywalking-apm-bin-es7/config# cat alarm-settings.yml
# Sample alarm rules.
rules:
# Rule unique name, must be ended with `_rule`.
service_resp_time_rule: #规则名称,名称的结尾必须是_rule
metrics-name: service_resp_time #指标名称,与config/oal/core.oal下的指标语句名称相匹配
op: ">" #操作符,>, >=, <, <=, ==
threshold: 1000 #指标阈值
period: 10 #评估指标的间隔周期,单位分钟。
count: 3 #匹配成功多少次就会触发告警
silence-period: 5 #触发告警后的静默(延迟)时间,建议时间不要设置太长,单位分钟。
message: Response time of service {name} is more than 1000ms in 3 minutes of last 10 minutes. #告警内容信息

 

 

配置告警

  配置skywalking告警模版,设置为钉钉告警

  定义每分钟的吞吐量大于1的话就会触发告警。

root@skywalking:/usr/local/apache-skywalking-apm-bin-es7/config# vim alarm-settings.yml
rules:
# Rule unique name, must be ended with `_rule`.
service_resp_time_rule:
metrics-name: service_cpm
op: ">"
threshold: 5
period: 1
count: 1
silence-period: 1
message: Response time of service {name} is more than 5ms in 1 minutes.
dingtalkHooks:
textTemplate: |-
{
"msgtype": "text",
"text": {
"content": "Apache skywalking Alarm \n %s."
}
}
webhooks:
- url: https://oapi.dingtalk.com/robot/send?access_token=6755dc6d17a9a5b5597f60628d65e2c4d454be1325ea3bb68673ec50816
1a373

 

 

 

  重启skywalking

 

  配置钉钉机器人

 

 

  验证:

 

  验证skywalking server端触发告警

 

posted @   PunchLinux  阅读(602)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 记一次.NET内存居高不下排查解决与启示
  1. 1 Get Lucky Daft Punnk
  2. 2 烦恼歌 张学友
  3. 3 Way Back Home Conor Maynard
  4. 4 Put A Little Love In Your Heart Jackie DeShannon
  5. 5 菊次郎的夏天 久石譲
  6. 6 一丝不挂 陈奕迅
  7. 7 日落大道 梁博
  8. 8 Rage your dream m.o.v.e
  9. 9 Don't Be So Shy Imany
  10. 10 芒种 腾格尔
Don't Be So Shy - Imany
00:00 / 00:00
An audio error has occurred, player will skip forward in 2 seconds.

Not available

点击右上角即可分享
微信分享提示