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: content/en/dashboards/template_variables.md
+22-14Lines changed: 22 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ further_reading:
27
27
28
28
## Overview
29
29
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.
31
31
32
32
A template variable is defined by:
33
33
@@ -41,20 +41,28 @@ A template variable is defined by:
41
41
**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].
42
42
43
43
## 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%;" >}}
44
47
45
48
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.
49
53
1. (Optional) After selecting a tag, click the **+ Configure Dropdown Values** button to rename the variable and set default or available values.
1. To add more template variables, see [Edit a template variable](#edit-a-template-variable)
56
+
51
57
52
58
## Edit a template variable
53
59
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.
56
62
1. In edit mode, click on a template variable and make changes in the popover.
57
63
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.
58
66
{{< 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%;" >}}
59
67
60
68
## Apply a template variable to widgets
@@ -75,31 +83,31 @@ To add a template variable to widget queries:
75
83
### Create
76
84
77
85
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.
79
87
1. Enter a unique name for the view with an optional description.
80
-
1. Click **Save**.
88
+
1. Click **Save**.
81
89
82
90
{{< img src="/dashboards/template_variables/saved_view_create.png" alt="Create saved views by selecting save selections as view" style="width:100%;" >}}
83
91
84
92
Your saved view appears in the dropdown menu. Click on the view to retrieve your previously saved template variable values.
85
93
86
94
### Delete
87
95
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.
89
97
1. Click **Delete View**.
90
98
91
99
### Modify
92
100
93
101
The **Default view** can only be edited by changing the default values of the template variables. To edit the Default View:
94
102
1. Hover over the templates.
95
-
1. Click **Edit** when the button appears.
103
+
1. Click **Edit** when the button appears.
96
104
1. Click **Done** to save.
97
105
98
106
To modify template variables values for other saved views:
99
107
1. Select the desired saved view from the dropdown menu.
100
108
1. Edit the template variables to have the new desired models.
101
109
1. Open the dropdown menu again.
102
-
1. Click **Save Changes**.
110
+
1. Click **Save Changes**.
103
111
104
112
{{< img src="/dashboards/template_variables/saved_views_update_template_variable.png" alt="Modify the template variables of your saved views" style="width:100%;" >}}
105
113
@@ -111,7 +119,7 @@ To edit the title and description:
111
119
112
120
## Usage
113
121
114
-
Template variables are used in widgets and event overlays.
122
+
Template variables are used in widgets and event overlays.
115
123
116
124
### Logs, APM, and RUM queries
117
125
@@ -123,7 +131,7 @@ On log, APM, and RUM widgets, you can use wildcards in the middle of a value (fo
123
131
124
132
### Widgets
125
133
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.
127
135
128
136
{{< img src="dashboards/template_variables/dynamic_template_variable.png" alt="Template variable can be set dynamically in widgets" style="width:100%;">}}
0 commit comments