Grafana Cloud Enterprise Open source

Dashboard JSON model

Grafana dashboards are represented as JSON objects that store metadata, panels, variables, and settings.

Different dashboard schema models

There are currently three dashboard JSON schema models:

  • Classic - A non-Kubernetes resource used before the adoption of the Kubernetes API by Grafana in v12.2.0. It’s been widely used for exporting, importing, and sharing dashboards in the Grafana dashboards collection at grafana.com/dashboards.
  • V1 Resource - The Classic dashboard schema formatted as a Kubernetes-style resource. Its spec property contains the Classic model of the schema. This is the default format for API communication after Grafana v12.2.0, which enabled the Kubernetes Platform API as default backend for Grafana dashboards. Dashboards created using the Classic model can be exported using either the Classic or the V1 Resource format.
  • V2 Resource - The latest format, supporting new features such as advanced layouts and conditional rendering. It models all dashboard elements as Kubernetes kinds, following Kubernetes conventions for declaring dashboard components. This format is future-proof and represents the evolving standard for dashboards.

Note

Observability as Code works with all versions of the JSON model, and it’s fully compatible with version 2.

Access and update the JSON model (#view-json)

To access the JSON representation of a dashboard:

  1. Click Edit.
  2. In the sidebar, click the Dashboard options icon.
  3. In the edit pane, click Settings.
  4. Go to the JSON Model tab.
  5. When you’ve finished viewing the JSON, click Back to dashboard and Exit edit.

Classic model

When you create a new dashboard in self-managed Grafana, a new dashboard JSON object was initialized with the following fields:

Note

In the following JSON, id is shown as null which is the default value assigned to it until a dashboard is saved. After a dashboard is saved, an integer value is assigned to the id field.

JSON
{
  "id": null,
  "uid": "cLV5GDCkz",
  "title": "New dashboard",
  "tags": [],
  "timezone": "browser",
  "editable": true,
  "graphTooltip": 1,
  "panels": [],
  "time": {
    "from": "now-6h",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": []
  },
  "templating": {
    "list": []
  },
  "annotations": {
    "list": []
  },
  "refresh": "5s",
  "schemaVersion": 17,
  "version": 0,
  "links": []
}

Each field in the dashboard JSON is explained below with its usage:

NameUsage
idunique numeric identifier for the dashboard. (generated by the db)
uidunique dashboard identifier that can be generated by anyone. string (8-40)
titlecurrent title of dashboard
tagstags associated with dashboard, an array of strings
styletheme of dashboard, i.e. dark or light
timezonetimezone of dashboard, i.e. utc or browser
editablewhether a dashboard is editable or not
graphTooltip0 for no shared crosshair or tooltip (default), 1 for shared crosshair, 2 for shared crosshair AND shared tooltip
timetime range for dashboard, i.e. last 6 hours, last 7 days, etc
timepickertimepicker metadata, see timepicker section for details
templatingtemplating metadata, see templating section for details
annotationsannotations metadata, see annotations for how to add them
refreshauto-refresh interval
schemaVersionversion of the JSON schema (integer), incremented each time a Grafana update brings changes to said schema
versionversion of the dashboard (integer), incremented each time the dashboard is updated
panelspanels array, see below for detail.

Panels

Panels are the building blocks of a dashboard. It consists of data source queries, type of graphs, aliases, etc. Panel JSON consists of an array of JSON objects, each representing a different panel. Most of the fields are common for all panels but some fields depend on the panel type. Following is an example of panel JSON of a text panel.

JSON
"panels": [
  {
    "type": "text",
    "title": "Panel Title",
    "gridPos": {
      "x": 0,
      "y": 0,
      "w": 12,
      "h": 9
    },
    "id": 4,
    "mode": "markdown",
    "content": "# title"
  }

Panel size and position

The gridPos property describes the panel size and position in grid coordinates.

  • w 1-24 (the width of the dashboard is divided into 24 columns)
  • h In grid height units, each represents 30 pixels.
  • x The x position, in same unit as w.
  • y The y position, in same unit as h.

The grid has a negative gravity that moves panels up if there is empty space above a panel.

timepicker

JSON
"timepicker": {
    "collapse": false,
    "enable": true,
    "notice": false,
    "now": true,
    "hidden": false,
    "nowDelay": "",
    "quick_ranges": [
      {
        "display": "Last 6 hours",
        "from": "now-6h",
        "to": "now"
      },
      {
        "display": "Last 7 days",
        "from": "now-7d",
        "to": "now"
      }
    ],
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ],
    "status": "Stable",
    "type": "timepicker"
  }

Usage of the fields is explained below:

NameUsage
collapsewhether timepicker is collapsed or not
enablewhether timepicker is enabled or not
notice
now
hiddenwhether timepicker is hidden or not
nowDelayoverride the now time by entering a time delay. Use this option to accommodate known delays in data aggregation to avoid null values.
quick_rangescustom quick ranges
refresh_intervalsinterval options available in the refresh picker dropdown
status
type

templating

The templating field contains an array of template variables with their saved values along with some other metadata, for example:

JSON
 "templating": {
    "enable": true,
    "list": [
      {
        "allFormat": "wildcard",
        "current": {
          "tags": [],
          "text": "prod",
          "value": "prod"
        },
        "datasource": null,
        "includeAll": true,
        "name": "env",
        "options": [
          {
            "selected": false,
            "text": "All",
            "value": "*"
          },
          {
            "selected": false,
            "text": "stage",
            "value": "stage"
          },
          {
            "selected": false,
            "text": "test",
            "value": "test"
          }
        ],
        "query": "tag_values(cpu.utilization.average,env)",
        "refresh": false,
        "type": "query"
      },
      {
        "allFormat": "wildcard",
        "current": {
          "text": "apache",
          "value": "apache"
        },
        "datasource": null,
        "includeAll": false,
        "multi": false,
        "multiFormat": "glob",
        "name": "app",
        "options": [
          {
            "selected": true,
            "text": "tomcat",
            "value": "tomcat"
          },
          {
            "selected": false,
            "text": "cassandra",
            "value": "cassandra"
          }
        ],
        "query": "tag_values(cpu.utilization.average,app)",
        "refresh": false,
        "regex": "",
        "type": "query"
      }
    ]
  }

Usage of the above mentioned fields in the templating section is explained below:

NameUsage
enablewhether templating is enabled or not
listan array of objects each representing one template variable
allFormatformat to use while fetching all values from data source, eg: wildcard, glob, regex, pipe, etc.
currentshows current selected variable text/value on the dashboard
data sourceshows data source for the variables
includeAllwhether all value option is available or not
multiwhether multiple values can be selected or not from variable value list
multiFormatformat to use while fetching timeseries from data source
namename of variable
optionsarray of variable text/value pairs available for selection on dashboard
querydata source query used to fetch values for a variable
refreshconfigures when to refresh a variable
regexextracts part of a series name or metric node segment
typetype of variable, i.e. custom, query or interval

V1 Resource model

The V1 Resource schema model formats the Classic JSON model schema as a Kubernetes-style resource. The spec property of the schema contains the Classic-style model of the schema.

Dashboards created using the Classic model can be exported using either this model or the Classic one.

The following code snippet shows the fields included in the V1 Resource model.

JSON
{
  "apiVersion": "dashboard.grafana.app/v1beta1",
  "kind": "Dashboard",
  "metadata": {
    "name": "isnt5ss",
    "namespace": "stacks-521104",
    "uid": "92674c0e-0360-4bb4-99ab-fb150581376d",
    "resourceVersion": "1764705030717045",
    "generation": 1,
    "creationTimestamp": "2025-12-02T19:50:30Z",
    "labels": {
      "grafana.app/deprecatedInternalID": "1329"
    },
    "annotations": {
      "grafana.app/createdBy": "user:u000000002",
      "grafana.app/folder": "",
      "grafana.app/saved-from-ui": "Grafana Cloud (instant)"
    }
  },
  "spec": {
    "annotations": {
      "list": [
        {
          "builtIn": 1,
          "datasource": {
            "type": "grafana",
            "uid": "-- Grafana --"
          },
          "enable": true,
          "hide": true,
          "iconColor": "rgba(0, 211, 255, 1)",
          "name": "Annotations & Alerts",
          "type": "dashboard"
        }
      ]
    },
    "editable": true,
    "fiscalYearStartMonth": 0,
    "graphTooltip": 0,
    "id": 1329,
    "links": [],
    "panels": [],
    "preload": false,
    "schemaVersion": 42,
    "tags": [],
    "templating": {
      "list": []
    },
    "time": {
      "from": "now-6h",
      "to": "now"
    },
    "timepicker": {},
    "timezone": "Africa/Abidjan",
    "title": "Graphite suggestions",
    "uid": "isnt5ss",
    "version": 1,
    "weekStart": ""
  },
  "status": {}
}

V2 Resource model

Note

Dashboard JSON schema v2 is currently in public preview. Grafana Labs offers limited support, and breaking changes might occur prior to the feature being made generally available.

For the detailed V2 Resource model schema, refer to the Swagger documentation.