A-example.yml 3.7 KB

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