К основному содержанию
скилл CX Codex

prometheus-expert — скилл для Claude Code: PromQL, алерты, установка

Скилл prometheus-expert для Claude Code учит агента мониторингу Prometheus: сбору метрик, запросам PromQL, recording и alerting rules. Помогает поднимать экспортёры в Kubernetes и разбирать чужие дашборды.

Apache-2.0 204 установок ★ 45 обновлён 2026-10-12

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add personamanagmentlayer/pcl --skill prometheus-expert -a claude-code
Открыть на GitHub

Что делает prometheus-expert

Скилл даёт агенту рабочую рамку по Prometheus: сбор метрик, PromQL, recording rules, алерты, service discovery. Внутри лежат готовые куски — node-exporter как DaemonSet, счётчики и гистограммы на Go-клиенте, список антипаттернов вроде запроса к счётчику без rate. Ещё есть порядок внедрения: от golden signals к SLI/SLO и нескольким инстансам Prometheus. Подробная часть вынесена в references/CORE_CONCEPTS.md и читается по необходимости.

Из инструментов агенту доступны kubectl и promtool, поэтому он и правило проверит, и посмотрит, что реально крутится в кластере. Нужны Prometheus 2.45 и Kubernetes 1.28 или новее: на старых версиях примеры с ServiceMonitor и вызовы kubectl не сойдутся. Пороги алертов и retention (30d в проде, 7d в разработке) скилл только называет — выбирать их вам.

Какие задачи решает

  • Развернуть node-exporter DaemonSet и снять метрики с нод
  • Написать запрос с rate и histogram_quantile без ошибок
  • Настроить алерт с for: 10m, чтобы он не дребезжал
  • Вычистить высококардинальные лейблы из recording rules
  • Выбрать retention и лимиты ресурсов для самого Prometheus

Примеры запросов агенту

  • Разверни node-exporter DaemonSet в namespace monitoring и покажи, какие метрики с него придут
  • Собери алерт на p95 латентности через histogram_quantile и поставь for: 10m
  • Найди в наших recording rules лейблы с высокой кардинальностью и предложи замену

Как установить prometheus-expert

1Через Skills CLI (Vercel)

npx skills add personamanagmentlayer/pcl --skill prometheus-expert -a claude-code

2Вручную: положить файлы

~/.claude/skills/prometheus-expert/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/prometheus-expert/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о prometheus-expert

Как установить prometheus-expert в Claude Code?

Выполните npx skills add personamanagmentlayer/pcl --skill prometheus-expert -a claude-code. Файл скилла появится в ~/.claude/skills/prometheus-expert/SKILL.md.

Что делает prometheus-expert?

Учит агента работе с Prometheus: сбор метрик, PromQL, recording и alerting rules, установка в Kubernetes. Примеры манифестов и разбор частых ошибок уже внутри.

Что нужно для работы скилла?

Prometheus 2.45 и Kubernetes 1.28 или новее. Из команд агенту разрешены только kubectl и promtool.

Исходный текст

SKILL.md · Apache-2.0
---
name: prometheus-expert
version: 1.1.0
description: >-
  Expert-level Prometheus monitoring, metrics collection, PromQL queries, alerting, and
  production operations. Use when the user mentions monitoring, metrics, observability,
  alerting, or PromQL, or when the task involves Prometheus Architecture, Installation on
  Kubernetes, ServiceMonitor, or PromQL Queries.
category: devops
author: PCL Team
license: Apache-2.0
tags:
  - prometheus
  - monitoring
  - metrics
  - observability
  - alerting
  - promql
allowed-tools:
  - Read
  - Write
  - Edit
  - Bash(kubectl:*, promtool:*)
  - Glob
  - Grep
requirements:
  prometheus: '>=2.45'
  kubernetes: '>=1.28'
---

# Prometheus Expert

You are an expert in Prometheus with deep knowledge of metrics collection, PromQL queries, recording rules, alerting rules, service discovery, and production operations. You design and manage comprehensive observability systems following monitoring best practices.

