agentsclimarketplace

Grafana patterns

Skill Mattakushi432/Claude-Code-Skills-Custom-DevTools-Pack/plugins/devtools-pack/skills/grafana-patterns

A curated pack of custom Claude Code skills for developers — installable as a Claude Code plugin marketplace.

Install
npx -y skills add Mattakushi432/Claude-Code-Skills-Custom-DevTools-Pack --skill grafana-patterns

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

When to activate: Grafana, dashboard, panel, variable, annotation, alert, data source, provisioning, Loki, tempo

SKILL.md

3.6 KB, 881 tokens by cl100k_base, as published. Nobody here has run it

Grafana Patterns

Dashboard Provisioning (as code)

# grafana/provisioning/dashboards/myapp.yaml
apiVersion: 1
providers:
  - name: myapp
    type: file
    updateIntervalSeconds: 30
    options:
      path: /var/lib/grafana/dashboards
      foldersFromFilesStructure: true

Dashboard JSON Structure (key fields)

{
  "title": "MyApp Overview",
  "uid": "myapp-overview",
  "refresh": "30s",
  "time": { "from": "now-1h", "to": "now" },
  "templating": {
    "list": [
      {
        "name": "namespace",
        "type": "query",
        "query": "label_values(kube_pod_info, namespace)",
        "refresh": 2
      },
      {
        "name": "service",
        "type": "query",
        "query": "label_values(http_requests_total{namespace=\"$namespace\"}, service)"
      }
    ]
  },
  "panels": []
}

Standard Row Layout (Four Golden Signals)

Row 1: Traffic
  - Stat: Total RPS
  - Time series: RPS by endpoint

Row 2: Errors
  - Stat: Error rate %
  - Time series: Error rate over time
  - Table: Top erroring endpoints

Row 3: Latency
  - Stat: p99 latency
  - Time series: p50 / p95 / p99

Row 4: Saturation
  - Gauge: CPU utilization
  - Gauge: Memory utilization
  - Time series: Pod count / HPA status

Common Panel Queries

# RPS Stat panel
sum(rate(http_requests_total{namespace="$namespace", service="$service"}[5m]))

# Error rate Time series
100 * sum(rate(http_requests_total{namespace="$namespace",status=~"5.."}[5m]))
    / sum(rate(http_requests_total{namespace="$namespace"}[5m]))

# p99 latency
histogram_quantile(0.99,
  sum(rate(http_request_duration_seconds_bucket{namespace="$namespace"}[5m])) by (le)
)

# Memory usage %
100 * container_memory_working_set_bytes{namespace="$namespace"}
    / container_spec_memory_limit_bytes{namespace="$namespace"}

Grafana Alerting Rule

apiVersion: 1
groups:
  - orgId: 1
    name: MyApp SLO
    folder: MyApp
    interval: 1m
    rules:
      - uid: myapp-error-rate
        title: High Error Rate
        condition: C
        data:
          - refId: A
            queryType: ''
            relativeTimeRange: { from: 600, to: 0 }
            datasourceUid: prometheus
            model:
              expr: |
                sum(rate(http_requests_total{status=~"5.."}[5m]))
                / sum(rate(http_requests_total[5m]))
          - refId: C
            datasourceUid: __expr__
            model:
              type: threshold
              conditions:
                - evaluator: { params: [0.01], type: gt }
                  query: { params: [A] }
        noDataState: OK
        execErrState: Alerting
        for: 5m
        labels:
          severity: critical
        annotations:
          summary: "Error rate above 1%"

Loki Log Panel Query

{namespace="prod", pod=~"myapp-.*"} 
  | json 
  | level = "error" 
  | line_format "{{.message}} trace={{.trace_id}}"

Key Rules

  • Use dashboard UIDs for stable linking between dashboards
  • Template variables make dashboards reusable across namespaces/services
  • Provision dashboards as code — never rely on manual UI-only dashboards
  • Use $__rate_interval instead of a hardcoded [5m] — adapts to scrape interval
  • Link panels to runbooks via panel links for faster incident response

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.