global: scrape_interval: 15s # 每15秒采集一次指标 evaluation_interval: 15s # 每15秒评估一次告警规则 scrape_configs: # Prometheus 自身监控 - job_name: 'prometheus' static_configs: - targets: ['localhost:9090'] # 监控服务器自身指标(通过 Node Exporter) - job_name: 'node-exporter-monitor' static_configs: - targets: ['node-exporter:9100'] labels: server: 'monitor' # 业务服务器指标(通过业务服务器上的 Node Exporter) - job_name: 'node-exporter-business' static_configs: - targets: ['118.178.238.159:9100'] labels: server: 'business' # 网关服务监控(端口8888) - job_name: 'wangpan-gateway' metrics_path: '/actuator/prometheus' static_configs: - targets: ['118.178.238.159:8888'] labels: service: 'gateway' # 用户服务监控 - job_name: 'wangpan-user-service' metrics_path: '/actuator/prometheus' static_configs: - targets: ['118.178.238.159:8081'] labels: service: 'user-service' # 网盘服务监控 - job_name: 'wangpan-drive-service' metrics_path: '/actuator/prometheus' static_configs: - targets: ['118.178.238.159:8082'] labels: service: 'drive-service' # TMDB服务监控 - job_name: 'wangpan-tmdb-service' metrics_path: '/actuator/prometheus' static_configs: - targets: ['118.178.238.159:8083'] labels: service: 'tmdb-service'