PluginBench
Skill
Fail
Audit score 45

dashboarding

grafana/skills

Create and modify Grafana dashboards with panels, variables, transformations, and alerting.

What is dashboarding?

Build reusable Grafana dashboards programmatically using JSON. This skill handles dashboard structure, panel types, template variables, transformations, thresholds, annotations, and dashboard linking. Use it when you need to create dashboards, add panels, configure metrics, or export dashboard JSON.

  • Create dashboards with configurable time ranges, refresh intervals, and timezone settings
  • Add and configure panel types (time series, stat, gauge, table, heatmap, logs, traces, and more)
  • Define template variables (query, constant, datasource) to make dashboards reusable across environments
  • Apply transformations to reshape data client-side (merge, organize, calculate fields, filter, sort)
  • Configure thresholds and field options (units, colors, legends, tooltips)
  • Set up dashboard and panel linking with variable interpolation

How to install dashboarding

npx skills add https://github.com/grafana/skills --skill dashboarding
Claude Code
Cursor
Windsurf
Cline

How to use dashboarding

  1. 1.Define your dashboard JSON with title, uid, time range, and refresh settings
  2. 2.Choose appropriate panel types for your metrics (time series for trends, stat for current values, table for multi-column data)
  3. 3.Add data source queries (Prometheus, Loki, Tempo) with metric expressions or log queries
  4. 4.Configure template variables to parameterize dashboards (job, namespace, service names)
  5. 5.Apply transformations to reshape data if needed (merge series, calculate derived fields, filter rows)
  6. 6.Set thresholds and units to highlight anomalies and improve readability
  7. 7.Add dashboard links and annotations to connect related dashboards and overlay events
  8. 8.Export the dashboard JSON and POST it to the Grafana API or import via the UI

Use cases

Good for
  • Create a service monitoring dashboard with request rate, error rate, and latency panels
  • Build a multi-environment dashboard using template variables to switch between staging and production
  • Add a table panel showing top services by RPS with calculated error percentage
  • Set up dashboard linking so clicking a service name navigates to its detail dashboard
  • Overlay deployment annotations on a time series to correlate incidents with releases
Who it's for
  • DevOps engineers building monitoring dashboards
  • SREs creating runbook-linked observability dashboards
  • Platform teams standardizing dashboard templates across services
  • Developers automating dashboard creation via API or agent tools

dashboarding FAQ

What panel type should I use for metrics over time?

Use 'time series' for any metric over time—it's the default choice for counters, rates, and gauges. Use 'stat' for a single current value with optional sparkline, 'gauge' for percentages against min/max, and 'table' for multi-column data.

How do I make a dashboard work across multiple environments?

Use template variables (query, constant, or datasource type) and reference them in your queries with $variable syntax. For example, rate(http_requests_total{job="$job"}[5m]) will adapt when the user selects a different job.

Can I calculate new fields from existing metrics?

Yes, use the 'calculateField' transformation to derive new columns. For example, divide 'errors' by 'total' to compute error percentage, or use 'filterByValue' to show only rows exceeding a threshold.

How do I link dashboards together?

Add a 'links' section to your dashboard or panel JSON with a URL and optional variable interpolation. Use ${__field.labels.service} to pass label values, or ${__url.params} to forward current URL parameters.

What's the difference between annotations and thresholds?

Thresholds color-code values based on ranges (green/yellow/red). Annotations overlay events (deployments, incidents) as vertical lines or markers on time series panels, queried from Loki or Prometheus.

Full instructions (SKILL.md)

Source of truth, from grafana/skills.


name: dashboarding license: Apache-2.0 description: Create, modify, and organise Grafana dashboards including panels, variables, transformations, and alerting. Use when the user asks to create a Grafana dashboard, add a panel, configure a time series or stat panel, add template variables, set up dashboard linking, use transformations, configure thresholds, build a dashboard for a service, or export dashboard JSON. Triggers on phrases like "create dashboard", "add panel", "time series panel", "Grafana dashboard JSON", "template variables", "dashboard variable", "panel transformation", "threshold", "stat panel", "table panel", "Grafana annotations", or "dashboard folder".

