Prometheus Configuration

作者 wshobson46891e7e60da无许可证收录于 2026年10月8日更新于 2026年10月8日

Set up Prometheus for comprehensive metric collection, storage, and monitoring of infrastructure and applications. Use when implementing metrics collection, setting up monitoring infrastructure, or configuring alerting systems.

仅含说明DevOps & Cloud
AI 生成的概览

指导 Prometheus 配置,涵盖指标采集、抓取配置、记录规则与告警。

功能
提供 Prometheus 配置指南,涵盖指标采集、抓取配置、记录规则和告警规则设计。包含命名、抓取间隔、保留策略、重标记、高可用、联邦和长期存储等最佳实践。还列出用于检查目标、配置和查询的故障排查命令,并指向参考文件以获取详细模式。
适用场景
适用于设置 Prometheus 监控、配置指标抓取、创建记录规则、设计告警规则或实现服务发现时。
运行要求
无脚本,仅为说明。需要 Prometheus 实例,以及访问其 HTTP API 的网络权限以运行故障排查命令。

Prometheus Configuration

Complete guide to Prometheus setup, metric collection, scrape configuration, and recording rules.

Purpose

Configure Prometheus for comprehensive metric collection, alerting, and monitoring of infrastructure and applications.

When to Use

  • Set up Prometheus monitoring
  • Configure metric scraping
  • Create recording rules
  • Design alert rules
  • Implement service discovery

Detailed patterns and worked examples

Detailed pattern documentation lives in references/details.md. Read that file when the navigation tier above is insufficient.

Best Practices

  1. Use consistent naming for metrics (prefix_name_unit)
  2. Set appropriate scrape intervals (15-60s typical)
  3. Use recording rules for expensive queries
  4. Implement high availability (multiple Prometheus instances)
  5. Configure retention based on storage capacity
  6. Use relabeling for metric cleanup
  7. Monitor Prometheus itself
  8. Implement federation for large deployments
  9. Use Thanos/Cortex for long-term storage
  10. Document custom metrics

Troubleshooting

Check scrape targets:

bash
curl http://localhost:9090/api/v1/targets

Check configuration:

bash
curl http://localhost:9090/api/v1/status/config

Test query:

bash
curl 'http://localhost:9090/api/v1/query?query=up'

Related Skills

  • grafana-dashboards - For visualization
  • slo-implementation - For SLO monitoring
  • distributed-tracing - For request tracing

来源与署名

来源:wshobson/agents位于plugins/observability-monitoring/skills/prometheus-configuration提交46891e7

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架