Important: This documentation is about an older version. It's relevant only to the release noted, many of the features and functions have been updated or replaced. Please view the current version.
Dashboard JSON model
Note: Looking for prebuilt Grafana dashboards? Check out our full library of dashboards and more →
A dashboard in Grafana is represented by a JSON object, which stores metadata of its dashboard. Dashboard metadata includes dashboard properties, metadata from panels, template variables, panel queries, etc.
To view the JSON of a dashboard:
- Navigate to a dashboard.
- In the top navigation menu, click the Dashboard settings (gear) icon.
- Click JSON Model.
JSON fields
When a user creates a new dashboard, a new dashboard JSON object is 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. Once a dashboard is saved, an integer value is assigned to the
id
field.
{
"id": null,
"uid": "cLV5GDCkz",
"title": "New dashboard",
"tags": [],
"style": "dark",
"timezone": "browser",
"editable": true,
"hideControls": false,
"graphTooltip": 1,
"panels": [],
"time": {
"from": "now-6h",
"to": "now"
},
"timepicker": {
"time_options": [],
"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.
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 asw
.y
The 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,
"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:
Usage of the above mentioned fields in the templating section is explained below: