Kamixitong/monitoring/prometheus.yml

57 lines
1.3 KiB
YAML
Raw Normal View History

2025-12-12 11:35:14 +08:00
# Prometheus 监控配置
# 用于监控 KaMiXiTong 系统的性能和健康状态
global:
scrape_interval: 15s # 全局采集间隔
evaluation_interval: 15s # 告警规则评估间隔
# 告警管理器配置
alerting:
alertmanagers:
- static_configs:
- targets:
- alertmanager:9093
# 告警规则文件
rule_files:
- "alert_rules.yml"
# 采集配置
scrape_configs:
# Prometheus 自身监控
- job_name: 'prometheus'
static_configs:
- targets: ['localhost:9090']
# KaMiXiTong 应用监控
- job_name: 'kamaxitong'
static_configs:
- targets: ['localhost:5000']
metrics_path: '/api/v1/metrics'
scrape_interval: 15s
scrape_timeout: 10s
# 系统监控(需要安装 node_exporter
- job_name: 'node'
static_configs:
- targets: ['localhost:9100']
scrape_interval: 15s
# 数据库监控(需要安装 mysqld_exporter 或 postgres_exporter
- job_name: 'mysql'
static_configs:
- targets: ['localhost:9104']
scrape_interval: 15s
# Redis 监控(需要安装 redis_exporter
- job_name: 'redis'
static_configs:
- targets: ['localhost:9121']
scrape_interval: 15s
# Nginx 监控(需要安装 nginx-prometheus-exporter
- job_name: 'nginx'
static_configs:
- targets: ['localhost:9113']
scrape_interval: 15s