SuperAPI AI 工具集

prometheus-configuration

部署与运维

查看项目

更新于 10-16 08:02

技能介绍

用途:配置 Prometheus,实现基础设施与应用指标的采集、存储、告警和监控。适用于搭建 Prometheus 监控、配置指标抓取、创建记录规则、设计告警规则以及实现服务发现。不适用于与 Prometheus 配置无关的任务。

主要能力:提供 Prometheus 架构说明(应用通过客户端库暴露 /metrics,Prometheus 周期性抓取,并联动 AlertManager、Grafana 及长期存储);支持 Kubernetes Helm 与 Docker Compose 两种安装方式;支持静态目标、基于文件的服务发现和 Kubernetes 服务发现;支持记录规则与告警规则编写;提供配置与规则校验方法。

使用方式:Kubernetes 可用 helm repo add prometheus-community https://prometheus-community.github.io/helm-charts 后安装 kube-prometheus-stack;Docker Compose 挂载 prometheus.yml 并设置存储路径与保留时间。核心配置在 prometheus.yml 中定义 global、alerting、rule_files 和 scrape_configs。规则文件放在 /etc/prometheus/rules/ 下。校验命令:promtool check config prometheus.yml、promtool check rules /etc/prometheus/rules/*.yml、promtool query instant http://localhost:9090 'up'。

适用场景:主机与容器指标采集、应用指标抓取、Kubernetes 动态发现、错误率与延迟告警、CPU/内存/磁盘资源告警。

限制:资料未提供具体收费、价格、平台支持范围或性能效果数据;需自行准备 Prometheus 环境与目标端点。