# Prometheus 配置文件 global: scrape_interval: 15s # 默认抓取频率 evaluation_interval: 15s scrape_configs: # ---------------------------------------- # 1. Prometheus 自身监控 # ---------------------------------------- - job_name: "prometheus" static_configs: - targets: ["localhost:9090"] # ---------------------------------------- # 2. 业务后端 (PPanel Server) # ---------------------------------------- # 如果您的后端代码暴露了 /metrics 接口,可启用此项 # - job_name: "ppanel-server" # static_configs: # - targets: ["ppanel-server:8080"] # ---------------------------------------- # 3. 基础设施监控 (Redis, MySQL, Nginx) # ---------------------------------------- - job_name: "redis" static_configs: - targets: ["redis-exporter:9121"] - job_name: "mysql" static_configs: - targets: ["mysql-exporter:9104"] - job_name: "nginx" static_configs: - targets: ["nginx-exporter:9113"] # ---------------------------------------- # 4. 宿主机与容器资源监控 # ---------------------------------------- - job_name: "node-exporter" # 宿主机硬件资源 static_configs: - targets: ["node-exporter:9100"] - job_name: "cadvisor" # 容器资源 static_configs: - targets: ["cadvisor:8080"]