Grafana Dashboard Authoring

Dashboards are JSON documents stored in Grafana. Every dashboard has panels, variables, time range, and refresh settings. Understanding the JSON schema lets you programmatically create and modify dashboards via the API or Grafana Assistant tools.


Dashboard JSON structure

{
  "title": "My Dashboard",
  "uid": "my-dashboard-v1",
  "tags": ["service", "production"],
  "time": { "from": "now-1h", "to": "now" },
  "refresh": "30s",
  "timezone": "browser",
  "schemaVersion": 41,
  "templating": { "list": [] },
  "annotations": { "list": [] },
  "panels": []
}

Key fields:

  • uid - stable identifier used in URLs and API calls; keep it short and meaningful
  • schemaVersion - use 41 for Grafana 11+
  • time.from / to - supports relative (now-1h, now-7d) and absolute ISO timestamps
  • refresh - auto-refresh interval ("30s", "1m", "5m", "" for off)

Panel types and when to use them

PanelUse case
Time seriesAny metric over time; the default choice for counters, rates, gauges
StatSingle current value with optional sparkline (e.g. uptime, current RPS)
GaugePercent or value against a min/max (e.g. disk usage %)
Bar gaugeCompare multiple values side by side (e.g. top 10 services by RPS)
TableMulti-column data (e.g. alert list with labels)
HeatmapDistribution over time (e.g. request duration histogram)
LogsLoki log streams
TracesTempo trace search
TextMarkdown documentation panels
CandlestickOHLC/financial data (or min/max/avg patterns)
Node graphService dependency graphs

Panel JSON structure

{
  "id": 1,
  "type": "timeseries",
  "title": "Request Rate",
  "gridPos": { "x": 0, "y": 0, "w": 12, "h": 8 },
  "datasource": { "type": "prometheus", "uid": "${datasource}" },
  "targets": [
    {
      "expr": "sum(rate(http_requests_total{job=\"$job\"}[5m])) by (status_code)",
      "legendFormat": "{{status_code}}",
      "refId": "A"
    }
  ],
  "fieldConfig": {
    "defaults": {
      "unit": "reqps",
      "thresholds": {
        "mode": "absolute",
        "steps": [
          { "color": "green", "value": null },
          { "color": "yellow", "value": 1000 },
          { "color": "red", "value": 5000 }
        ]
      }
    },
    "overrides": []
  },
  "options": {
    "legend": { "calcs": ["mean", "max", "last"], "displayMode": "table", "placement": "bottom" },
    "tooltip": { "mode": "multi", "sort": "desc" }
  }
}

gridPos: The dashboard uses a 24-column grid. Common widths: full-width=24, half=12, third=8, quarter=6. Height in grid units (1 unit ≈ 30px).


Useful unit identifiers

# Rates
"reqps"      -- requests per second
"ops"        -- operations per second
"Bps"        -- bytes per second
"percentunit" -- 0.0-1.0 as percentage

# Storage
"bytes"      -- bytes (auto-scales to KB/MB/GB)
"decbytes"   -- decimal bytes (1 KB = 1000 B)

# Time
"ms"         -- milliseconds
"s"          -- seconds
"dtdurationms" -- duration in ms (shows as "1h 2m 3s")

# Counts
"short"      -- compact number (1.2k, 3.4M)
"none"       -- raw number

Full list: Panel > Field > Unit dropdown in Grafana UI, or the units reference.


Template variables

Variables make dashboards reusable across environments and services.

Query variable (populates from metric labels):

{
  "name": "job",
  "type": "query",
  "datasource": { "type": "prometheus", "uid": "prometheus" },
  "query": { "query": "label_values(up, job)", "refId": "A" },
  "refresh": 2,
  "includeAll": true,
  "multi": true,
  "label": "Service"
}

Constant variable:

{
  "name": "cluster",
  "type": "constant",
  "query": "production",
  "label": "Cluster"
}

Datasource variable (switch data sources without editing queries):

{
  "name": "datasource",
  "type": "datasource",
  "pluginId": "prometheus",
  "includeAll": false,
  "label": "Prometheus"
}

Use variables in queries:

