智慧水务管理系统 - 精河县供水工程综合管理平台

prometheus.yml 4.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. # ============================================================
  2. # Prometheus 配置 - 生产环境监控
  3. # ============================================================
  4. global:
  5. scrape_interval: 15s
  6. evaluation_interval: 15s
  7. scrape_timeout: 10s
  8. external_labels:
  9. cluster: water-management-prod
  10. environment: production
  11. # ==================== 告警规则 ====================
  12. rule_files:
  13. - "alert_rules.yml"
  14. # ==================== AlertManager ====================
  15. alerting:
  16. alertmanagers:
  17. - static_configs:
  18. - targets:
  19. - alertmanager:9093
  20. # ==================== 抓取目标 ====================
  21. scrape_configs:
  22. # ==================== Prometheus 自身 ====================
  23. - job_name: 'prometheus'
  24. static_configs:
  25. - targets: ['localhost:9090']
  26. metrics_path: /metrics
  27. # ==================== Node Exporter (主机指标) ====================
  28. - job_name: 'node-exporter'
  29. static_configs:
  30. - targets: ['node-exporter:9100']
  31. scrape_interval: 10s
  32. relabel_configs:
  33. - source_labels: [__address__]
  34. regex: '([^:]+):\d+'
  35. target_label: instance
  36. replacement: '${1}'
  37. # ==================== cAdvisor (容器指标) ====================
  38. - job_name: 'cadvisor'
  39. static_configs:
  40. - targets: ['cadvisor:8080']
  41. scrape_interval: 15s
  42. metrics_path: /metrics
  43. # ==================== 应用服务 (Spring Boot Actuator) ====================
  44. - job_name: 'wm-gateway'
  45. metrics_path: /actuator/prometheus
  46. static_configs:
  47. - targets: ['wm-gateway:8080']
  48. labels:
  49. service: gateway
  50. module: base
  51. - job_name: 'wm-base'
  52. metrics_path: /actuator/prometheus
  53. static_configs:
  54. - targets: ['wm-base:8081']
  55. labels:
  56. service: base
  57. module: system
  58. - job_name: 'wm-iot'
  59. metrics_path: /actuator/prometheus
  60. static_configs:
  61. - targets: ['wm-iot:8082']
  62. labels:
  63. service: iot
  64. module: data-engine
  65. - job_name: 'wm-data-engine'
  66. metrics_path: /actuator/prometheus
  67. static_configs:
  68. - targets: ['wm-data-engine:8083']
  69. labels:
  70. service: data-engine
  71. module: data-engine
  72. - job_name: 'wm-bpm'
  73. metrics_path: /actuator/prometheus
  74. static_configs:
  75. - targets: ['wm-bpm:8084']
  76. labels:
  77. service: bpm
  78. module: bpm
  79. - job_name: 'wm-production'
  80. metrics_path: /actuator/prometheus
  81. static_configs:
  82. - targets: ['wm-production:8085']
  83. labels:
  84. service: production
  85. module: production
  86. - job_name: 'wm-revenue'
  87. metrics_path: /actuator/prometheus
  88. static_configs:
  89. - targets: ['wm-revenue:8086']
  90. labels:
  91. service: revenue
  92. module: revenue
  93. - job_name: 'wm-patrol'
  94. metrics_path: /actuator/prometheus
  95. static_configs:
  96. - targets: ['wm-patrol:8087']
  97. labels:
  98. service: patrol
  99. module: patrol
  100. - job_name: 'wm-notify'
  101. metrics_path: /actuator/prometheus
  102. static_configs:
  103. - targets: ['wm-notify:8089']
  104. labels:
  105. service: notify
  106. module: notify
  107. - job_name: 'wm-job'
  108. metrics_path: /actuator/prometheus
  109. static_configs:
  110. - targets: ['wm-job:8090']
  111. labels:
  112. service: job
  113. module: job
  114. # ==================== PostgreSQL ====================
  115. - job_name: 'postgres'
  116. static_configs:
  117. - targets: ['postgres-exporter:9187']
  118. scrape_interval: 30s
  119. # ==================== Redis ====================
  120. - job_name: 'redis'
  121. static_configs:
  122. - targets: ['redis-exporter:9121']
  123. scrape_interval: 30s
  124. # ==================== Nginx ====================
  125. - job_name: 'nginx'
  126. static_configs:
  127. - targets: ['wm-frontend:9113']
  128. scrape_interval: 15s
  129. metrics_path: /metrics
  130. # ==================== EMQX MQTT ====================
  131. - job_name: 'emqx'
  132. static_configs:
  133. - targets: ['wm-emqx:18083']
  134. scrape_interval: 30s
  135. metrics_path: /api/v5/metrics
  136. basic_auth:
  137. username: admin
  138. password: public