Grafana Dashboard JSON Stub Builder

Generate a minimal Grafana dashboard JSON with panels and variables

Builds an importable Grafana dashboard JSON stub with a title, time range, auto-refresh, Prometheus datasource UID, template variables, and laid-out time-series, stat, gauge, and table panels each wired to a PromQL query. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

How do I import this JSON into Grafana?

In Grafana open Dashboards, choose Import, and paste the JSON or upload the file. Grafana creates the dashboard immediately; you can then save it to a folder and adjust panels in the visual editor.

A starting-point dashboard you can import in seconds

Building a Grafana dashboard by hand in the UI is fine for one panel and tedious for ten. This builder emits a clean, importable dashboard JSON stub — title, time range, refresh, datasource binding, template variables, and a grid of panels each pre-wired to a PromQL query — so you start from a working layout instead of a blank canvas.

How it works

The tool constructs the JSON Grafana expects on import. The dashboard object carries your title, a null uid (so Grafana assigns a fresh one), a current schemaVersion, a time range, a refresh interval, and a timezone. Each template variable becomes a query-type entry running label_values(<name>) against your Prometheus datasource. Each panel you add gets a sequential id, your chosen panel type (timeseries, stat, gauge, bargauge, or table), a gridPos laid out two-per-row, and a single target holding your PromQL expr. The whole structure is JSON.stringify-formatted in your browser, ready to paste into Dashboards then Import.

Anatomy of the generated JSON

Understanding the key fields in the output helps you edit it confidently after import:

  • uid: null — Grafana generates a unique identifier on import. Set a stable value if you provision dashboards as code (GitOps) so the URL does not change across updates.
  • schemaVersion — Grafana uses this to migrate dashboards from older formats. Leave it at the value the builder emits unless you are targeting a specific Grafana version.
  • templating.list — each variable here creates a dropdown filter. The label_values query populates it from your Prometheus metric labels at load time.
  • gridPos — controls the panel’s position and size on the canvas. The builder uses a two-column layout (width 12, height 8). After import, drag and resize panels in the visual editor.
  • targets[0].expr — the raw PromQL expression. This is where you paste queries like rate(http_requests_total{job="$job"}[5m]), referencing your template variables with $variable syntax.

Choosing panel types

Panel typeBest for
timeseriesRates, counters, latency over time
statSingle current values: uptime, error count, active connections
gaugeValues with a known min/max range: CPU %, disk usage
bargaugeComparing the same metric across multiple instances
tableRaw label sets, inventory data, multi-column breakdowns

Finding your datasource UID

Every Grafana datasource has a stable UID you must supply when building the JSON. Find it in Grafana under Connections → Data sources, click your Prometheus source, and look at the URL — it ends with the UID, for example /connections/datasources/edit/abc123def456. The same string also appears in the datasource settings panel under the name field. Pasting the wrong UID means panels silently show no data after import.

Tips

  • Add instance and job template variables so a single dashboard filters across every scraped target. Reference them in queries with {job="$job", instance="$instance"}.
  • Treat the output as a scaffold: import it, then refine thresholds, units, and legends in Grafana’s visual editor. Setting units (bytes, milliseconds, percent) in the panel options transforms raw numbers into readable displays.
  • For GitOps workflows, store the JSON file in version control and provision it via Grafana’s dashboard provisioning config rather than using the import UI every time.