用途:用于配置 Prometheus,实现基础设施与应用指标采集、告警与监控。适用场景包括搭建 Prometheus 监控、配置指标抓取、创建记录规则、设计告警规则与实现服务发现;与 Prometheus 配置无关或超出该领域时应避免使用。
主要能力:涵盖安装(Kubernetes Helm:helm repo add prometheus-community https://prometheus-community.github.io/helm-charts 与 helm install prometheus prometheus-community/kube-prometheus-stack;Docker Compose 部署)、prometheus.yml 全局与告警配置、静态目标、文件服务发现、Kubernetes Pod/Service 服务发现及 relabel_configs、记录规则(如 job:http_requests:rate5m、P95 延迟、CPU 内存磁盘利用率)、告警规则(ServiceDown、HighErrorRate、HighLatency、HighCPUUsage、HighMemoryUsage、DiskSpaceLow)等。
使用方式:编辑 scrape_configs、rule_files 与 alerting 指向 Alertmanager;规则文件置于 /etc/prometheus/rules/.yml;用 promtool check config prometheus.yml、promtool check rules /etc/prometheus/rules/.yml 校验,promtool query instant http://localhost:9090 'up' 测试查询;可通过 curl http://localhost:9090/api/v1/targets 等接口排查。详细示例参见 assets/prometheus.yml.template、references/scrape-configs.md、references/recording-rules.md 与 scripts/validate-prometheus.sh。
限制:资料未提供具体版本兼容性、价格与性能数据;其他事实暂未提供。