## Exporters

**Node Exporter (Infrastructure Metrics):**

```yaml
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: node-exporter
  namespace: monitoring
spec:
  selector:
    matchLabels:
      app: node-exporter
  template:
    metadata:
      labels:
        app: node-exporter
    spec:
      hostNetwork: true
      hostPID: true
      containers:
        - name: node-exporter
          image: prom/node-exporter:latest
          ports:
            - containerPort: 9100
              name: metrics
          args:
            - --path.procfs=/host/proc
            - --path.sysfs=/host/sys
            - --collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)
          volumeMounts:
            - name: proc
              mountPath: /host/proc
              readOnly: true
            - name: sys
              mountPath: /host/sys
              readOnly: true
      volumes:
        - name: proc
          hostPath:
            path: /proc
        - name: sys
          hostPath:
            path: /sys
```

**Custom Application Metrics (Go):**

```go
package main

import (
    "net/http"
    "github.com/prometheus/client_golang/prometheus"
    "github.com/prometheus/client_golang/prometheus/promhttp"
)

var (
    httpRequestsTotal = prometheus.NewCounterVec(
        prometheus.CounterOpts{
            Name: "http_requests_total",
            Help: "Total number of HTTP requests",
        },
        []string{"method", "endpoint", "status"},
    )

    httpRequestDuration = prometheus.NewHistogramVec(
        prometheus.HistogramOpts{
            Name: "http_request_duration_seconds",
            Help: "HTTP request duration in seconds",
            Buckets: prometheus.DefBuckets,
        },
        []string{"method", "endpoint"},
    )
)

func init() {
    prometheus.MustRegister(httpRequestsTotal)
    prometheus.MustRegister(httpRequestDuration)
}

func main() {
    http.Handle("/metrics", promhttp.Handler())
    http.ListenAndServe(":9090", nil)
}
```

## Best Practices

### 1. Use Recording Rules for Complex Queries

```yaml
# Pre-compute expensive queries
- record: api:http_requests:rate5m
  expr: sum(rate(http_requests_total[5m])) by (job)
```

### 2. Label Cardinality

```promql
# AVOID: High cardinality labels
http_requests_total{user_id="123"}  # BAD

# USE: Low cardinality labels
http_requests_total{endpoint="/api/users"}  # GOOD
```

### 3. Appropriate Retention

```yaml
# Balance storage vs history
retention: 30d  # Production
retention: 7d   # Development
```

### 4. Alert Fatigue Prevention

```yaml
# Use appropriate thresholds and durations
for: 10m # Avoid flapping
```

### 5. Use Histograms for Latency

```promql
# Better than average
histogram_quantile(0.95, rate(http_request_duration_seconds_bucket[5m]))
```

## Anti-Patterns

**1. Missing Rate Function:**

```promql
# BAD: Raw counter
http_requests_total

# GOOD: Use rate
rate(http_requests_total[5m])
```

**2. Too Many Labels:**

```promql
# BAD: Unique labels per request
{request_id="abc123"}

# GOOD: Aggregate labels
{endpoint="/api/users"}
```

**3. No Resource Limits:**

```yaml
# GOOD: Set limits
resources:
  limits:
    memory: 4Gi
    cpu: 2
```

## Approach

When implementing Prometheus monitoring:

1. **Start with Golden Signals**: Latency, Traffic, Errors, Saturation
2. **Define SLIs/SLOs**: Service Level Indicators and Objectives
3. **Implement Recording Rules**: Pre-compute complex queries
4. **Set Up Alerting**: Alert on symptoms, not causes
5. **Monitor Prometheus**: Prometheus monitoring itself
6. **Retention Strategy**: Balance storage and history
7. **High Availability**: Run multiple Prometheus instances

Always design monitoring that is actionable, reliable, and maintainable.

## Reference Documentation

Detailed material lives alongside this skill and is read on demand:

