api.yml 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. # 监控应用类型名称(与文件名保持一致) eg: linux windows tomcat mysql aws...
  2. app: api
  3. name:
  4. zh-CN: HTTP API
  5. en-US: HTTP API
  6. # 参数映射map. type是参数类型: 0-number数字, 1-string明文字符串, 2-secret加密字符串
  7. # 强制固定必须参数 - host
  8. configmap:
  9. - key: host
  10. type: 1
  11. - key: port
  12. type: 0
  13. - key: uri
  14. type: 1
  15. - key: method
  16. type: 1
  17. - key: ssl
  18. type: 1
  19. - key: username
  20. type: 1
  21. - key: password
  22. type: 2
  23. - key: contentType
  24. type: 1
  25. - key: payload
  26. type: 1
  27. # 指标组列表
  28. metrics:
  29. # 第一个监控指标组 cpu
  30. # 注意:内置监控指标有 (responseTime - 响应时间)
  31. - name: summary
  32. # 指标组调度优先级(0-127)越小优先级越高,优先级低的指标组会等优先级高的指标组采集完成后才会被调度,相同优先级的指标组会并行调度采集
  33. # 优先级为0的指标组为可用性指标组,即它会被首先调度,采集成功才会继续调度其它指标组,采集失败则中断调度
  34. priority: 0
  35. # 指标组中的具体监控指标
  36. fields:
  37. # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位
  38. - field: responseTime
  39. type: 0
  40. unit: ms
  41. # 监控采集使用协议 eg: sql, ssh, http, telnet, wmi, snmp, sdk
  42. protocol: http
  43. # 当protocol为http协议时具体的采集配置
  44. http:
  45. # 主机host: ipv4 ipv6 域名
  46. host: ^_^host^_^
  47. # 端口
  48. port: ^_^port^_^
  49. # url请求接口路径
  50. url: ^_^uri^_^
  51. # 请求方式 GET POST PUT DELETE PATCH
  52. method: ^_^method^_^
  53. # 是否启用ssl/tls,即是http还是https,默认false
  54. ssl: ^_^ssl^_^
  55. payload: ^_^payload^_^
  56. # 请求头内容
  57. headers:
  58. content-type: ^_^contentType^_^
  59. # 认证
  60. authorization:
  61. # 认证方式: Basic Auth, Digest Auth, Bearer Token
  62. type: Basic Auth
  63. basicAuthUsername: ^_^username^_^
  64. basicAuthPassword: ^_^password^_^
  65. # 响应数据解析方式: default-系统规则,jsonPath-jsonPath脚本,website-网站可用性指标监控
  66. # todo xmlPath-xmlPath脚本,prometheus-Prometheus数据规则
  67. parseType: website