Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Expert skill for Prometheus metrics and Grafana dashboards. Write and validate PromQL queries, generate Grafana dashboard JSON, create alerting and recording rules, analyze metric cardinality, and debug scrape configurations.
.claude/skills/a5c-ai-prometheus-grafana/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-09 | ✗→✓ | ▲ Improved | 148% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 416% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 208% | 0% |
| case-19 | ✗→✓ | ▲ Improved | 142% | 0% |
| case-21 | ✓→✗ | ▼ Worse | 158% | 0% |
You are prometheus-grafana - a specialized skill for Prometheus metrics and Grafana dashboards. This skill provides expert capabilities for building and maintaining observability infrastructure.
This skill enables AI-powered observability operations including:
Write and optimize PromQL queries:
promql# Request rate rate(http_requests_total{job="api"}[5m]) # Error rate percentage sum(rate(http_requests_total{status=~"5.."}[5m])) / sum(rate(http_requests_total[5m])) * 100 # P99 latency histogram_quantile(0.99, sum(rate(http_request_duration_seconds_bucket[5m])) by (le, service) ) # Availability (SLI) sum(rate(http_requests_total{status!~"5.."}[30d])) / sum(rate(http_requests_total[30d])) * 100 # Resource saturation avg(rate(container_cpu_usage_seconds_total[5m])) / avg(kube_pod_container_resource_limits{resource="cpu"}) * 100
Create recording rules for performance optimization:
yamlgroups: - name: api_metrics interval: 30s rules: - record: job:http_requests:rate5m expr: sum(rate(http_requests_total[5m])) by (job) - record: job:http_errors:rate5m expr: sum(rate(http_requests_total{status=~"5.."}[5m])) by (job) - record: job:http_error_ratio:rate5m expr: | job:http_errors:rate5m / job:http_requests:rate5m - name: slo_metrics interval: 1m rules: - record: slo:availability:ratio_30d expr: | sum(rate(http_requests_total{status!~"5.."}[30d])) / sum(rate(http_requests_total[30d]))
Create comprehensive alerting rules:
yamlgroups: - name: service_alerts rules: - alert: HighErrorRate expr: | job:http_error_ratio:rate5m > 0.05 for: 5m labels: severity: critical annotations: summary: "High error rate detected" description: "{{ $labels.job }} has error rate of {{ $value | humanizePercentage }}" runbook_url: "https://wiki.example.com/runbooks/high-error-rate" - alert: ServiceDown expr: up{job="api"} == 0 for: 1m labels: severity: critical annotations: summary: "Service is down" description: "{{ $labels.instance }} is unreachable" - alert: HighLatencyP99 expr: | histogram_quantile(0.99, sum(rate(http_request_duration_seconds_bucket[5m])) by (le, service) ) > 2 for: 10m labels: severity: warning annotations: summary: "High P99 latency" description: "P99 latency for {{ $labels.service }} is {{ $value }}s"
Generate Grafana dashboard JSON:
json{ "dashboard": { "title": "Service Overview", "uid": "service-overview", "tags": ["production", "api"], "timezone": "browser", "refresh": "30s", "time": { "from": "now-6h", "to": "now" }, "panels": [ { "title": "Request Rate", "type": "timeseries", "gridPos": { "h": 8, "w": 12, "x": 0, "y": 0 }, "targets": [ { "expr": "sum(rate(http_requests_total{job=\"api\"}[5m])) by (status)", "legendFormat": "{{ status }}" } ], "fieldConfig": { "defaults": { "unit": "reqps" } } }, { "title": "Error Rate", "type": "stat", "gridPos": { "h": 4, "w": 6, "x": 12, "y": 0 }, "targets": [ { "expr": "sum(rate(http_requests_total{status=~\"5..\"}[5m])) / sum(rate(http_requests_total[5m])) * 100" } ], "fieldConfig": { "defaults": { "unit": "percent", "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "yellow", "value": 1 }, { "color": "red", "value": 5 } ] } } } } ] } }
Debug and generate scrape configurations:
yamlscrape_configs: - job_name: 'kubernetes-pods' kubernetes_sd_configs: - role: pod relabel_configs: - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape] action: keep regex: true - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_path] action: replace target_label: __metrics_path__ regex: (.+) - source_labels: [__address__, __meta_kubernetes_pod_annotation_prometheus_io_port] action: replace regex: ([^:]+)(?::\d+)?;(\d+) replacement: $1:$2 target_label: __address__
Analyze and optimize metric cardinality:
promql# Top metrics by cardinality topk(10, count by (__name__)({__name__=~".+"})) # Label value counts count(count by (label_name) (metric_name)) # Memory usage by metric prometheus_tsdb_head_series / prometheus_tsdb_head_chunks
This skill can leverage the following MCP servers:
| Server | Description | Installation | |--------|-------------|--------------| | mcp-grafana (Grafana Labs) | Official Grafana MCP server | GitHub | | loki-mcp (Grafana) | Loki log integration | GitHub |
This skill integrates with the following processes:
monitoring-setup.js - Initial Prometheus/Grafana setupslo-sli-tracking.js - SLO/SLI dashboard creationerror-budget-management.js - Error budget dashboardsWhen executing operations, provide structured output:
json{ "operation": "create-dashboard", "status": "success", "dashboard": { "uid": "service-overview", "url": "https://grafana.example.com/d/service-overview" }, "validation": { "queries": "valid", "panels": 8, "warnings": [] }, "artifacts": ["dashboard.json"] }
| Error | Cause | Resolution | |-------|-------|------------| | No data | Metric not scraped | Check scrape config and targets | | Many-to-many matching | Ambiguous join | Use on() or ignoring() | | Query timeout | Complex query | Use recording rules | | Cardinality explosion | Unbounded labels | Add label constraints |
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-03 | fail→fail | 15,808 | 11,726 | -26% | 1 | 1 | 0% | 3,024 | 4,635 | +53% | 0 | 0 | — |
case-01 | fail→fail | 27,411 | 27,154 | -1% | 1 | 1 | 0% | 6,494 | 6,678 | +3% | 0 | 0 | — |
case-02 | fail→fail | 20,475 | 14,244 | -30% | 1 | 1 | 0% | 2,975 | 5,038 | +69% | 0 | 0 | — |
case-04 | fail→fail | 13,993 | 19,290 | +38% | 1 | 1 | 0% | 3,242 | 6,188 | +91% | 0 | 0 | — |
case-05 | fail→fail | 15,058 | 18,851 | +25% | 1 | 1 | 0% | 2,223 | 5,346 | +140% | 0 | 0 | — |
case-06 | pass→pass | 8,141 | 7,353 | -10% | 1 | 1 | 0% | 1,581 | 3,334 | +111% | 0 | 0 | — |
case-07 | pass→pass | 8,130 | 4,833 | -41% | 1 | 1 | 0% | 1,256 | 3,205 | +155% | 0 | 0 | — |
case-08 | fail→fail | 13,025 | 8,369 | -36% | 1 | 1 | 0% | 1,926 | 3,930 | +104% | 0 | 0 | — |
case-09 | fail→pass | 8,818 | 6,848 | -22% | 1 | 1 | 0% | 1,330 | 3,299 | +148% | 0 | 0 | — |
case-10 | fail→fail | 12,753 | 9,169 | -28% | 1 | 1 | 0% | 2,375 | 3,695 | +56% | 0 | 0 | — |
case-11 | fail→pass | 4,067 | 3,430 | -16% | 1 | 1 | 0% | 574 | 2,960 | +416% | 0 | 0 | — |
case-12 | fail→pass | 8,284 | 9,227 | +11% | 1 | 1 | 0% | 1,174 | 3,615 | +208% | 0 | 0 | — |
case-13 | pass→pass | 5,703 | 8,934 | +57% | 1 | 1 | 0% | 1,119 | 3,643 | +226% | 0 | 0 | — |
case-14 | pass→pass | 7,748 | 7,257 | -6% | 1 | 1 | 0% | 1,696 | 3,709 | +119% | 0 | 0 | — |
case-15 | pass→pass | 10,209 | 7,554 | -26% | 1 | 1 | 0% | 2,047 | 3,880 | +90% | 0 | 0 | — |
case-16 | pass→pass | 10,664 | 6,266 | -41% | 1 | 1 | 0% | 1,741 | 3,617 | +108% | 0 | 0 | — |
case-17 | pass→pass | 9,765 | 4,881 | -50% | 1 | 1 | 0% | 1,346 | 3,068 | +128% | 0 | 0 | — |
case-18 | pass→pass | 14,630 | 12,456 | -15% | 1 | 1 | 0% | 2,382 | 4,055 | +70% | 0 | 0 | — |
case-19 | fail→pass | 14,381 | 13,347 | -7% | 1 | 1 | 0% | 2,026 | 4,894 | +142% | 0 | 0 | — |
case-25 | pass→pass | 7,750 | 6,492 | -16% | 1 | 1 | 0% | 1,217 | 3,152 | +159% | 0 | 0 | — |
case-20 | pass→pass | 13,369 | 11,161 | -17% | 1 | 1 | 0% | 2,008 | 4,400 | +119% | 0 | 0 | — |
case-21 | pass→fail | 9,630 | 23,511 | +144% | 1 | 1 | 0% | 1,538 | 3,968 | +158% | 0 | 0 | — |
case-22 | pass→pass | 18,076 | 18,203 | +1% | 1 | 1 | 0% | 2,905 | 4,998 | +72% | 0 | 0 | — |
case-23 | pass→pass | 15,355 | 12,402 | -19% | 1 | 1 | 0% | 2,233 | 4,391 | +97% | 0 | 0 | — |
case-24 | pass→pass | 8,862 | 1,947 | -78% | 1 | 1 | 0% | 1,284 | 2,603 | +103% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 25 cases were attempted. The headline lift of +12 percentage points is the difference between those two pass rates over the 25 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.