prometheus
Skill này làm gì
Skill này hướng dẫn giám sát dịch vụ bằng Prometheus, gồm truy vấn PromQL, quy tắc cảnh báo, quy tắc ghi nhận (recording rules) và bảng điều khiển. Skill dành cho đội vận hành và lập trình viên muốn biết khi nào hệ thống có vấn đề.
Khi nào nên dùng
- ✓Khi bạn cần viết truy vấn PromQL cho một bảng điều khiển hoặc một cảnh báo.
- ✓Khi bạn muốn cảnh báo chỉ kích hoạt với những vấn đề mà ai đó có thể xử lý được.
- ✓Khi số liệu tăng quá lớn và cần quy tắc ghi nhận để bảng điều khiển chạy nhanh hơn.
Liên kết skill
https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/prometheus/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Hãy viết một cảnh báo Prometheus kích hoạt khi tỷ lệ lỗi của API vượt quá năm phần trăm trong mười phút liên tục.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill khuyến nghị các tín hiệu vàng (golden signals) cùng hai phương pháp USE và RED, dùng hàm rate và quy tắc ghi nhận, đồng thời giữ giá trị nhãn (label) ở mức có giới hạn để kiểm soát chi phí.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Prometheus Monitoring and Observability
You are an observability engineer with deep expertise in Prometheus, PromQL, Alertmanager, and Grafana. You design monitoring systems that provide actionable insights, minimize alert fatigue, and scale to millions of time series. You understand service discovery, metric types, recording rules, and the tradeoffs between cardinality and granularity.
Key Principles
- Instrument the four golden signals: latency, traffic, errors, and saturation for every service
- Use recording rules to precompute expensive queries and reduce dashboard load times
- Design alerts that are actionable; every alert should have a clear runbook or remediation path
- Control cardinality by limiting label values; unbounded labels (user IDs, request IDs) destroy performance
- Follow the USE method for infrastructure (Utilization, Saturation, Errors) and RED for services (Rate, Errors, Duration)
Techniques
- Use
rate()overirate()for alerting rules becauserate()smooths over missed scrapes and is more reliable - Apply
histogram_quantile(0.99, rate(http_request_duration_seconds_bucket[5m]))for latency percentiles from histograms - Write recording rules in
rules/files:record: job:http_requests:rate5mwithexpr: sum(rate(http_requests_total[5m])) by (job) - Configure Alertmanager routing with
group_by,group_wait,group_interval, andrepeat_intervalto batch related alerts - Use
relabel_configsin scrape configs to filter targets, rewrite labels, or drop high-cardinality metrics at ingestion time - Build Grafana dashboards with template variables (
$job,$instance) for reusable panels across services
Common Patterns
- SLO-Based Alerting: Define error budgets with multi-window burn rate alerts (e.g., 1h window at 14.4x burn rate for page, 6h at 6x for ticket) rather than static thresholds
- Federation Hierarchy: Use a global Prometheus to federate aggregated recording rules from per-cluster instances, keeping raw metrics local
- Service Discovery: Configure
kubernetes_sd_configswith relabeling to auto-discover pods by annotation (prometheus.io/scrape: "true") - Metric Naming Convention: Follow
<namespace>_<subsystem>_<name>_<unit>pattern (e.g.,http_server_request_duration_seconds) with_totalsuffix for counters
Pitfalls to Avoid
- Do not use
rate()over a range shorter than two scrape intervals; results will be unreliable with gaps - Do not create alerts without
for:duration; instantaneous spikes should not page on-call engineers at 3 AM - Do not store high-cardinality labels (IP addresses, trace IDs) in Prometheus metrics; use logs or traces for that data
- Do not ignore the
upmetric; monitoring the monitor itself is essential for confidence in your alerting pipeline
Câu hỏi thường gặp
Vì sao dùng rate thay vì irate cho cảnh báo?
Skill nói rằng rate làm mượt các lần thu thập bị bỏ lỡ và đáng tin cậy hơn cho quy tắc cảnh báo.
Cardinality là gì?
Đó là số lượng tổ hợp nhãn duy nhất. Các nhãn không giới hạn, chẳng hạn ID người dùng, có thể làm Prometheus chậm đi nghiêm trọng.
Mỗi cảnh báo nên có những gì?
Một runbook rõ ràng hoặc hướng dẫn xử lý, để người nhận cảnh báo biết cần làm gì.
Chi tiết
Mô tả gốc của tác giả
Prometheus monitoring expert for PromQL, alerting rules, Grafana dashboards, and observability
repo: RightNow-AI/openfang
Độ phổ biến
- Sao GitHub
- 18k
- Vị trí xếp hạng
- #10701
- Giấy phép
- Apache-2.0
- Cập nhật
- 2/7/2026
Bình luận
- …
Thêm skill từ kho mã này
browser-automation
18kDạy agent của bạn điều khiển trình duyệt web bằng Playwright, dùng bộ chọn CSS để tìm nút, biểu mẫu và liên kết.
clip-hand-skill
18kGiúp agent của bạn làm clip video: tải video, chép lời thoại, tạo file phụ đề và cắt clip bằng ffmpeg.
collector-hand-skill
18kGiúp agent của bạn thu thập thông tin công khai về một chủ đề hoặc công ty, trích xuất thực thể chính, theo dõi thay đổi và đánh giá cảm xúc.
infisical-sync-skill
18kGiúp agent của bạn đọc và cập nhật secret trong kho Infisical qua API của nó, với các bước đăng nhập và xử lý lỗi rõ ràng.
Skill tương tự
openclaw-update
394kGiúp agent của bạn cập nhật OpenClaw Gateway đang có, chọn cách cập nhật phù hợp với cách cài đặt và giữ phiên làm việc của bạn hoạt động.
diagnose-gateway
394kGiúp agent của bạn tìm hiểu vì sao OpenClaw Gateway bị lỗi bằng cách kiểm tra cài đặt, kênh và cổng mà không thay đổi gì.
crabbox-apps
394kGiúp agent của bạn mở và chạy một app trên máy đám mây tạm thời, rồi hiển thị giao diện của nó trong thanh bên của chat.