lili 9c4638ee9d
Some checks failed
contract-gates / contract-gates (push) Has been cancelled
docs-gate / docs-gate (push) Has been cancelled
fix(观测): 阶段四第一波起容器四处排障修复(端口/expand-env/镜像)
起容器碰生产 mini-infra 暴露四坑,逐个修:
- 端口:9090 被 mini-infra 自身 mihomo/clash API 占(docker ps 看不到 host 网/宿主进程端口、摸底漏),Prometheus 让到 9091
- Loki+Tempo:配置注释里的 ${MINIO_*} 被 expand-env 连注释严格校验、通配符触发 "missing closing brace",改纯文字(先前误判 Tempo 宽松、其实同款)
- Collector 镜像:daocloud mirror 的 collector-contrib:0.116.0 缺 binary(exec no such file、force 重下同 digest 仍坏);0.114.0 的 redaction 缺 blocked_key_patterns/redact_all_types(脱敏红线);定版 0.155.0(binary 完好+redaction 字段最全)
五件全绿:Collector/Prometheus(9091)/Tempo/Loki/Grafana 全 200,实占约 170MiB(<< 3.4G 上限)。
follow-up:0.155 提示 otlphttp→otlp_http(deprecated warning、不阻塞)。

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

58 lines
2.3 KiB
YAML

# =============================================================================
# Tempo 配置 —— 追踪存储 · 单进程 monolithic · 后端 = MinIO(obs-tempo 桶)
# 设计 §7:选 Tempo(同 Grafana 体系、三联下钻、对象存储内存友好)。
# 收 Collector 转发的 OTLP;blocks 落 MinIO、WAL 落本地卷 /var/tempo。
# MINIO_ACCESS_KEY / MINIO_SECRET_KEY 由 -config.expand-env=true 从容器环境变量展开(compose 注入)。
# 坑:注释里勿写带星号的美元花括号形式 —— Tempo/Loki 的 expand-env 会连注释一起严格校验,
# 变量名含通配符星号会报 missing closing brace 起不来。
# =============================================================================
# 允许 Grafana 经 HTTP 流式拉取查询结果(TraceQL 搜索用)。
stream_over_http_enabled: true
server:
http_listen_port: 3200 # 对外 query API(compose 映射 3200,Grafana 内网走 tempo:3200)
grpc_listen_port: 9095
distributor:
receivers:
# Collector 用 otlp/tempo exporter 发到这里(容器内 4317,不对外映射,不与
# Collector 对外的 4317 冲突 —— 不同容器各自独立监听)。
otlp:
protocols:
grpc:
endpoint: "0.0.0.0:4317"
http:
endpoint: "0.0.0.0:4318"
ingester:
# 尽快切块落对象存储,降低内存里活跃 trace 的驻留(mini-infra 资源纪律)。
max_block_duration: 5m
compactor:
compaction:
block_retention: 168h # 追踪保留 7 天(设计 §4:Tempo 追踪 · MinIO bucket)
storage:
trace:
backend: s3
wal:
path: /var/tempo/wal # 本地 WAL(落 named volume tempo-data)
s3:
endpoint: infra-minio:9000 # 同网 DNS 名,复用既有 MinIO
bucket: obs-tempo # 观测专用桶,绝不碰 ragflow 现有桶
access_key: ${MINIO_ACCESS_KEY}
secret_key: ${MINIO_SECRET_KEY}
insecure: true # MinIO 同网走 HTTP、非 TLS(endpoint 为 IP:port,
# minio-go 自动用 path-style,无需额外 forcepathstyle 字段)
# 关掉匿名用量上报(内网、不外呼)。
usage_report:
reporting_enabled: false
# 单租户默认摄入上限:MVP 单机、留足头。
overrides:
defaults:
ingestion:
max_traces_per_user: 50000