# Reference a variable in a PromQL query
rate(http_requests_total{job=~"$job"}[5m])

# Multi-value variable uses regex OR automatically
# When $job = ["api", "worker"], it becomes job=~"api|worker"

Chain variables (second variable filters based on first):

{
  "name": "pod",
  "query": "label_values(kube_pod_info{namespace=\"$namespace\"}, pod)"
}

Transformations

Transformations run client-side after data is fetched, reshaping results without changing queries.

Common transformations:

"transformations": [
  {
    "id": "merge",
    "options": {}
  },
  {
    "id": "organize",
    "options": {
      "renameByName": { "Value #A": "Request Rate", "Value #B": "Error Rate" },
      "excludeByName": { "Time": true }
    }
  },
  {
    "id": "calculateField",
    "options": {
      "alias": "Error %",
      "mode": "reduceRow",
      "reduce": { "reducer": "last" },
      "binary": {
        "left": "errors",
        "right": "total",
        "operator": "/"
      }
    }
  },
  {
    "id": "filterByValue",
    "options": {
      "filters": [{ "fieldName": "Error %", "config": { "id": "greater", "options": { "value": 0.01 } } }],
      "type": "include",
      "match": "any"
    }
  }
]

Key transformation IDs: merge, organize, rename, calculateField, filterByValue, groupBy, sortBy, limit, labelsToFields, seriesToRows, partitionByValues.


Dashboard linking

Panel link (click a panel to go somewhere):

"links": [
  {
    "title": "Go to details",
    "url": "/d/details-dashboard?var-service=${__field.labels.service}",
    "targetBlank": false
  }
]

Dashboard link (top-right corner links):

"links": [
  {
    "title": "Runbook",
    "url": "https://wiki.example.com/runbook/${job}",
    "icon": "external link",
    "targetBlank": true,
    "type": "link"
  }
]

Built-in variables for links:

  • ${__value.raw} - current data point value
  • ${__field.labels.job} - label value from current series
  • ${__url.params} - current URL query parameters (pass-through)
  • ${__from} / ${__to} - current time range as Unix ms

Annotations

Show events overlaid on time series panels (deployments, incidents, etc.).

Query annotation from Loki:

{
  "datasource": { "type": "loki", "uid": "loki" },
  "expr": "{job=\"deployments\"} |= \"deployed\"",
  "name": "Deployments",
  "iconColor": "blue",
  "titleFormat": "{{service}} deployed",
  "textFormat": "{{version}} by {{author}}"
}

Query annotation from Prometheus:

{
  "datasource": { "type": "prometheus", "uid": "prometheus" },
  "expr": "changes(kube_deployment_status_observed_generation{namespace=\"production\"}[5m]) > 0",
  "step": "60s",
  "name": "Deployments",
  "iconColor": "blue",
  "titleFormat": "Deploy: {{deployment}}"
}

Dashboard via API

# Create or update a dashboard
curl -s -X POST \
  -H "Authorization: Bearer <API_KEY>" \
  -H "Content-Type: application/json" \
  "https://myorg.grafana.net/api/dashboards/db" \
  -d '{
    "dashboard": { <dashboard JSON> },
    "folderUid": "my-folder",
    "overwrite": true,
    "message": "Updated via API"
  }'

# Get a dashboard by UID
curl -s -H "Authorization: Bearer <API_KEY>" \
  "https://myorg.grafana.net/api/dashboards/uid/my-dashboard-v1" | jq '.dashboard'

# Search dashboards
curl -s -H "Authorization: Bearer <API_KEY>" \
  "https://myorg.grafana.net/api/search?query=kubernetes&type=dash-db" | \
  jq '.[] | {uid, title, folderTitle}'

# Create a folder
curl -s -X POST \
  -H "Authorization: Bearer <API_KEY>" \
  -H "Content-Type: application/json" \
  "https://myorg.grafana.net/api/folders" \
  -d '{"uid": "platform-team", "title": "Platform Team"}'

Grafana scenes (app plugins)

For dashboards embedded in app plugins, use @grafana/scenes instead of raw JSON. See the grafana-o11y:grafana-scenes skill for the React-based scenes API.


References