Skip to content

Commit 7d3e337

Browse files
estherk15rtrieu
andauthored
Add groupby template variables options (#30834)
* Add groupby template variables options * Apply suggestions from code review Co-authored-by: Rosa Trieu <[email protected]> * Apply suggestions from code review --------- Co-authored-by: Rosa Trieu <[email protected]>
1 parent 9b7b40e commit 7d3e337

File tree

2 files changed

+22
-14
lines changed

2 files changed

+22
-14
lines changed

content/en/dashboards/template_variables.md

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ further_reading:
2727

2828
## Overview
2929

30-
Template variables allow you to dynamically filter one or more widgets in a dashboard. You can build saved views from your template variable selections to organize and navigate your visualizations through the dropdown selections.
30+
Template variables allow you to dynamically filter or group widgets in a dashboard. You can build saved views from your template variable selections to organize and navigate your visualizations through the dropdown selections.
3131

3232
A template variable is defined by:
3333

@@ -41,20 +41,28 @@ A template variable is defined by:
4141
**Note**: If you do not see the tag or attribute you're looking for, it may be because that data hasn't been reported to Datadog recently. For more information, see [Historical Data][4].
4242

4343
## Add a template variable
44+
If template variables are already defined, see [Edit a template variable](#edit-a-template-variable). If your dashboard does not have any template variables, you can click the question mark icon to open a help modal on how to use Dashboard Variables.
45+
46+
{{< img src="/dashboards/template_variables/template_variable_menu.png" alt="Template variable menu showing the Configure Dropdown Values option" style="width:80%;" >}}
4447

4548
To add a template variable in a dashboard:
46-
1. Click **Add Variables**.
47-
1. If template variables are already defined, hover over the dashboard header and click the **Edit** button to enter edit mode.
48-
1. In edit mode, click the **+ (plus)** icon to create a new template variable.
49+
1. Click **Add Variable**.
50+
1. You can add both **Filter** and **Group by** variable types.
51+
1. Filter: Add a tag or attribute to filter dashboard queries and visualizations.
52+
1. Group by: Add a tag or attribute to show a breakdown of groups within your data.
4953
1. (Optional) After selecting a tag, click the **+ Configure Dropdown Values** button to rename the variable and set default or available values.
50-
{{< img src="dashboards/template_variables/add_template_variable_configure_dropdown_values.png" alt="Add Variable popover showing the Configure Dropdown Values button" style="width:80%;" >}}
54+
1. Click **Save**.
55+
1. To add more template variables, see [Edit a template variable](#edit-a-template-variable)
56+
5157

5258
## Edit a template variable
5359

54-
To edit a template variable in a dashboard:
55-
1. Click the **Edit** button in the dashboard header.
60+
To edit a template variable or add variables:
61+
1. Hover over the dashboard header and click the **Edit** button.
5662
1. In edit mode, click on a template variable and make changes in the popover.
5763
1. To rearrange variables in the header, hover over a variable, then click and drag the drag icon handle.
64+
1. Click the **+ (plus)** icon to add a new template variable.
65+
1. (Optional) After selecting a tag, click the **+ Configure Dropdown Values** button to rename the variable and set default or available values.
5866
{{< img src="dashboards/template_variables/edit_template_variable_drag.png" alt="Template variable edit mode popover showing the drag icon allowing you to rearrange the order" style="width:100%;" >}}
5967

6068
## Apply a template variable to widgets
@@ -75,31 +83,31 @@ To add a template variable to widget queries:
7583
### Create
7684

7785
1. Click on the **Saved Views** dropdown menu to the left of the template variables in your dashboard. When you update a template variable value, the value does not automatically save to a view.
78-
1. To save your current template variables' values in a view, select **Save selections as view** from the **Saved Views** dropdown menu.
86+
1. To save your current template variables' values in a view, select **Save selections as view** from the **Saved Views** dropdown menu.
7987
1. Enter a unique name for the view with an optional description.
80-
1. Click **Save**.
88+
1. Click **Save**.
8189

8290
{{< img src="/dashboards/template_variables/saved_view_create.png" alt="Create saved views by selecting save selections as view" style="width:100%;" >}}
8391

8492
Your saved view appears in the dropdown menu. Click on the view to retrieve your previously saved template variable values.
8593

8694
### Delete
8795

88-
1. Click on the saved views dropdown menu and hover over the desired saved view.
96+
1. Click on the saved views dropdown menu and hover over the desired saved view.
8997
1. Click **Delete View**.
9098

9199
### Modify
92100

93101
The **Default view** can only be edited by changing the default values of the template variables. To edit the Default View:
94102
1. Hover over the templates.
95-
1. Click **Edit** when the button appears.
103+
1. Click **Edit** when the button appears.
96104
1. Click **Done** to save.
97105

98106
To modify template variables values for other saved views:
99107
1. Select the desired saved view from the dropdown menu.
100108
1. Edit the template variables to have the new desired models.
101109
1. Open the dropdown menu again.
102-
1. Click **Save Changes**.
110+
1. Click **Save Changes**.
103111

104112
{{< img src="/dashboards/template_variables/saved_views_update_template_variable.png" alt="Modify the template variables of your saved views" style="width:100%;" >}}
105113

@@ -111,7 +119,7 @@ To edit the title and description:
111119

112120
## Usage
113121

114-
Template variables are used in widgets and event overlays.
122+
Template variables are used in widgets and event overlays.
115123

116124
### Logs, APM, and RUM queries
117125

@@ -123,7 +131,7 @@ On log, APM, and RUM widgets, you can use wildcards in the middle of a value (fo
123131

124132
### Widgets
125133

126-
When creating or editing a widget, existing template variables display as options in the `from` field. For example, if you configure the `environment` template variable, the `$environment` option is available as a dynamic variable in the widget.
134+
When creating or editing a widget, existing filter template variables display as options in the `from` field, and existing group by template variables display as options following the `by` field. For example, if you configure the `environment` template variable, the `$environment` option is available as a dynamic variable in the widget.
127135

128136
{{< img src="dashboards/template_variables/dynamic_template_variable.png" alt="Template variable can be set dynamically in widgets" style="width:100%;">}}
129137

76.2 KB
Loading

0 commit comments

Comments
 (0)