- [Core Expertise](references/CORE_CONCEPTS.md) — Prometheus Architecture, Installation on Kubernetes, ServiceMonitor (Prometheus Operator), PromQL Queries, Recording Rules, Alerting Rules, Alertmanager Configuration

## Resources

- Prometheus Documentation: https://prometheus.io/docs/
- PromQL Guide: https://prometheus.io/docs/prometheus/latest/querying/basics/
- Prometheus Operator: https://prometheus-operator.dev/
- Best Practices: https://prometheus.io/docs/practices/

© PCL Team · Apache-2.0 · personamanagmentlayer/pcl

Похожие скиллы

Все скиллы по теме «DevOps и инфраструктура» →
prometheus-configuration Seth Hobson Скилл prometheus-configuration для Claude Code настраивает Prometheus для сбора метрик, хранения и мониторинга инфраструктуры и приложений. Настраивает scrape-конфигурации и алерты. CX Codex +1 11 228установок prometheus-monitoring aj-geddes Скилл prometheus-monitoring для настройки Prometheus: конфиг скрейпинга, кастомные метрики приложений, правила алертов и service discovery. CX Codex +1 519установок Prometheus MCP Server pab1it0 Даёт ИИ-помощнику доступ к метрикам Prometheus. Агент сам выполняет PromQL-запросы и разбирает результаты, не выходя из сессии. CX Codex +1 ★ 526звёзд репо monitoring-guidelines Mindrally Скилл monitoring-guidelines задаёт правила мониторинга сервисов и серверов: от сбора четырёх золотых сигналов до алертов по сжиганию бюджета ошибок SLO. CX Codex +1 739установок alibabacloud-cms-alert-rule-create aliyun Скилл alibabacloud-cms-alert-rule-create для Claude Code создаёт и управляет правилами оповещений Alibaba Cloud: CMS 1.0 для облачных ресурсов и CMS 2.0 для Prometheus, APM и UModel. CX Codex +1 288установок prometheus-label-strategy grafana Скилл prometheus-label-strategy помогает спроектировать схему меток Prometheus, оценить кардинальность и убрать лишние лейблы в коде приложения или таргетах сбора до отправки в хранилище. CX Codex +1 4 300установок

Из того же набора104

Весь набор →
devops-expert Скилл devops-expert даёт агенту готовые схемы CI/CD, инфраструктуры как кода и стратегий выкладки, когда в задаче всплывают пайплайны, автоматизация или культура DevOps. CX Codex +1 210установок testing-expert Скилл testing-expert задаёт агенту правила написания тестов: структура AAA, независимые кейсы, моки и граничные случаи. Плюс теория TDD и BDD в справочном файле, который читается по необходимости. CX Codex +1 206установок sre-expert Скилл sre-expert для настройки практик SRE, расчёта SLO и организации процессов инцидент-менеджмента в проекте. CX Codex +1 205установок elasticsearch-expert Скилл elasticsearch-expert помогает проектировать маппинги Elasticsearch, настраивать поисковые запросы, агрегации и оптимизировать работу ELK-стека. CX Codex +1 205установок kotlin-expert Скилл kotlin-expert помогает писать и разбирать Kotlin-код для Android, корутин, JVM и Kotlin Multiplatform. Подключайте его к задачам, где важны идиоматичный синтаксис и архитектура. CX Codex +1 203установок react-expert Скилл react-expert настраивает ИИ-агента на разработку на React 18+ и Next.js: правила типизации в TypeScript, хуки, мемоизацию и тесты на React Testing Library. CX Codex +1 200установок performance-expert Скилл performance-expert помогает профилировать код, искать узкие места в базах данных и настраивать кэширование под высокие нагрузки. CX Codex +1 198установок javascript-expert Скилл javascript-expert для Claude Code задаёт агенту роль опытного JavaScript-разработчика и правила стиля для проектов на ES2024+, Node.js и npm. CX Codex +1 197установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой