/major-ai-skills:prometheusfrom major-ai-skills
Design Prometheus scrape configs, bounded-label metrics, and alert rules with symptom-first PromQL; avoid cardinality fires and silent relabel collisions agents cause.
Ships in major-ai-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Prometheus pull-scrapes HTTP /metrics endpoints on an interval, appends samples to a local TSDB, evaluates recording/alerting rules, and forwards alerts to Alertmanager for routing/silencing. Grafana queries Prometheus via PromQL. Agents optimize for bounded cardinality, RED/USE signal, and actionable alerts—not “scrape everything every 5s.”
┌─────────────────────────────────────────────────────────────┐
│ Prometheus data path │
│ │
│ Targets (apps, kube-state-metrics, exporters) │
│ ↓ scrape (+ relabel_configs / metric_relabel_configs) │
│ TSDB (local) ← recording rules │
│ ↓ alert rules (for: duration) │
│ Alertmanager → routes / inhibits → on-call │
│ ↑ queries ← Grafana / API │
└─────────────────────────────────────────────────────────────┘
Use when
up==0, high cardinality, or slow PromQL.Do not use when
@opentelemetry, @grafana).labeldrop on distinguishing labels—that silently corrupts series (see matrix).user_id, email, unbounded URL paths, or UUIDs as label values.2xx) before scrape hacks.metric_relabel_configs: safe to drop entire metrics (action: drop on __name__); never labeldrop/replace that merges distinct series (pod, instance, le, quantile).sample_limit, label_limit, label_value_length_limit on noisy jobs; alert on prometheus_target_scrapes_exceeded_sample_limit_total.for: unless expr already windowed; every page links a runbook._seconds buckets aligned to SLOs; avoid default buckets hiding tail latency.prometheus.yml excerpt:
scrape_configs:
- job_name: api
scrape_interval: 30s
metrics_path: /metrics
sample_limit: 10000
static_configs:
- targets: ["api:8080"]
labels:
service: api
env: prod
metric_relabel_configs:
- source_labels: [__name__]
regex: go_.*|process_.*
action: drop
Alert + recording:
groups:
- name: api-slo
rules:
- record: job:api_http_requests:rate5m
expr: sum(rate(http_requests_total{service="api"}[5m])) by (status)
- alert: ApiHighErrorRate
expr: |
sum(rate(http_requests_total{service="api",status=~"5.."}[5m]))
/
sum(rate(http_requests_total{service="api"}[5m]))
> 0.05
for: 10m
labels:
severity: page
annotations:
summary: "API 5xx ratio > 5% for 10m"
runbook_url: "https://wiki.example/runbooks/api-5xx"
PromQL snippets:
histogram_quantile(0.95, sum(rate(http_request_duration_seconds_bucket{service="api"}[5m])) by (le))
sum by (__name__) ({__name__=~".+"}) # cardinality exploration — run offline, not in prod UI habitually
| Signature | Likely cause | Fix |
|---|---|---|
| TSDB memory/CPU spike | High cardinality label | Find label via topk; fix exporter; drop whole metric if emergency |
rate() gaps / nonsense | Counter reset or series collision | Check relabel merges; collision from labeldrop |
up==0 | Scrape fail, timeout, sample_limit | Target logs; increase timeout; fix exporter crash |
| Alerts flapping | Missing for: | Add for: 5m or improve expr window |
| Missing kube pod metrics | wrong SD config | Verify kubernetes_sd role/endpoints |
| Duplicate sample errors | Relabel normalized paths at scrape | Fix at source; never merge /users/123 → /users/:id at scrape |
_total, _seconds, _bytes suffix conventions.@grafana dashboards from recording rules, not raw heavy queries on every refresh.@kubernetes service discovery and pod annotations for scrape.@grafana — dashboards and unified alerting UX@kubernetes — pod/service discovery targets@opentelemetry — modern metric exposition@nginx — upstream latency at edge vs originMANDATORY: Never recommend
labeldropor value-normalizing relabel rules on labels that distinguish series (pod, instance, path, user). Emergency cardinality reduction drops entire metrics or fixes instrumentation. Every page alert includesfor:, severity, and runbook_url. Set sample_limit on untrusted exporters.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub alivirgo/major-ai-skills --plugin major-ai-skills412 skills in this plugin
/3d-slicerAutomate 3D Slicer research workflows with MRML, VTK/ITK, DICOM data, and Segment Editor. Use for software workflows, not clinical interpretation./abbreviated-git-statusInspect Git branch, staging, and working-tree changes with short or porcelain status output when a compact repository check is needed./ableton-liveAutomate Ableton Live sessions with Python MIDI Remote Scripts, Max for Live, AbletonOSC, and Link synchronization.Other plugins' skills for the same job
/act-as-a-personal-tutorExplain a subject step by step, assess prior knowledge, and use short exercises to check understanding before advancing.