You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/managed-grafana/how-to-create-dashboard.md
+31-5Lines changed: 31 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,11 @@ A Grafana dashboard contains panels and rows. You can import a Grafana dashboard
25
25
26
26
## Import a Grafana dashboard
27
27
28
-
To quickly create a dashboard, import a dashboard template from the Grafana Labs website and add it to your Managed Grafana workspace.
28
+
To quickly create a dashboard, import an existing dashboard and add it to your Managed Grafana instance. You can do so by importing a dashboard template from Grafana Labs, uploading a JSON file or pasting JSON code.
29
+
30
+
### Import a dashboard from Grafana Labs
31
+
32
+
Import a dashboard template from the Grafana Labs website.
29
33
30
34
1. From the Grafana Labs website, browse through [Grafana dashboards templates](https://grafana.com/grafana/dashboards/?category=azure) and select a dashboard to import.
31
35
1. Select **Copy ID to clipboard**.
@@ -46,18 +50,40 @@ To quickly create a dashboard, import a dashboard template from the Grafana Labs
46
50
47
51
### [Azure CLI](#tab/azure-cli)
48
52
49
-
1. Open a CLI and run the `az login` command.
50
-
1. Run the [az grafana dashboard import](/cli/azure/grafana/dashboard#az-grafana-update)command and replace the placeholders `<AMG-name>`, `<AMG-resource-group>`, and `<dashboard-id>` with the name of the Azure Managed Grafana instance, its resource group, and the dashboard ID you copied earlier.
53
+
1. Run the [az grafana dashboard import](/cli/azure/grafana/dashboard#az-grafana-update) command and replace the placeholders `<AMG-name>`, `<AMG-resource-group>`, and `<dashboard-id>` with the name of the Azure Managed Grafana instance, its resource group, and the dashboard ID you copied earlier.
51
54
52
55
```azurecli
53
56
az grafana dashboard import --name <AMG-name> --resource-group <AMG-resource-group> --definition <dashboard-id>
54
57
```
55
58
56
59
---
57
60
61
+
### Import a JSON dashboard
62
+
63
+
Follow these steps to import a JSON dashboard to Grafana:
64
+
65
+
### [Portal](#tab/azure-portal)
66
+
67
+
1. In the Azure portal, open your Azure Managed Grafana workspace and select the **Endpoint** URL.
68
+
1. Go to **Dashboard > Import**
69
+
- Select **Upload JSON file** and then **Load** to import from a JSON file
70
+
- Paste JSON text in the **Import via panel json** box and select **Load** to use text from your clipboard
71
+
1. Optionally update the dashboard name, folder, unique identifier and data source
72
+
1. Select **Import**
73
+
74
+
### [Azure CLI](#tab/azure-cli)
75
+
76
+
1. Run the [az grafana dashboard import](/cli/azure/grafana/dashboard#az-grafana-update) command and replace the placeholders `<AMG-name>`, `<AMG-resource-group>`, and `<local-path-to-file>` with the name of the Azure Managed Grafana instance, its resource group, and the path to the JSON File on your local machine, ending with `.json`.
77
+
78
+
```azurecli
79
+
az grafana dashboard import --name <AMG-name> --resource-group <AMG-resource-group> --definition @<local-path-to-file>
80
+
```
81
+
82
+
---
83
+
58
84
## Create a new Grafana dashboard
59
85
60
-
If none of the pre-configured dashboards listed on the Grafana Labs website fit your needs, create a new dashboard.
86
+
To create your own new dashboard, follow these steps.
title: Share an Azure Managed Grafana dashboard or panel
3
-
description: Learn how to share a Grafana dashboard with internal and external stakeholders.
3
+
description: Learn how to share a Grafana dashboard with internal and external stakeholders, such as customers or partners.
4
4
author: maud-lv
5
5
ms.author: malev
6
6
ms.service: managed-grafana
@@ -10,12 +10,14 @@ ms.date: 03/01/2023
10
10
11
11
# Share a Grafana dashboard or panel
12
12
13
-
In this guide for Azure Managed Grafana, learn how to share a Grafana dashboard with internal and external stakeholders, whether they are registered in your Azure Active Directory tenant or not.
13
+
In this guide for Azure Managed Grafana, learn how to share a Grafana dashboard or a Grafana panel with internal and external stakeholders, whether they're registered in your Azure Active Directory tenant or not. You can choose to share a dashboard or panel with restricted access, or share it with public access to facilitate collaboration with partners or customers.
14
+
15
+
You can share Grafana visualizations by generating:
14
16
15
-
You can share Grafana panels and dashboards using:
16
17
- A direct link
17
18
- A snapshot
18
19
- An embedded link (for panels only)
20
+
- A library panel (for panels only)
19
21
- An export link (for dashboards only)
20
22
21
23
> [!NOTE]
@@ -44,159 +46,59 @@ Access Grafana dashboard and panel sharing options with the following steps:
44
46
A new window opens, offering various sharing options.
45
47
46
48
> [!TIP]
47
-
> If you update a dashboard or a panel, make sure to save your changes before sharing it so that it contains the latest changes.
49
+
> If you update a dashboard or a panel, make sure to save your changes before sharing it so that it contains your latest changes.
48
50
49
51
### Share a link
50
52
51
-
The **Link** tab lets you create a direct link to a Grafana dashboard or panel. This link can then be accessed by users who have a Grafana viewer permission.
53
+
The **Link** tab lets you create a direct link to a Grafana dashboard or panel.
52
54
53
-
Create a sharable link in one step, by selecting **Copy**, at the bottom of the**Link** tab. Optionally customize sharing with the options below:
55
+
Create a sharable link in one step, by selecting **Copy**, at the bottom of the tab. Optionally customize sharing with the options below:
54
56
55
57
-**Lock time range**: sets the time range of the shared panel or dashboard to the time range currently displayed in your shared panel or dashboard.
56
58
-**Theme**: keep the current theme or choose a dark or a light theme.
57
59
-**Shorten URL**: shortens the sharable link
58
60
59
-
### Share a snapshot publicly
60
-
61
-
The **Snapshot** tab lets you share an interactive dashboard or panel publicly. Sensitive data like queries (metric, template, and annotation) and panel links are removed from the snapshot leaving only the visible metric data and series names embedded in your dashboard.
62
-
63
61
> [!NOTE]
64
-
> Snapshots can be viewed by anyone that has the link and can access the URL.
65
-
66
-
Optionally update the snapshot name, select an expiry date and change the value of the timeout. timeout.
67
-
68
-
### Share a snapshot publicly
69
-
70
-
### [Portal](#tab/azure-portal)
71
-
72
-
1. In the Azure portal, open your Azure Managed Grafana workspace and select the **Endpoint** URL.
73
-
1. In the Grafana portal, go to **Dashboards > New Dashboard**.
74
-
1. Select one of the following options:
75
-
-**Add a new panel**: instantly creates a dashboard from scratch with a first default panel.
76
-
-**Add a new row**: instantly creates a dashboard with a new empty row.
77
-
-**Add a panel from the panel library**: instantly creates a dashboard with an existing reusable panel from another instance you have access to.
78
-
79
-
:::image type="content" source="media/create-dashboard/from-scratch.png" alt-text="Screenshot of the Grafana instance. Create a new dashboard.":::
80
-
81
-
### [Azure CLI](#tab/azure-cli)
82
-
83
-
Run the [az grafana dashboard create](/cli/azure/grafana/dashboard#az-grafana-dashboard-create) command and replace the placeholders `<AMG-name>`, `<AMG-resource-group>`, `<title>`, and `<definition>` with the name of the Azure Managed Grafana instance, its resource group, a title and a definition for the new dashboard. The definition consists of a dashboard model in JSON string, a path or URL to a file with such content.
az grafana dashboard create --name myGrafana --resource-group myResourceGroup --title "My dashboard" --folder folder1 --definition '{
93
-
"dashboard": {
94
-
"annotations": {
95
-
...
96
-
},
97
-
"panels": {
98
-
...
99
-
}
100
-
},
101
-
"message": "Create a new test dashboard"
102
-
}'
103
-
```
104
-
105
-
---
106
-
107
-
## Duplicate a Grafana dashboard
108
-
109
-
Duplicate a Grafana dashboard using your preferred method.
110
-
111
-
### [Portal](#tab/azure-portal)
112
-
113
-
To copy a Grafana dashboard:
114
-
115
-
1. Open an existing dashboard in your Grafana instance
116
-
1. Select **Dashboard settings**
117
-
1. Select **Save as**
118
-
1. Enter a new name and/or a new folder and select **Save**
119
-
120
-
:::image type="content" source="media\create-dashboard\copy-dashboard.png" alt-text="Screenshot of the Grafana instance. Duplicate a dashboard.":::
62
+
> Users must have a Grafana Viewer permission to view shared links.
121
63
122
-
### [Azure CLI](#tab/azure-cli)
64
+
### Share a snapshot
123
65
124
-
1. Run the [az grafana dashboard show](/cli/azure/grafana/dashboard#az-grafana-dashboard-show) command to show the definition of the dashboard you want to duplicate, and copy the output.
66
+
The **Snapshot** tab lets you share an interactive dashboard or panel publicly. Sensitive data like queries (metric, template, and annotation) and panel links are removed from the snapshot, leaving only the visible metric data and series names embedded in your dashboard.
125
67
126
-
```azurecli
127
-
az grafana dashboard show --name <AMG-name> --resource-group <AMG-resource-group> --dashboard <dashboard-UID>
128
-
```
68
+
1. Optionally update the snapshot name, select an expiry date and change the value of the timeout.
69
+
1. Choose to publish the Grafana snapshot:
70
+
- to snapshots.raintank.io to make it accessible publicly to anyone with the link
71
+
- as a local snapshot, to restrict access to users who are registered in your Azure AD tenant
72
+
1.**Copy** the snapshot URL generated by Grafana. Select **Delete snapshot** if you no longer need it.
129
73
130
-
1. Run the [az grafana dashboard create](/cli/azure/grafana/dashboard#az-grafana-dashboard-create) command and replace the placeholders `<AMG-name>`, `<AMG-resource-group>`, `<title>`, and `<dashboard-id>` with your own information. Replace `<definition>` with the output you copied in the previous step, and remove the `uid`and `id`.
az grafana dashboard create --name myGrafana --resource-group myResourceGroup --title "My dashboard" --folder folder1 --definition '{
140
-
"dashboard": {
141
-
"annotations": {
142
-
...
143
-
},
144
-
"panels": {
145
-
...
146
-
}
147
-
},
148
-
"message": "Create a new test dashboard"
149
-
}'
150
-
```
151
-
152
-
---
153
-
154
-
## Edit a dashboard panel
155
-
156
-
Edit a Grafana dashboard panel using your preferred method.
157
-
158
-
### [Portal](#tab/azure-portal)
159
-
160
-
To update a Grafana panel, follow the steps below.
161
-
162
-
1. Review the panel to check if you're satisfied with it or want to make some edits.
163
-
164
-
:::image type="content" source="media/create-dashboard/visualization.png" alt-text="Screenshot of the Grafana instance. Example of visualization.":::
165
-
166
-
1. In the lower part of the page:
167
-
1. **Query** tab:
168
-
1. Review the selected data source. If necessary, select the drop-down list to use another data source.
169
-
1. Update the query. Each data source has a specific query editor that provides different features and capabilities for that type of [data source](https://grafana.com/docs/grafana/v9.1/datasources/#querying).
170
-
1. Select **+ Query** or **+ Expression** to add a new query or expression.
74
+
> [!NOTE]
75
+
> - Snapshots published on snapshots.raintank.io can be viewed by anyone who has the link.
76
+
> - Users must have a Grafana Viewer permission to view snapshots shared locally.
171
77
172
-
:::image type="content" source="media/create-dashboard/edit-query.png" alt-text="Screenshot of the Grafana instance. Queries.":::
78
+
### Share a panel using an embedded link
173
79
174
-
1. **Transform** tab: filter data or queries, and organize or combine data before the data is visualized.
175
-
1. **Alert** tab: set alert rules and notifications.
80
+
The **Embed** tab generates HTML code embedding an iframe with a panel, so that you can include it in another web page. The HTML code is automatically generated. Get it in a single step by selecting **Copy to clipboard** at the bottom of the tab. Optionally customize sharing with the options below:
176
81
177
-
1. At the top of the page:
178
-
1. Toggle **Table view** to display data as a table.
179
-
1. Switch between **Fill** and **Actual** to edit panel size
180
-
1. Select the time icon to update the time range
181
-
1. Select the visualization drop-down menu to choose a visualization type that best supports your use case. Go to [visualization](https://grafana.com/docs/grafana/latest/panels-visualizations/visualizations/) for more information.
82
+
-**Current time range**: transforms the relative time range of the shared panel to an absolute time range, as currently displayed in your shared panel.
83
+
-**Theme**: keep the current theme or choose a dark or a light theme.
84
+
-**Shorten URL**: shortens the sharable link
182
85
183
-
:::image type="content" source="media/create-dashboard/panel-time-visualization-options.png" alt-text="Screenshot of the Grafana instance. Time, visualization and more options.":::
86
+
> [!NOTE]
87
+
> Users must have a Grafana Viewer permission to view embedded links.
184
88
185
-
1. On the right hand side, select the **Panel options** icon to review and update various panel options.
89
+
### Create a library panel
186
90
187
-
## [Azure CLI](#tab/azure-cli)
91
+
The **Library panel**tab lets you create a library panel that can be reused in other Grafana dashboards. Do this in a single step by selecting The **Create library panel** at the bottom of the tab. Optionally update the panel library name and select another folder to save it in.
188
92
189
-
Run the [az grafana dashboard update](/cli/azure/grafana/dashboard#az-grafana-dashboard-update) command and update the Grafana dashboard definition.
93
+
Once you've created a library panel, reuse it in other dashboards of the same Grafana instance by going to **Dashboards > New dashboard > Add panel from panel library**.
190
94
191
-
```azurecli
192
-
az grafana dashboard update --name <AMG-name> --resource-group <AMG-resource-group> --definition <definition>
193
-
```
95
+
### Export a dashboard
194
96
195
-
---
97
+
The **Export** tab lets you export a dashboard in JSON format. Do this by selecting **Save to file** to download the JSON file, or select **View JSON > Copy to Clipboard**.
196
98
197
-
## Next steps
99
+
**Export for sharing externally** is disabled by default. Optionally enable this option to generate JSON code for external stakeholders. The exported dashboard can then be [imported to Grafana](how-to-create-dashboard.md#import-a-json-dashboard).
198
100
199
101
In this how-to guide, you learned how to create a Grafana dashboard. To learn how to manage your data sources, go to:
200
102
201
103
> [!div class="nextstepaction"]
202
-
> [Configure data sources](how-to-data-source-plugins-managed-identity.md)
0 commit comments