Skip to content

Commit e746e52

Browse files
authored
Add Share query results docs (grafana#27792)
1 parent d35b78a commit e746e52

File tree

2 files changed

+37
-6
lines changed

2 files changed

+37
-6
lines changed

docs/sources/menu.yaml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@
163163
name: Add panel
164164
- link: /panels/queries/
165165
name: Queries
166+
- link: /panels/share-query-results/
167+
name: Share query results
166168
- link: /panels/transformations/
167169
name: Transformations
168170
children:
@@ -209,12 +211,12 @@
209211
- link: /panels/visualizations/table-panel/
210212
name: Table
211213
children:
212-
- name: Overview
213-
link: /panels/visualizations/table/
214-
- link: /panels/visualizations/table/table-field-options/
215-
name: Table field options
216-
- link: /panels/visualizations/table/filter-table-columns/
217-
name: Filter table columns
214+
- name: Overview
215+
link: /panels/visualizations/table/
216+
- link: /panels/visualizations/table/table-field-options/
217+
name: Table field options
218+
- link: /panels/visualizations/table/filter-table-columns/
219+
name: Filter table columns
218220
- link: /panels/visualizations/text-panel/
219221
name: Text
220222
- link: /panels/thresholds/
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
+++
2+
title = "Share query results"
3+
type = "docs"
4+
[menu.docs]
5+
identifier = "share-query-results"
6+
parent = "panels"
7+
weight = 310
8+
+++
9+
10+
# Share query results between panels
11+
12+
Grafana let you use the query result from one panel for any other panel in the dashboard. Sharing query results across panels reduces the number of queries made to your data source, which can improve the performance of your dashboard.
13+
14+
The Dashboard data source lets you select a panel in your dashboard that contains the queries ‌you want to share the results for. Instead of sending a separate query for each panel, Grafana sends one query and other panels use the query results to construct visualizations.
15+
16+
This strategy can drastically reduce the number of queries being made when you for example have several panels visualizing the same data.
17+
18+
To share data source queries with another panel:
19+
20+
1. [Create a dashboard]({{< relref "../getting-started/getting-started.md#create-a-dashboard" >}}).
21+
1. [Add a panel]({{< relref "add-a-panel.md" >}}) to the dashboard.
22+
1. Change the title to "Source panel". You'll use this panel as a source for the other panels.
23+
Define the [query]({{< relref "queries.md" >}}) or queries that will be shared. If you don't have a data source available at the moment, then you can use the **Grafana** data source, which returns a random time series that you can use for testing.
24+
1. Add a second panel and select the **Dashboard** data source in the query editor.
25+
1. In the **Use results from panel list**, select the first panel you created.
26+
27+
All queries defined in the source panel are now available to the new panel. Queries made in the source panel can be shared with multiple panels.
28+
29+
You can click on any of the queries to go to the panel where they are defined.

0 commit comments

Comments
 (0)