360 Secure SkillHub
360 安全技能中心

prometheus-configuration

面向基础设施与应用监控的 Prometheus 配置指南,覆盖指标抓取、记录规则、告警规则、服务发现与最佳实践,并给出基于本地 HTTP API 的排查命令;更详细的模式与示例放在 references/details.md 中。

分类:开发
wshobson
热度 43.61
最近更新 2026-10-18 15:57:21

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add wshobson/agents/prometheus-configuration
兼容性
通用兼容
联网要求
需要联网
数据出网
数据不出本机
Metadata
name
prometheus-configuration
description
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.

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:

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

Check configuration:

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

Test query:

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