lili e21ab160e2
Some checks failed
contract-gates / contract-gates (push) Has been cancelled
docs-gate / docs-gate (push) Has been cancelled
feat(obs): T2-5 Prometheus scrape game-cloud actuator(波② 端点已成立·dev target)
波② 已给 huijing-server 挂 actuator/micrometer、/actuator/prometheus 端点成立并 dev 亲验,
本波启用 prometheus.yml 里预留注释的 game-cloud job:target=dev huijing-dev(100.64.0.7:48080,
staging profile 已放行 /actuator/**、exposure 仅 health,prometheus)。nacos/rmq job 仍留注释
(各自 exporter 未就位、不越界)。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-05 11:50:20 -07:00

52 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 配置 —— 指标存储 · 自监控 + Collector 出口抓取
# 设计 §5 面三:本波先自监控(scrape 自身 + Collector),跨机抓 game-cloud/nacos/rmq
# 的目标注释占位、后续波启用。保留期由 compose 的 --storage.tsdb.retention.time=15d 定。
# =============================================================================
global:
scrape_interval: 30s # 30s 一轮,低负载够用、省资源
evaluation_interval: 30s
external_labels:
cluster: huijing-mvp
site: mini-infra
scrape_configs:
# ── 自监控:Prometheus 自身 ──
- job_name: prometheus
static_configs:
- targets: ["localhost:9090"]
# ── Collector 导出的业务指标(namespace=huijing,如 huijing_gen_task_total)──
# Collector 的 prometheus exporter 暴露在 8889;同网用服务名解析,不走对外端口。
- job_name: otel-collector
static_configs:
- targets: ["otel-collector:8889"]
# ── Collector 自身遥测(队列深度/丢弃数等,otelcol_* 指标,验收第 6 条要看)──
- job_name: otel-collector-internal
static_configs:
- targets: ["otel-collector:8888"]
# =========================================================================
# 预留 · 后续波启用(跨机经 Tailscale 100.64.0.x)。启用前置条件见设计 §5 面一:
# game-cloud 要先挂 actuator/micrometer 让 /actuator/prometheus 端点成立;
# nacos/rocketmq 的 micrometer 端点同样待各自 exporter 就位。端口按各服务实际暴露核对。
# =========================================================================
# game-cloud 单体 actuator(波② 已挂 actuator/micrometer,/actuator/prometheus 端点成立;T2-5 启用 2026-07-05)。
# dev 后端在 mini-desktop(100.64.0.7:48080),staging profile 已放行 /actuator/**(无鉴权可抓);exposure 仅 health,prometheus。
- job_name: game-cloud
metrics_path: /actuator/prometheus
static_configs:
- targets: ["100.64.0.7:48080"] # dev huijing-dev 单体 actuator(跨机 Tailscale)
labels:
env: dev
# - job_name: nacos
# metrics_path: /nacos/actuator/prometheus
# static_configs:
# - targets: ["100.64.0.8:8848"]
#
# - job_name: rocketmq
# static_configs:
# - targets: ["100.64.0.8:PORT"] # rocketmq-exporter 端口(待部署)