hi-server/prometheus/prometheus.yml
shanshanzhong 01ccd44e84
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 6m10s
feat: optimize docker-compose, add observability stack (Grafana/Loki/Prometheus), and host nginx config
2026-01-13 18:17:12 -08:00

47 lines
1.3 KiB
YAML

# 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"]