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
A dashboard in Grafana is represented by a JSON object, which stores metadata of its dashboard. Dashboard metadata includes dashboard properties, metadata from rows, panels, template variables, panel queries, etc.
To view the JSON of a dashboard, follow the steps mentioned below:
- Go to a dashboard
- Click on
Manage dashboard
menu on the top navigation bar - Select
View JSON
from the dropdown menu
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,
"title": "New dashboard",
"tags": [],
"style": "dark",
"timezone": "browser",
"editable": true,
"hideControls": false,
"graphTooltip": 1,
"rows": [],
"time": {
"from": "now-6h",
"to": "now"
},
"timepicker": {
"time_options": [],
"refresh_intervals": []
},
"templating": {
"list": []
},
"annotations": {
"list": []
},
"schemaVersion": 7,
"version": 0,
"links": []
}
Each field in the dashboard JSON is explained below with its usage:
rows
rows
field consists of an array of JSON object representing each row in a dashboard, such as shown below:
"rows": [
{
"collapse": false,
"editable": true,
"height": "200px",
"panels": [],
"title": "New row"
},
{
"collapse": true,
"editable": true,
"height": "300px",
"panels": [],
"title": "New row"
}
]
Usage of the fields is explained below:
panels
Panels are the building blocks a dashboard. It consists of datasource queries, type of graphs, aliases, etc. Panel JSON consists of an array of JSON objects, each representing a different panel in a row. Most of the fields are common for all panels but some fields depends on the panel type. Following is an example of panel JSON representing a graph
panel type:
Usage of each field is explained below:
timepicker
Description: TODO
Usage of the fields is explained below:
templating
templating
fields contains 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:
annotations
TODO