ether/deploy/monitoring/prometheus/prometheus.yml

94 lines
2.4 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#========================================
# Prometheus 主配置U8a
# 抓取 8 个后端微服务的 /actuator/prometheus 端点
# 所有服务通过 pms-net 网络以服务名访问
#========================================
global:
scrape_interval: 15s # 默认抓取间隔
evaluation_interval: 15s # 告警规则评估间隔
external_labels:
cluster: etherpms-prod
environment: production
# 告警规则文件
rule_files:
- /etc/prometheus/rules.yml
# Alertmanager 配置
alerting:
alertmanagers:
- static_configs:
- targets:
- alertmanager:9093
# 抓取目标
scrape_configs:
# Prometheus 自身指标
- job_name: 'prometheus'
static_configs:
- targets: ['localhost:9090']
# Alertmanager 指标
- job_name: 'alertmanager'
static_configs:
- targets: ['alertmanager:9093']
# ====== EtherPMS 后端微服务8 个)======
# 每个服务通过 /actuator/prometheus 暴露 Micrometer 指标
# metrics.tags.application 标签由 application.yml 注入
- job_name: 'pms-gateway'
metrics_path: '/actuator/prometheus'
static_configs:
- targets: ['pms-gateway:8080']
labels:
service: 'gateway-service'
- job_name: 'pms-auth'
metrics_path: '/actuator/prometheus'
static_configs:
- targets: ['pms-auth:8081']
labels:
service: 'auth-service'
- job_name: 'pms-base'
metrics_path: '/actuator/prometheus'
static_configs:
- targets: ['pms-base:8082']
labels:
service: 'base-service'
- job_name: 'pms-operation'
metrics_path: '/actuator/prometheus'
static_configs:
- targets: ['pms-operation:8083']
labels:
service: 'operation-service'
- job_name: 'pms-charge'
metrics_path: '/actuator/prometheus'
static_configs:
- targets: ['pms-charge:8084']
labels:
service: 'charge-service'
- job_name: 'pms-notify'
metrics_path: '/actuator/prometheus'
static_configs:
- targets: ['pms-notify:8085']
labels:
service: 'notify-service'
- job_name: 'pms-file'
metrics_path: '/actuator/prometheus'
static_configs:
- targets: ['pms-file:8086']
labels:
service: 'file-service'
- job_name: 'pms-audit'
metrics_path: '/actuator/prometheus'
static_configs:
- targets: ['pms-audit:8087']
labels:
service: 'audit-service'