[关闭]
@dume2007 2022-06-02T09:29:36.000000Z 字数 3778 阅读 374

Yaml监控规则编写示例


1、目前已实现的Trigger触发器

2、Trigger触发器配置样例

  1. # 规则配置
  2. EventID :
  3. title : 提现操作时调用浙商接口失败动作
  4. action : withdraw_cash
  5. trigger :
  6. -
  7. type : action
  8. value : call_zs_api_failed
  9. frequency : once
  10. # 提现操作行为日志
  11. {"timestamp":"2018-07-25T00:26:15.000000+08:00", "channel":"xhh.point", "service":"xhh.account", "action":"withdraw_cash", "unique_id":"200812348793345212"}
  12. # 调用浙商接口失败行为日志
  13. {"timestamp":"2018-07-25T00:26:15.000000+08:00", "channel":"xhh.point", "service":"xhh.account", "action":"call_zs_api_failed", "unique_id":"200812348793345212"}
  1. EventID :
  2. title : 二次展期行为日志
  3. action : extend
  4. filter :
  5. -
  6. type : field
  7. key : extended_times
  8. value : 2
  9. # 消息格式
  10. {"timestamp":"2018-07-25T00:26:15.000000+08:00", "channel":"xhh.point", "service":"xhh.xd", "action":"extend", "unique_id":"200812348793345212", "property":{"extended_times":2}}
  1. # 规则配置
  2. EventID :
  3. title : 匹配投资金额大于账户余额
  4. trigger :
  5. -
  6. type : compare
  7. compare : gt
  8. from : finance_amout
  9. target : account_amout
  10. # 消息格式
  11. {"timestamp":"2018-07-25T00:26:15.000000+08:00", "channel":"xhh.point", "service":"xhh.account", "action":"callZsApi", "unique_id":"200812348793345212", "property":{"finance_amout":1000, "account_amout":900}}
  1. # 规则配置
  2. EventID :
  3. title : 对项目prj_id=20180720224512345投资行为产生之后从当前0点开始计算15天后还未产生还款成功行为则触发预警,15天之内监控到还款成功行为则取消监控
  4. action : finance_success
  5. post_action : repayment_success
  6. filter :
  7. -
  8. type : field
  9. key : prj_id
  10. value : 20180720224512345
  11. trigger :
  12. -
  13. type : datetime
  14. compare : gt
  15. from : xxx # 默认当前时间
  16. target : xxx # 默认行为日志记录时间timestamp
  17. value : 15
  18. unit: day
  19. frequency : loop
  20. delay : 24
  21. collect :
  22. -
  23. type : action
  24. value : recharge,cancel_order,create_repay_plan
  25. # 投资行为日志
  26. {"timestamp":"2018-07-25T00:26:15.000000+08:00", "channel":"xhh.point", "service":"xhh.finance", "action":"finance_success", "unique_id":"200812348793345212", "property":{"prj_id":"20180720224512345"}}
  27. # 还款行为日志
  28. {"timestamp":"2018-09-25T00:26:15.000000+08:00", "channel":"xhh.point", "service":"xhh.repayment", "action":"repayment_success", "unique_id":"200812348793345212"}

3、运营指标监控分析

预警监控

通过埋点,由elk完成统计

  1. {"action":"create_repayment_plan", "prj_id":"20181234", "total_time":50}
  2. {"action":"create_repayment_plan", "prj_id":"20182345", "total_time":70}
  3. {"action":"create_repayment_plan", "prj_id":"20183456", "total_time":90}
  1. {"action":"finance", "prj_id":"20181234", "result":1}
  2. {"action":"finance", "prj_id":"20185678", "result":0}

4、多环节监控预警需求配置举例

  1. EventID :
  2. title : 代扣异常监控
  3. action : daikou_request_action
  4. post_action : daikou_finish_action
  5. trigger :
  6. -
  7. type : datetime
  8. compare : gt
  9. value : 1
  10. unit : hour
  11. collect :
  12. -
  13. type : action
  14. value : daikou_failed_action
  15. # 代扣请求开始行为日志
  16. {"timestamp":"2018-07-25T00:26:15.000000+08:00", "channel":"xhh.point", "service":"xhh.xiaoe", "action":"daikou_request_action", "unique_id":"200812348793345212", "property":{"daikou_total":999}}
  17. # 代扣成功完成后行为日志
  18. {"timestamp":"2018-07-25T00:50:15.000000+08:00", "channel":"xhh.point", "service":"xhh.xiaoe", "action":"daikou_finish_action", "unique_id":"200812348793345212"}
  19. # 每笔代扣失败后的行为日志
  20. {"timestamp":"2018-07-25T00:50:15.000000+08:00", "channel":"xhh.point", "service":"xhh.xiaoe", "action":"daikou_failed_action", "unique_id":"200812348793345212", "property":{"order_id":123, "error_message":"请求超时"}}
  1. EventID :
  2. title : 财务完成线下充值未触发还款
  3. action : repayment_recharge
  4. post_action : call_repayment_action
  5. trigger :
  6. -
  7. type : datetime
  8. compare : gt
  9. value : 5
  10. unit : minute
  11. # 还款充值行为日志
  12. {"timestamp":"2018-07-25T00:50:15.000000+08:00", "channel":"xhh.point", "service":"xhh.xiaoe", "action":"repayment_recharge", "unique_id":"200812348793345212"}
  13. # 调用还款系统行为日志
  14. {"timestamp":"2018-07-25T00:50:15.000000+08:00", "channel":"xhh.point", "service":"xhh.xiaoe", "action":"call_repayment_action", "unique_id":"200812348793345212"}
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注