A-example.yml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. # 监控应用类型名称(与文件名保持一致) eg: linux windows tomcat mysql aws...
  2. app: cloud
  3. # 参数映射map. type是参数类型: number数字, string明文字符串, secret加密字符串
  4. # 强制固定必须参数 - host
  5. configmap:
  6. - key: host
  7. type: 1
  8. - key: port
  9. type: 0
  10. - key: username
  11. type: 1
  12. - key: password
  13. type: 2
  14. - key: param1
  15. type: 1
  16. # 指标组列表
  17. metrics:
  18. # 第一个监控指标组 cpu
  19. - name: cpu
  20. # 指标组调度优先级(0-127)越小优先级越高,优先级低的指标组会等优先级高的指标组采集完成后才会被调度,相同优先级的指标组会并行调度采集
  21. # 优先级为0的指标组为可用性指标组,即它会被首先调度,采集成功才会继续调度其它指标组,采集失败则中断调度
  22. priority: 0
  23. # 指标组中的具体监控指标
  24. fields:
  25. # 指标信息 包括 field名称, type字段类型:number数字,string字符串, unit:指标单位
  26. - field: usage
  27. type: number
  28. unit: '%'
  29. - field: cores
  30. type: number
  31. - field: waitime
  32. type: number
  33. unit: s
  34. # (非必须)监控指标别名,与上面的指标名映射。用于采集接口数据字段不直接是最终指标名称,需要此别名做映射转换
  35. aliasFields:
  36. - core1
  37. - core2
  38. - usage
  39. - allTime
  40. - runningTime
  41. # (非必须)指标计算表达式,与上面的别名一起作用,计算出最终需要的指标值
  42. # eg: cores=core1+core2, usage=usage, waitTime=allTime-runningTime
  43. calculates:
  44. - cores=core1+core2
  45. - usage=usage
  46. - waitTime=allTime-runningTime
  47. # 监控采集使用协议 eg: sql, ssh, http, telnet, wmi, snmp, sdk
  48. protocol: http
  49. # 当protocol为http协议时具体的采集配置
  50. http:
  51. # 主机host: ipv4 ipv6 域名
  52. host: ^_^host^_^
  53. # 端口
  54. port: ^_^port^_^
  55. # url请求接口路径
  56. url: /cpu
  57. # 请求方式 GET POST PUT DELETE PATCH
  58. method: GET
  59. # 是否启用ssl/tls,即是http还是https,默认false
  60. ssl: false
  61. # 请求头内容
  62. headers:
  63. apiVersion: v1
  64. # 请求参数内容
  65. params:
  66. param1: param1
  67. param2: param2
  68. # 认证
  69. authorization:
  70. # 认证方式: Basic Auth, Digest Auth, Bearer Token
  71. type: Basic Auth
  72. basicAuthUsername: ^_^username^_^
  73. basicAuthPassword: ^_^password^_^
  74. # 响应数据解析方式: default-系统规则,json_path-jsonPath脚本,xml_path-xmlPath脚本,prometheus-Prometheus数据规则
  75. parseType: jsonPath
  76. parseScript: '$.cpu[:1].*'
  77. - name: memory
  78. priority: 1
  79. fields:
  80. - field: total
  81. type: number
  82. unit: kb
  83. - field: usage
  84. type: number
  85. unit: '%'
  86. - field: speed
  87. type: number
  88. protocol: http
  89. http:
  90. host: ^_^host^_^
  91. port: ^_^port^_^
  92. url: /memory
  93. method: GET
  94. headers:
  95. apiVersion: v1
  96. params:
  97. param1: param1
  98. param2: param2
  99. authorization:
  100. type: Basic Auth
  101. basicAuthUsername: ^_^username^_^
  102. basicAuthPassword: ^_^password^_^
  103. parseType: jsonPath
  104. parseScript: '$.memory[:1].*'