A-example.yml 3.6 KB

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