monitoring Roadmap
监控 / Prometheus 排障专题
监控 / Prometheus 排障专题:聚合 Target down、服务发现配置错误、Exporter 不可抓取、Promtool 校验失败、抓取超时和高基数标签等监控链路问题的完整排障路径。
Prometheus 排障先确认是监控系统自身不可用还是 target/exporter 不可抓取,从 Prometheus 所在网络位置测试 metrics 而不是只在本机 curl,Target down 的根因常在网络策略、DNS 和端口配置。
Troubleshooting Path
推荐排障路线图
- 01
先看 Targets 页面状态
从 Prometheus Web UI 的 Targets 页面确认 target 是 up 还是 down,记录 Last Error、endpoint 和 labels,而不是只看告警。
- 02
再验证服务发现配置
ServiceMonitor、PodMonitor、relabel、namespaceSelector 和标签不匹配会导致压根没有 target,检查 selector 和端口名是否匹配。
- 03
继续从 Prometheus 网络位置测试
本机 curl 通不代表 Prometheus 能抓到,进入 Prometheus Pod 或所在机器 curl /metrics,排查网络策略和 DNS。
- 04
最后检查指标质量和性能
高基数 label、抓取超时、metrics 体积过大会让监控变慢或数据缺失,用 scrape_duration_seconds 评估抓取性能。
Common Issues
高频问题入口
Before You Change
执行前检查
- 排查 target down 时从 Prometheus 所在网络位置测试,不是只在本机 curl
- 不要只改 Prometheus 配置而不验证生成后的 target,可能导致监控盲区
- 上线 exporter 前检查 metrics 体积和高基数标签,避免抓取性能问题
- 不要在业务高峰临时打开大量高基数指标,可能导致 Prometheus OOM
Start Here
优先阅读
Prometheus Target Down 排查流程
Prometheus Targets 页面显示 down、context deadline exceeded 或 connection refused 时,先看 Last Error,从 Prometheus 所在网络位置 curl 目标 /metrics,Kubernetes 场景检查 ServiceMonitor 的 selector 与 namespaceSelector 是否匹配 Service labels 和端口名。
命令Prometheus 配置检查和 Target 排查命令
Prometheus 配置校验和 target 排查的常用命令,promtool check config 排除 prometheus.yml 语法错误,从 Prometheus 所在网络位置 curl target /metrics 复现抓取,Kubernetes 场景 kubectl describe servicemonitor 检查 selector 和端口名匹配。
Latest Updates
最近更新
All Runbooks
全部相关内容
Prometheus Target Down 排查流程
Prometheus Targets 页面显示 down、context deadline exceeded 或 connection refused 时,先看 Last Error,从 Prometheus 所在网络位置 curl 目标 /metrics,Kubernetes 场景检查 ServiceMonitor 的 selector 与 namespaceSelector 是否匹配 Service labels 和端口名。
命令Prometheus 配置检查和 Target 排查命令
Prometheus 配置校验和 target 排查的常用命令,promtool check config 排除 prometheus.yml 语法错误,从 Prometheus 所在网络位置 curl target /metrics 复现抓取,Kubernetes 场景 kubectl describe servicemonitor 检查 selector 和端口名匹配。