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 從公開儲存庫中收錄這些內容。

檢舉或申請下架