skywalking之alarm配置详细说明

官方文档 link

skywalking版本:9.0.1

  • 9.0.0版本告警有bug: Can’t split service id into 2 parts 官方在9.1.0修复了

配置文件说明

  • alarm-settings.yml 默认配置内容
rules:
  # Rule unique name, must be ended with `_rule`.
  # 1.0
  service_resp_time_rule:
    metrics-name: service_resp_time
    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.
  # 2.0
  service_sla_rule:
    # Metrics value need to be long, double or int
    metrics-name: service_sla
    op: "<"
    threshold: 8000
    # The length of time to evaluate the metrics
    period: 10
    # How many times after the metrics match the condition, will trigger alarm
    count: 2
    # How many times of checks, the alarm keeps silence after alarm triggered, default as same as period.
    silence-period: 3
    message: Successful rate of service {name} is lower than 80% in 2 minutes of last 10 minutes
  # 3.0
  service_resp_time_percentile_rule:
    # Metrics value need to be long, double or int
    metrics-name: service_percentile
    op: ">"
    threshold: 1000,1000,1000,1000,1000
    period: 10
    count: 3
    silence-period: 5
    message: Percentile response time of service {name} alarm in 3 minutes of last 10 minutes, due to more than one condition of p50 > 1000, p75 > 1000, p90 > 1000, p95 > 1000, p99 > 1000
  # 4.0
  service_instance_resp_time_rule:
    metrics-name: service_instance_resp_time
    op: ">"
    threshold: 1000
    period: 10
    count: 2
    silence-period: 5
    message: Response time of service instance {name} is more than 1000ms in 2 minutes of last 10 minutes
  # 5.0
  database_access_resp_time_rule:
    metrics-name: database_access_resp_time
    threshold: 1000
    op: ">"
    period: 10
    count: 2
    message: Response time of database access {name} is more than 1000ms in 2 minutes of last 10 minutes
  # 6.0
  endpoint_relation_resp_time_rule:
    metrics-name: endpoint_relation_resp_time
    threshold: 1000
    op: ">"
    period: 10
    count: 2
    message: Response time of endpoint relation {name} is more than 1000ms in 2 minutes of last 10 minutes

1. service_resp_time_rule(服务响应时间)

service_resp_time_rule:
  metrics-name: service_resp_time
  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.
  • metrics-name: 监控的指标名称,service_resp_time 表示服务的响应时间。
  • op: 比较操作符,这里是 >,表示当响应时间大于阈值时触发告警。
  • threshold: 阈值,设置为 1000 毫秒,表示响应时间超过 1000 毫秒时触发告警。
  • period: 在过去的 10 分钟内进行检查的时间窗口,单位是分钟。
  • count: 条件必须满足多少次才能触发告警,这里是 3 次,表示响应时间超过 1000 毫秒的次数达到 3 次。
  • silence-period: 在告警触发后多少次检查不会重新触发告警,默认与 period 相同,这里是 5 次。
  • message: 告警消息模板,表示服务的响应时间超过 1000 毫秒。

2. service_sla_rule(服务的 SLA成功率)

service_sla_rule:
  metrics-name: service_sla
  op: "<"
  threshold: 8000
  period: 10
  count: 2
  silence-period: 3
  message: Successful rate of service {name} is lower than 80% in 2 minutes of last 10 minutes
  • metrics-name: service_sla,表示服务的 SLA(服务级别协议)成功率。
  • op: <,表示当成功率低于阈值时触发告警。
  • threshold: 阈值为 8000,表示成功率低于 80% 时触发告警。
  • period: 10 分钟时间窗口。
  • count: 成功率低于 80% 的次数为 2 次时触发告警。
  • silence-period: 告警触发后,告警在接下来的 3 次检查中不会重复触发。
  • message: 提供告警的消息模板,显示服务的 SLA 成功率低于 80%。

3. service_resp_time_percentile_rule(服务的百分位响应时间)

service_resp_time_percentile_rule:
  metrics-name: service_percentile
  op: ">"
  threshold: 1000,1000,1000,1000,1000
  period: 10
  count: 3
  silence-period: 5
  message: Percentile response time of service {name} alarm in 3 minutes of last 10 minutes, due to more than one condition of p50 > 1000, p75 > 1000, p90 > 1000, p95 > 1000, p99 > 1000
  • metrics-name: service_percentile,表示服务的百分位响应时间指标。
  • op: >,表示当响应时间的某个百分位大于阈值时触发告警。
  • threshold: 列出多个阈值,分别对应 P50、P75、P90、P95、P99 的响应时间。
  • period: 10 分钟时间窗口。
  • count: 如果有 3 次超过这些阈值,则触发告警。
  • silence-period: 告警触发后,5 次检查期间不会触发新的告警。
  • message: 告警消息,指出多个百分位(如 P50、P75 等)响应时间超过了 1000 毫秒。

4. service_instance_resp_time_rule(服务实例的响应时间)

service_instance_resp_time_rule:
  metrics-name: service_instance_resp_time
  op: ">"
  threshold: 1000
  period: 10
  count: 2
  silence-period: 5
  message: Response time of service instance {name} is more than 1000ms in 2 minutes of last 10 minutes
  • metrics-name: service_instance_resp_time,表示服务实例的响应时间。
  • op: >,表示当实例的响应时间大于阈值时触发告警。
  • threshold: 阈值为 1000 毫秒。
  • period: 10 分钟时间窗口。
  • count: 2 次超过阈值时触发告警。
  • silence-period: 5 次检查期间不会触发告警。
  • message: 告警消息模板,提示服务实例响应时间过长。

5. database_access_resp_time_rule(数据库访问的响应时间)

database_access_resp_time_rule:
  metrics-name: database_access_resp_time
  threshold: 1000
  op: ">"
  period: 10
  count: 2
  message: Response time of database access {name} is more than 1000ms in 2 minutes of last 10 minutes
  • metrics-name: database_access_resp_time,表示数据库访问的响应时间。
  • op: >,表示数据库访问响应时间大于阈值时触发告警。
  • threshold: 阈值为 1000 毫秒。
  • period: 10 分钟时间窗口。
  • count: 2 次超过阈值时触发告警。
  • message: 告警消息模板,提示数据库响应时间过长。

6. endpoint_relation_resp_time_rule(端点相关的响应时间)

endpoint_relation_resp_time_rule:
  metrics-name: endpoint_relation_resp_time
  threshold: 1000
  op: ">"
  period: 10
  count: 2
  message: Response time of endpoint relation {name} is more than 1000ms in 2 minutes of last 10 minutes
  • metrics-name: endpoint_relation_resp_time,表示与端点相关的响应时间。
  • op: >,表示响应时间大于阈值时触发告警。
  • threshold: 阈值为 1000 毫秒。
  • period: 10 分钟时间窗口。
  • count: 2 次超过阈值时触发告警。
  • message: 告警消息模板,提示端点相关的响应时间过长。

实战文章: link

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值