This is documentation for the next version of Grafana documentation. For the latest stable release, go to the latest version.
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:
- V2 Resource: The current schema, 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.
- Classic: A non-Kubernetes resource that was the default before Grafana v13.0. It’s been widely used for exporting, importing, and sharing dashboards in the Grafana dashboards collection at grafana.com/dashboards. Dashboards created using this model can be exported using either this model or V2.
Note
Observability as Code works with both versions of the JSON model, but it’s fully compatible with version 2.
Access and update the JSON model
To access the JSON representation of a dashboard:
- Navigate to the dashboard.
- Click Edit in the top-right corner.
- In the toolbar, click the Dashboard options icon.
- In the sidebar, click Settings.
- Go to the JSON Model tab.
- When you’ve finished updating the JSON, click Save changes at the bottom of the tab.
- Click Back to dashboard and Exit edit.
V2 Resource model
For the detailed V2 Resource model schema, refer to the Swagger documentation. You can also reach the Swagger schema documentation from your Grafana Cloud instance at: https://grafana.com/launch/swagger.
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
idfield.
{
"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:
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.
"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.
w1-24 (the width of the dashboard is divided into 24 columns)hIn grid height units, each represents 30 pixels.xThe x position, in same unit asw.yThe y position, in same unit ash.
The grid has a negative gravity that moves panels up if there is empty space above a panel.
timepicker
"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:
templating
The templating field contains an array of template variables with their saved values along with some other metadata, for example:
"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:


