grafana/docs/sources/reference/dashboard.md

126 lines
3.3 KiB
Markdown
Raw Normal View History

2015-11-02 15:17:23 +08:00
----
page_title: Dashboard JSON
page_description: Dashboard JSON Reference
page_keywords: grafana, dashboard, json, documentation
---
# Dashboard JSON
## Overview
2015-11-02 15:53:24 +08:00
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.
2015-11-02 15:17:23 +08:00
2015-11-02 15:53:24 +08:00
To view the JSON of a dashboard, follow the steps mentioned below:
2015-11-02 15:17:23 +08:00
2015-11-02 15:53:24 +08:00
1. Go to a dashboard
2. Click on `Manage dashboard` menu on the top navigation bar
3. Select `View JSON` from the dropdown menu
2015-11-02 15:17:23 +08:00
2015-11-02 16:21:59 +08:00
## JSON fields
2015-11-02 15:17:23 +08:00
2015-11-02 15:53:24 +08:00
When a user creates a new dashboard, a new dashboard JSON object is initialized with the following fields:
2015-11-02 16:21:59 +08:00
> 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.
2015-11-02 15:17:23 +08:00
```
{
"id": null,
"title": "New dashboard",
"originalTitle": "New dashboard",
"tags": [],
"style": "dark",
"timezone": "browser",
2015-11-02 15:53:24 +08:00
"editable": true,
2015-11-02 15:17:23 +08:00
"hideControls": false,
"sharedCrosshair": false,
2015-11-02 16:21:59 +08:00
"rows": [],
2015-11-02 15:17:23 +08:00
"time": {
"from": "now-6h",
"to": "now"
},
"timepicker": {
2015-11-02 16:21:59 +08:00
"time_options": [],
"refresh_intervals": []
2015-11-02 15:17:23 +08:00
},
"templating": {
"list": []
},
"annotations": {
"list": []
},
"schemaVersion": 7,
"version": 0,
"links": []
}
```
2015-11-02 15:53:24 +08:00
Each field in the dashboard JSON is explained below with its usage:
| Name | Usage |
| ---- | ----- |
| **id** | unique dashboard id, an integer |
| **title** | current title of dashboard |
| **originalTitle** | title of dashboard when saved for the first time |
2015-11-02 16:21:59 +08:00
| **tags** | tags associated with dashboard, an array of strings |
| **style** | theme of dashboard, i.e. `dark` or `light` |
| **timezone** | timezone of dashboard, i.e. `utc` or `browser` |
2015-11-02 15:53:24 +08:00
| **editable** | whether a dashboard is editable or not |
| **hideControls** | whether row controls on the left in green are hidden or not |
| **sharedCrosshair** | TODO |
2015-11-02 16:21:59 +08:00
| **rows** | row metadata, see [rows section](/dashboard/#rows) for details |
| **time** | time range for dashboard, i.e. last 6 hours, last 7 days, etc |
| **timepicker** | timepicker metadata, see [timepicker section](/dashboard/#timepicker) for details |
| **templating** | templating metadata, see [templating section](/dashboard/#templating) for details |
| **annotations** | annotations metadata, see [annotations section](/dashboard/#annotations) for details |
2015-11-02 15:53:24 +08:00
| **schemaVersion** | TODO |
| **version** | TODO |
| **links** | TODO |
2015-11-02 16:21:59 +08:00
### rows
`rows` field represents 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:
| Name | Usage |
| ---- | ----- |
| **collapse** | whether row is collapsed or not |
| **editable** | whether a row is editable or not |
| **height** | height of the row in pixels |
| **panels** | panels metadata, see [panels section](/dashboard/#panels) for details |
| **title** | title of row |
#### panels
TODO
### timepicker
TODO
### templating
TODO
### annotations
TODO